Coverage for src/ipyvizzustory/env/ipy/story.py: 100%
9 statements
« prev ^ index » next coverage.py v7.5.4, created at 2024-07-10 10:22 +0000
« prev ^ index » next coverage.py v7.5.4, created at 2024-07-10 10:22 +0000
1"""A module for working with presentation stories in `Jupyter`/`IPython` environment."""
3from typing import Optional
5from IPython.display import display as display_html, HTML # type: ignore
7from ipyvizzu import Data, Style
9from ipyvizzustory.storylib.story import Story as StoryLib
12class Story(StoryLib):
13 """A class for representing a presentation story in `Jupyter`/`IPython` environment."""
15 def __init__(self, data: Data, style: Optional[Style] = None):
16 """
17 Presentation Story constructor.
19 Args:
20 data: Data set for the whole presentation story.
21 After initialization `data` can not be modified,
22 but it can be filtered.
23 style: Style settings for the presentation story.
24 `style` can be changed at each presentation step.
25 """
27 super().__init__(data=data, style=style)
29 def play(self) -> None:
30 """A method for displaying the assembled `HTML` code in `Jupyter`/`IPython` environment."""
32 display_html(HTML(self.to_html()))