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

3 statements  

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

1"""A module for storing the information needed to generate html code.""" 

2 

3 

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

5 

6DISPLAY_INDENT = " " 

7 

8DISPLAY_TEMPLATE = """ 

9<div> 

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

11 <script type="module"> 

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

13 

14 

15 const vizzuPlayerData = {vizzu_player_data}; 

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

17 // story.set_size() 

18 {chart_size} 

19 vizzuPlayer.slides = vizzuPlayerData; 

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

21 // story.set_feature() 

22 {chart_features} 

23 // story.add_event() 

24 {chart_events} 

25 }}); 

26 </script> 

27</div> 

28"""