Skip to content

Basic example

The below story shows a basic use case for ipyvizzu-story.

from ipyvizzu import Data, Config
from ipyvizzustory import Story, Slide, Step

# Create data object
data = Data()
data.add_series("Foo", ["Alice", "Bob", "Ted"])
data.add_series("Bar", [15, 32, 12])
data.add_series("Baz", [5, 3, 2])

# Create story object, add data to it
story = Story(data=data)

# Each slide here is a page in the final interactive story
# Add the first slide
slide1 = Slide(
        Config({"x": "Foo", "y": "Bar"}),
# Add the slide to the story

# Create the second slide
# Configs provided here are changes to the visualization
# created in the previous Step
slide2 = Slide(
        Config({"color": "Foo", "x": "Baz", "geometry": "circle"}),

# Play the created story!