Skip to content

How to pass data to vizzu-story #3

Open
@simzer

Description

@simzer

Instead of hard-coding the data in the py-script elements`s inner text like here:
https://github.com/vizzuhq/pyscript-vizzu-story/blob/main/index.html

How could the user pass the data from a python variable? E.g.:

<py-script>
myData = {
		"series": [
		  { "name": "Foo", "values": ["Alice", "Bob", "Ted"] },
		  { "name": "Bar", "values": [15, 32, 12] },
		  { "name": "Baz", "values": [5, 3, 2] }
		]
	}
</py-script>
<py-vizzu-story>
        {
            "data": myData,
            "slides": [
              {
                "config": {
                  "x": "Foo",
                  "y": "Bar"
                }
              },
              {
                "config": {
                  "color": "Foo",
                  "x": "Baz", 
                  "geometry": "circle" 
                }
              }
            ]
        }
</py-vizzu-story>

It would probably be a frequent use-case to get the data from a csv file or a pandas dataframe, etc...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions