Convert Vega-Lite To PNG

This task converts a Vega-Lite chart speciciation to a PNG file.

Input

Description

This task allows to create a PNG from a Vega-Lite specification.

How to use it?

Enter the Vega-Lite specification. You will get a generated Image.

Privacy

It's important to exercise caution when using this task, particularly with regard to sensitive information.

[1.0.0]:
First release
VersionAI ModelCreatedLink
1.0.0openai28.03.2023

API

The REST API allows you to call the tool with the same costs as when running the tool. Please generate an Personal access token before using the REST API.

Parameters

  • vega_lite_spec (Vega Lite Spec): The Vega-Lite chart specifications that should be converted to a png
  • Call the REST API by cURL
    curl -v -H "Authorization: Bearer PERSONAL_ACCESS_TOKEN" https://api.anysolve.ai/rest/v1/intern-text-to-image-vega/1.0.0?vega_lite_spec=%20%7B%20%22%24schema%22%3A%20%22https%3A%2F%2Fvega.github.io%2Fschema%2Fvega-lite%2Fv5.json%22%2C%20%22data%22%3A%20%7B%22url%22%3A%20%22data%2Fmovies.json%22%7D%2C%20%22mark%22%3A%20%22circle%22%2C%20%22encoding%22%3A%20%7B%20%22x%22%3A%20%7B%20%22bin%22%3A%20%7B%22maxbins%22%3A%2010%7D%2C%20%22field%22%3A%20%22IMDB%20Rating%22%20%7D%2C%20%22y%22%3A%20%7B%20%22bin%22%3A%20%7B%22maxbins%22%3A%2010%7D%2C%20%22field%22%3A%20%22Rotten%20Tomatoes%20Rating%22%20%7D%2C%20%22size%22%3A%20%7B%22aggregate%22%3A%20%22count%22%7D%20%7D%20%7D
  • Install the package with pip
    python3 -m pip install anysolve
  • Run in python3
    import os
    from anysolve import AnySolve
    anysolve_token = os.environ.get('ANYSOLVE_PERSONAL_ACCESS_TOKEN') # Resolve your personal access token here
    client = AnySolve(anysolve_token)
    res = client.run('intern-text-to-image-vega','1.0.0', {'vega_lite_spec': ' { "$schema": "https://vega.github.io/schema/vega-lite/v5.json", "data": {"url": "data/movies.json"}, "mark": "circle", "encoding": { "x": { "bin": {"maxbins": 10}, "field": "IMDB Rating" }, "y": { "bin": {"maxbins": 10}, "field": "Rotten Tomatoes Rating" }, "size": {"aggregate": "count"} } }'})
    print(res)
  • Coming soon: Within AnySolve ChatComplete prompts you can use the following command to execute the task:
    /run('intern-text-to-image-vega','1.0.0', vega_lite_spec=' { "$schema": "https://vega.github.io/schema/vega-lite/v5.json", "data": {"url": "data/movies.json"}, "mark": "circle", "encoding": { "x": { "bin": {"maxbins": 10}, "field": "IMDB Rating" }, "y": { "bin": {"maxbins": 10}, "field": "Rotten Tomatoes Rating" }, "size": {"aggregate": "count"} } }')