|
16 | 16 | "\n",
|
17 | 17 | "# Getting Started\n",
|
18 | 18 | "\n",
|
19 |
| - "The first thing we need must do in order to run IDOM in a Jupyter Notebook is `import idom_jupyter`. After that, you'll be able to use IDOM components like any other [Jupyter Widget](https://ipywidgets.readthedocs.io/en/latest/#)." |
| 19 | + "Then, before anything else, do one of the following:\n", |
| 20 | + "\n", |
| 21 | + "1. At the top of your notebook run\n", |
| 22 | + "\n", |
| 23 | + " ```python\n", |
| 24 | + " import idom_jupyter\n", |
| 25 | + " ```\n", |
| 26 | + "\n", |
| 27 | + "2. Register `idom_jupyter` as a permanant IPython extension in [your config file](https://ipython.readthedocs.io/en/stable/config/intro.html#introduction-to-ipython-configuration):\n", |
| 28 | + "\n", |
| 29 | + " ```python\n", |
| 30 | + " c.InteractiveShellApp.extensions = ['idom_jupyter']\n", |
| 31 | + " ```\n", |
| 32 | + "\n", |
| 33 | + "For the purposes of this tutorial, you'll want to do the first:" |
20 | 34 | ]
|
21 | 35 | },
|
22 | 36 | {
|
23 | 37 | "cell_type": "code",
|
24 |
| - "execution_count": 2, |
| 38 | + "execution_count": null, |
25 | 39 | "metadata": {},
|
26 | 40 | "outputs": [],
|
27 | 41 | "source": [
|
|
39 | 53 | },
|
40 | 54 | {
|
41 | 55 | "cell_type": "code",
|
42 |
| - "execution_count": 3, |
| 56 | + "execution_count": null, |
43 | 57 | "metadata": {},
|
44 |
| - "outputs": [ |
45 |
| - { |
46 |
| - "data": { |
47 |
| - "text/plain": [ |
48 |
| - "App(7fb016a9afe0)" |
49 |
| - ] |
50 |
| - }, |
51 |
| - "execution_count": 3, |
52 |
| - "metadata": {}, |
53 |
| - "output_type": "execute_result" |
54 |
| - }, |
55 |
| - { |
56 |
| - "data": { |
57 |
| - "application/vnd.jupyter.widget-view+json": { |
58 |
| - "model_id": "7a9d9d0847d94e71b53ee3e9b22566d9", |
59 |
| - "version_major": 2, |
60 |
| - "version_minor": 0 |
61 |
| - }, |
62 |
| - "text/plain": [ |
63 |
| - "LayoutWidget(Layout(App(7fb016a9afe0)))" |
64 |
| - ] |
65 |
| - }, |
66 |
| - "metadata": {}, |
67 |
| - "output_type": "display_data" |
68 |
| - } |
69 |
| - ], |
| 58 | + "outputs": [], |
70 | 59 | "source": [
|
71 | 60 | "from idom import component, html, run\n",
|
72 | 61 | "\n",
|
|
143 | 132 | },
|
144 | 133 | {
|
145 | 134 | "cell_type": "code",
|
146 |
| - "execution_count": 8, |
| 135 | + "execution_count": null, |
147 | 136 | "metadata": {},
|
148 |
| - "outputs": [ |
149 |
| - { |
150 |
| - "data": { |
151 |
| - "text/plain": [ |
152 |
| - "Gallery(7fb017f937c0)" |
153 |
| - ] |
154 |
| - }, |
155 |
| - "execution_count": 8, |
156 |
| - "metadata": {}, |
157 |
| - "output_type": "execute_result" |
158 |
| - }, |
159 |
| - { |
160 |
| - "data": { |
161 |
| - "application/vnd.jupyter.widget-view+json": { |
162 |
| - "model_id": "dd0ea39fb8164a12a6e3b495296b9ea3", |
163 |
| - "version_major": 2, |
164 |
| - "version_minor": 0 |
165 |
| - }, |
166 |
| - "text/plain": [ |
167 |
| - "LayoutWidget(Layout(Gallery(7fb017f937c0)))" |
168 |
| - ] |
169 |
| - }, |
170 |
| - "metadata": {}, |
171 |
| - "output_type": "display_data" |
172 |
| - } |
173 |
| - ], |
| 137 | + "outputs": [], |
174 | 138 | "source": [
|
175 | 139 | "import json\n",
|
176 | 140 | "from pathlib import Path\n",
|
|
221 | 185 | },
|
222 | 186 | {
|
223 | 187 | "cell_type": "code",
|
224 |
| - "execution_count": 14, |
| 188 | + "execution_count": null, |
225 | 189 | "metadata": {},
|
226 | 190 | "outputs": [],
|
227 | 191 | "source": [
|
|
256 | 220 | },
|
257 | 221 | {
|
258 | 222 | "cell_type": "code",
|
259 |
| - "execution_count": 15, |
| 223 | + "execution_count": null, |
260 | 224 | "metadata": {},
|
261 |
| - "outputs": [ |
262 |
| - { |
263 |
| - "data": { |
264 |
| - "application/vnd.jupyter.widget-view+json": { |
265 |
| - "model_id": "4ce3c50a8f1e4c6ca7c290cee10a89af", |
266 |
| - "version_major": 2, |
267 |
| - "version_minor": 0 |
268 |
| - }, |
269 |
| - "text/plain": [ |
270 |
| - "Box(children=(IntSlider(value=0, readout=False), LayoutWidget(Layout(SliderObserver(7fb01611ed40, slider=IntSl…" |
271 |
| - ] |
272 |
| - }, |
273 |
| - "execution_count": 15, |
274 |
| - "metadata": {}, |
275 |
| - "output_type": "execute_result" |
276 |
| - } |
277 |
| - ], |
| 225 | + "outputs": [], |
278 | 226 | "source": [
|
279 | 227 | "from ipywidgets import Box, IntSlider\n",
|
280 | 228 | "from idom_jupyter import LayoutWidget\n",
|
|
295 | 243 | },
|
296 | 244 | {
|
297 | 245 | "cell_type": "code",
|
298 |
| - "execution_count": 16, |
| 246 | + "execution_count": null, |
299 | 247 | "metadata": {},
|
300 |
| - "outputs": [ |
301 |
| - { |
302 |
| - "data": { |
303 |
| - "application/vnd.jupyter.widget-view+json": { |
304 |
| - "model_id": "b1797d7cf50f4b1eb9d5cfe34ef87663", |
305 |
| - "version_major": 2, |
306 |
| - "version_minor": 0 |
307 |
| - }, |
308 |
| - "text/plain": [ |
309 |
| - "Box(children=(IntSlider(value=0, readout=False), LayoutWidget(Layout(SliderObserver(7fb01611fa00, slider=IntSl…" |
310 |
| - ] |
311 |
| - }, |
312 |
| - "execution_count": 16, |
313 |
| - "metadata": {}, |
314 |
| - "output_type": "execute_result" |
315 |
| - } |
316 |
| - ], |
| 248 | + "outputs": [], |
317 | 249 | "source": [
|
318 | 250 | "from idom_jupyter import widgetize\n",
|
319 | 251 | "\n",
|
|
0 commit comments