Coverage for src/ipyvizzustory/storylib/template.py: 100%
6 statements
« prev ^ index » next coverage.py v7.2.7, created at 2023-06-10 09:08 +0000
« prev ^ index » next coverage.py v7.2.7, created at 2023-06-10 09:08 +0000
1"""A module for storing the `HTML` templates."""
4VIZZU_STORY: str = (
5 "https://cdn.jsdelivr.net/npm/vizzu-story@0.4/dist/vizzu-story.min.js"
6)
7"""A variable for storing the default url of the `vizzu-story` package."""
9DISPLAY_INDENT: str = " "
10"""A variable for storing the default indent in the `HTML` template."""
12DISPLAY_TEMPLATE: str = """
13<div>
14 <vizzu-player id="{id}" {vizzu_attribute} {start_slide} controller></vizzu-player>
15 <script type="module">
16 import VizzuPlayer from "{vizzu_story}";
18 const vp = document.getElementById("{id}");
19 import(vp.vizzuUrl).then(vizzuLoaded => {{
20 const lib = vizzuLoaded.default;
21 const vizzuPlayerData = {vizzu_player_data};
22 // story.set_size()
23 {chart_size}
24 vp.slides = vizzuPlayerData;
25 vp.initializing.then(chart => {{
26 // story.set_feature()
27 {chart_features}
28 // story.add_event()
29 {chart_events}
30 }});
31 }});
32 </script>
33</div>
34"""
35"""A variable for storing the `vizzu-story` `HTML` template."""