David Vegh commited on
Commit
114e433
1 Parent(s): 62ec136

modify selection

Browse files
Files changed (1) hide show
  1. ipyvizzustory_demo.ipynb +25 -9
ipyvizzustory_demo.ipynb CHANGED
@@ -11,11 +11,11 @@
11
  "show-code: False\n",
12
  "params:\n",
13
  "params:\n",
14
- " example:\n",
15
  " input: select\n",
16
- " label: select the example\n",
17
- " choices: [basic, complex]\n",
18
- " multi: False\n",
19
  "---"
20
  ]
21
  },
@@ -28,7 +28,7 @@
28
  "source": [
29
  "# configure default value\n",
30
  "\n",
31
- "example = 'complex'"
32
  ]
33
  },
34
  {
@@ -44,7 +44,9 @@
44
  "from ipyvizzustory import Slide, Step\n",
45
  "\n",
46
  "from ipyvizzustory import Story # or\n",
47
- "# from ipyvizzustory.env.ipy.story import Story"
 
 
48
  ]
49
  },
50
  {
@@ -109,7 +111,19 @@
109
  "source": [
110
  "# you can set the width and height (CSS style)\n",
111
  "\n",
112
- "story.set_size(width=\"400px\", height=\"240px\")"
 
 
 
 
 
 
 
 
 
 
 
 
113
  ]
114
  },
115
  {
@@ -119,8 +133,10 @@
119
  "metadata": {},
120
  "outputs": [],
121
  "source": [
122
- "if example == \"basic\":\n",
123
- " story.play()"
 
 
124
  ]
125
  }
126
  ],
 
11
  "show-code: False\n",
12
  "params:\n",
13
  "params:\n",
14
+ " show:\n",
15
  " input: select\n",
16
+ " label: select what you want to see\n",
17
+ " choices: [animation, code]\n",
18
+ " multi: True\n",
19
  "---"
20
  ]
21
  },
 
28
  "source": [
29
  "# configure default value\n",
30
  "\n",
31
+ "show = 'complex'"
32
  ]
33
  },
34
  {
 
44
  "from ipyvizzustory import Slide, Step\n",
45
  "\n",
46
  "from ipyvizzustory import Story # or\n",
47
+ "# from ipyvizzustory.env.ipy.story import Story\n",
48
+ "\n",
49
+ "from IPython.display import display as display_html, HTML"
50
  ]
51
  },
52
  {
 
111
  "source": [
112
  "# you can set the width and height (CSS style)\n",
113
  "\n",
114
+ "story.set_size(width=\"800px\", height=\"480px\")"
115
+ ]
116
+ },
117
+ {
118
+ "cell_type": "code",
119
+ "execution_count": null,
120
+ "id": "e06ff4de",
121
+ "metadata": {},
122
+ "outputs": [],
123
+ "source": [
124
+ "# you can get the html Story as a string\n",
125
+ "\n",
126
+ "html = story.to_html()"
127
  ]
128
  },
129
  {
 
133
  "metadata": {},
134
  "outputs": [],
135
  "source": [
136
+ "if show == \"animation\":\n",
137
+ " story.play()\n",
138
+ "if show == \"code\":\n",
139
+ " display_html(HTML(html))"
140
  ]
141
  }
142
  ],