Coverage for src/ipyvizzustory/ipy_env/story.py: 100%
11 statements
« prev ^ index » next coverage.py v7.2.2, created at 2023-03-23 18:23 +0100
« prev ^ index » next coverage.py v7.2.2, created at 2023-03-23 18:23 +0100
1"""A module for working with ipyvizzu-story presentations."""
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 environment."""
15 def __init__(self, data: Data, style: Optional[Style] = None):
16 super().__init__(data=data, style=style)
18 def _repr_html_(self) -> str:
19 return self.to_html()
21 def play(self) -> None:
22 """A method for displaying the html code."""
24 display_html(HTML(self.to_html()))