|
8 | 8 | "\n", |
9 | 9 | "---\n", |
10 | 10 | "\n", |
11 | | - "[ReactPy](https://reactpy.dev/) is a library for building user interfaces in Python without Javascript. ReactPy interfaces are made from components which look and behave similarly to those found in [ReactJS](https://reactjs.org/). Designed with simplicity in mind, ReactPy can be used by those without web development experience while also being powerful enough to grow with your ambitions.\n", |
12 | | - "\n", |
13 | | - "\n", |
14 | | - "\n", |
15 | | - "# Getting Started\n", |
16 | | - "\n", |
17 | | - "Then, before anything else, do one of the following:\n", |
18 | | - "\n", |
19 | | - "1. At the top of your notebook run\n", |
20 | | - "\n", |
21 | | - " ```python\n", |
22 | | - " import reactpy_jupyter\n", |
23 | | - " ```\n", |
24 | | - "\n", |
25 | | - "2. Register `reactpy_jupyter` as a permanant IPython extension in [your config file](https://ipython.readthedocs.io/en/stable/config/intro.html#introduction-to-ipython-configuration):\n", |
26 | | - "\n", |
27 | | - " ```python\n", |
28 | | - " c.InteractiveShellApp.extensions = ['reactpy_jupyter']\n", |
29 | | - " ```\n", |
30 | | - "\n", |
31 | | - "For the purposes of this tutorial, you'll want to do the first:" |
32 | | - ] |
33 | | - }, |
34 | | - { |
35 | | - "cell_type": "code", |
36 | | - "execution_count": null, |
37 | | - "metadata": { |
38 | | - "tags": [] |
39 | | - }, |
40 | | - "outputs": [], |
41 | | - "source": [ |
42 | | - "import reactpy_jupyter" |
| 11 | + "[ReactPy](https://reactpy.dev/) is a library for building user interfaces in Python without Javascript. ReactPy interfaces are made from components which look and behave similarly to those found in [ReactJS](https://reactjs.org/). Designed with simplicity in mind, ReactPy can be used by those without web development experience while also being powerful enough to grow with your ambitions." |
43 | 12 | ] |
44 | 13 | }, |
45 | 14 | { |
|
53 | 22 | }, |
54 | 23 | { |
55 | 24 | "cell_type": "code", |
56 | | - "execution_count": null, |
| 25 | + "execution_count": 1, |
57 | 26 | "metadata": { |
58 | 27 | "tags": [] |
59 | 28 | }, |
60 | | - "outputs": [], |
| 29 | + "outputs": [ |
| 30 | + { |
| 31 | + "data": { |
| 32 | + "application/vnd.jupyter.widget-view+json": { |
| 33 | + "model_id": "e0c3c63d3e1c4d88a71bb7bbc6ae45e0", |
| 34 | + "version_major": 2, |
| 35 | + "version_minor": 0 |
| 36 | + }, |
| 37 | + "text/plain": [ |
| 38 | + "LayoutWidget(Layout(ContextProvider(<function context at 0x7f7986b10cc0>)))" |
| 39 | + ] |
| 40 | + }, |
| 41 | + "execution_count": 1, |
| 42 | + "metadata": {}, |
| 43 | + "output_type": "execute_result" |
| 44 | + } |
| 45 | + ], |
61 | 46 | "source": [ |
62 | 47 | "from reactpy import component, html\n", |
63 | 48 | "\n", |
|
83 | 68 | }, |
84 | 69 | { |
85 | 70 | "cell_type": "code", |
86 | | - "execution_count": null, |
| 71 | + "execution_count": 2, |
87 | 72 | "metadata": { |
88 | 73 | "tags": [] |
89 | 74 | }, |
90 | | - "outputs": [], |
| 75 | + "outputs": [ |
| 76 | + { |
| 77 | + "data": { |
| 78 | + "application/vnd.jupyter.widget-view+json": { |
| 79 | + "model_id": "a87baeb77dcc44e1a29ab154df1dd8a7", |
| 80 | + "version_major": 2, |
| 81 | + "version_minor": 0 |
| 82 | + }, |
| 83 | + "text/plain": [ |
| 84 | + "LayoutWidget(Layout(ContextProvider(<function context at 0x7f7986b10cc0>)))" |
| 85 | + ] |
| 86 | + }, |
| 87 | + "execution_count": 2, |
| 88 | + "metadata": {}, |
| 89 | + "output_type": "execute_result" |
| 90 | + } |
| 91 | + ], |
91 | 92 | "source": [ |
92 | 93 | "from reactpy import component, html\n", |
93 | 94 | "\n", |
|
136 | 137 | }, |
137 | 138 | { |
138 | 139 | "cell_type": "code", |
139 | | - "execution_count": null, |
| 140 | + "execution_count": 3, |
140 | 141 | "metadata": { |
141 | 142 | "tags": [] |
142 | 143 | }, |
143 | | - "outputs": [], |
| 144 | + "outputs": [ |
| 145 | + { |
| 146 | + "data": { |
| 147 | + "application/vnd.jupyter.widget-view+json": { |
| 148 | + "model_id": "920e5f89aba644528257e20deae25f2e", |
| 149 | + "version_major": 2, |
| 150 | + "version_minor": 0 |
| 151 | + }, |
| 152 | + "text/plain": [ |
| 153 | + "LayoutWidget(Layout(ContextProvider(<function context at 0x7f7986b10cc0>)))" |
| 154 | + ] |
| 155 | + }, |
| 156 | + "execution_count": 3, |
| 157 | + "metadata": {}, |
| 158 | + "output_type": "execute_result" |
| 159 | + } |
| 160 | + ], |
144 | 161 | "source": [ |
145 | 162 | "import json\n", |
146 | 163 | "from pathlib import Path\n", |
|
190 | 207 | }, |
191 | 208 | { |
192 | 209 | "cell_type": "code", |
193 | | - "execution_count": null, |
| 210 | + "execution_count": 4, |
194 | 211 | "metadata": {}, |
195 | | - "outputs": [], |
| 212 | + "outputs": [ |
| 213 | + { |
| 214 | + "data": { |
| 215 | + "application/vnd.jupyter.widget-view+json": { |
| 216 | + "model_id": "67cb81abf4ce4c9e991a9771607b9d5e", |
| 217 | + "version_major": 2, |
| 218 | + "version_minor": 0 |
| 219 | + }, |
| 220 | + "text/plain": [ |
| 221 | + "LayoutWidget(Layout(ContextProvider(<function context at 0x7f7986b10cc0>)))" |
| 222 | + ] |
| 223 | + }, |
| 224 | + "execution_count": 4, |
| 225 | + "metadata": {}, |
| 226 | + "output_type": "execute_result" |
| 227 | + } |
| 228 | + ], |
196 | 229 | "source": [ |
197 | 230 | "from reactpy_jupyter import from_widget\n", |
198 | 231 | "from ipywidgets import IntSlider\n", |
|
212 | 245 | }, |
213 | 246 | { |
214 | 247 | "cell_type": "code", |
215 | | - "execution_count": null, |
| 248 | + "execution_count": 5, |
216 | 249 | "metadata": { |
217 | 250 | "tags": [] |
218 | 251 | }, |
|
249 | 282 | }, |
250 | 283 | { |
251 | 284 | "cell_type": "code", |
252 | | - "execution_count": null, |
| 285 | + "execution_count": 6, |
253 | 286 | "metadata": { |
254 | 287 | "tags": [] |
255 | 288 | }, |
256 | | - "outputs": [], |
| 289 | + "outputs": [ |
| 290 | + { |
| 291 | + "data": { |
| 292 | + "application/vnd.jupyter.widget-view+json": { |
| 293 | + "model_id": "c586a0f0fe0b44a3bab173ccb9fa52d8", |
| 294 | + "version_major": 2, |
| 295 | + "version_minor": 0 |
| 296 | + }, |
| 297 | + "text/plain": [ |
| 298 | + "LayoutWidget(Layout(ContextProvider(<function context at 0x7f7986b10cc0>)))" |
| 299 | + ] |
| 300 | + }, |
| 301 | + "execution_count": 6, |
| 302 | + "metadata": {}, |
| 303 | + "output_type": "execute_result" |
| 304 | + } |
| 305 | + ], |
257 | 306 | "source": [ |
258 | 307 | "from ipywidgets import IntSlider\n", |
259 | 308 | "\n", |
|
269 | 318 | }, |
270 | 319 | { |
271 | 320 | "cell_type": "code", |
272 | | - "execution_count": null, |
| 321 | + "execution_count": 8, |
273 | 322 | "metadata": { |
274 | 323 | "tags": [] |
275 | 324 | }, |
276 | | - "outputs": [], |
| 325 | + "outputs": [ |
| 326 | + { |
| 327 | + "data": { |
| 328 | + "application/vnd.jupyter.widget-view+json": { |
| 329 | + "model_id": "a0180ea4781b4dda9f77d1be75fbcad3", |
| 330 | + "version_major": 2, |
| 331 | + "version_minor": 0 |
| 332 | + }, |
| 333 | + "text/plain": [ |
| 334 | + "Box(children=(IntSlider(value=0, readout=False), LayoutWidget(Layout(ContextProvider(<function context at 0x7f…" |
| 335 | + ] |
| 336 | + }, |
| 337 | + "execution_count": 8, |
| 338 | + "metadata": {}, |
| 339 | + "output_type": "execute_result" |
| 340 | + } |
| 341 | + ], |
277 | 342 | "source": [ |
278 | 343 | "from ipywidgets import Box\n", |
279 | 344 | "from reactpy_jupyter import to_widget\n", |
|
293 | 358 | }, |
294 | 359 | { |
295 | 360 | "cell_type": "code", |
296 | | - "execution_count": null, |
| 361 | + "execution_count": 9, |
297 | 362 | "metadata": {}, |
298 | | - "outputs": [], |
| 363 | + "outputs": [ |
| 364 | + { |
| 365 | + "data": { |
| 366 | + "application/vnd.jupyter.widget-view+json": { |
| 367 | + "model_id": "abeb4c3af2164e00927b317e5dfb6569", |
| 368 | + "version_major": 2, |
| 369 | + "version_minor": 0 |
| 370 | + }, |
| 371 | + "text/plain": [ |
| 372 | + "Box(children=(LayoutWidget(Layout(ContextProvider(<function context at 0x7f7986b10cc0>))), LayoutWidget(Layout…" |
| 373 | + ] |
| 374 | + }, |
| 375 | + "execution_count": 9, |
| 376 | + "metadata": {}, |
| 377 | + "output_type": "execute_result" |
| 378 | + } |
| 379 | + ], |
299 | 380 | "source": [ |
300 | 381 | "slider = IntSlider(readout=False)\n", |
301 | 382 | "slider_observer_constructor = to_widget(SliderObserver)\n", |
|
0 commit comments