Coverage for src/ipyvizzustory/storylib/template.py: 100%

4 statements  

« prev     ^ index     » next       coverage.py v7.2.2, created at 2023-03-25 13:58 +0100

1"""A module for storing the html templates.""" 

2 

3 

4VIZZU_STORY = "https://cdn.jsdelivr.net/npm/vizzu-story@~0.1.0/dist/vizzu-story.min.js" 

5"""str: A variable for storing the default url of vizzu-story package.""" 

6 

7DISPLAY_INDENT = " " 

8"""str: A variable for storing the default indent in the html template.""" 

9 

10DISPLAY_TEMPLATE = """ 

11<div> 

12 <vizzu-player id="{id}" controller></vizzu-player> 

13 <script type="module"> 

14 import VizzuPlayer, {{ Vizzu as lib }} from "{vizzu_story}"; 

15 

16 

17 const vizzuPlayerData = {vizzu_player_data}; 

18 const vizzuPlayer = document.getElementById("{id}") 

19 // story.set_size() 

20 {chart_size} 

21 vizzuPlayer.slides = vizzuPlayerData; 

22 vizzuPlayer.vizzu.initializing.then(chart => {{ 

23 // story.set_feature() 

24 {chart_features} 

25 // story.add_event() 

26 {chart_events} 

27 }}); 

28 </script> 

29</div> 

30""" 

31"""str: A variable for storing the vizzu-story html template."""