##// END OF EJS Templates
Updated widget notebooks for PyData2014
Jonathan Frederic -
Show More
@@ -1,7 +1,7 b''
1 {
1 {
2 "metadata": {
2 "metadata": {
3 "name": "",
3 "name": "",
4 "signature": "sha256:1bcfb489c7d06f192acb47b6bbdecb16bb661cd695b6a2977221c17f521e81bb"
4 "signature": "sha256:9763f005a69fc65b7a7977011d9604b09b4959e7293cbbb2cf35cc482380e671"
5 },
5 },
6 "nbformat": 3,
6 "nbformat": 3,
7 "nbformat_minor": 0,
7 "nbformat_minor": 0,
@@ -9,15 +9,11 b''
9 {
9 {
10 "cells": [
10 "cells": [
11 {
11 {
12 "cell_type": "code",
12 "cell_type": "markdown",
13 "collapsed": false,
14 "input": [
15 "from __future__ import print_function # For py 2.7 compat"
16 ],
17 "language": "python",
18 "metadata": {},
13 "metadata": {},
19 "outputs": [],
14 "source": [
20 "prompt_number": 20
15 "[Index](Index.ipynb) - [Back](Widget Styling.ipynb)"
16 ]
21 },
17 },
22 {
18 {
23 "cell_type": "heading",
19 "cell_type": "heading",
@@ -28,10 +24,21 b''
28 ]
24 ]
29 },
25 },
30 {
26 {
27 "cell_type": "code",
28 "collapsed": false,
29 "input": [
30 "from __future__ import print_function # For py 2.7 compat"
31 ],
32 "language": "python",
33 "metadata": {},
34 "outputs": [],
35 "prompt_number": 1
36 },
37 {
31 "cell_type": "markdown",
38 "cell_type": "markdown",
32 "metadata": {},
39 "metadata": {},
33 "source": [
40 "source": [
34 "The widget framework is built on top of the Comm framework (short for communication). The Comm framework is a framework that allows you send/recieve JSON messages to/from the front-end. To create a custom widget, you need to define the widget both in the back-end and in the front-end. "
41 "The widget framework is built on top of the Comm framework (short for communication). The Comm framework is a framework that allows you send/receive JSON messages to/from the front-end. To create a custom widget, you need to define the widget both in the back-end and in the front-end. "
35 ]
42 ]
36 },
43 },
37 {
44 {
@@ -54,7 +61,7 b''
54 "cell_type": "markdown",
61 "cell_type": "markdown",
55 "metadata": {},
62 "metadata": {},
56 "source": [
63 "source": [
57 "To define a widget, you must inherit from the Widget or DOMWidget base class. If you intend for your widget to be displayed in the IPython notebook, you'll need to inherit from the DOMWidget. The DOMWidget class itself inherits from the Widget class. The Widget class is useful for cases in which the Widget isn't meant to be displayed directly in the notebook, but instead as a child of another rendering environment. For example, if you wanted to create a D3.js widget (a popular WebGL library), you would implement the rendering window as a DOMWidget and any 3D objects or lights meant to be rendered in that window as Widgets."
64 "To define a widget, you must inherit from the Widget or DOMWidget base class. If you intend for your widget to be displayed in the IPython notebook, you'll need to inherit from the DOMWidget. The DOMWidget class itself inherits from the Widget class. The Widget class is useful for cases in which the Widget is not meant to be displayed directly in the notebook, but instead as a child of another rendering environment. For example, if you wanted to create a D3.js widget (a popular WebGL library), you would implement the rendering window as a DOMWidget and any 3D objects or lights meant to be rendered in that window as Widgets."
58 ]
65 ]
59 },
66 },
60 {
67 {
@@ -69,7 +76,7 b''
69 "cell_type": "markdown",
76 "cell_type": "markdown",
70 "metadata": {},
77 "metadata": {},
71 "source": [
78 "source": [
72 "Inheriting from the DOMWidget doesn't tell the widget framework what front-end widget to associate with your back-end widget. Instead, you must tell it yourself by defining a specially named Traitlet, `_view_name` (as seen below)."
79 "Inheriting from the DOMWidget does not tell the widget framework what front-end widget to associate with your back-end widget. Instead, you must tell it yourself by defining a specially named Traitlet, `_view_name` (as seen below)."
73 ]
80 ]
74 },
81 },
75 {
82 {
@@ -85,13 +92,13 b''
85 "language": "python",
92 "language": "python",
86 "metadata": {},
93 "metadata": {},
87 "outputs": [],
94 "outputs": [],
88 "prompt_number": 21
95 "prompt_number": 2
89 },
96 },
90 {
97 {
91 "cell_type": "markdown",
98 "cell_type": "markdown",
92 "metadata": {},
99 "metadata": {},
93 "source": [
100 "source": [
94 "Traitlets is an IPython library for defining type-safe properties on configurable objects. For this tutorial you do not need to worry about the *configurable* piece of the traitlets machinery. The `sync=True` kwarg tells the widget framework to handle synchronizing that value to the front-end. Without `sync=True`, the front-end would have no knowlege of `_view_name`."
101 "Traitlets is an IPython library for defining type-safe properties on configurable objects. For this tutorial you do not need to worry about the *configurable* piece of the traitlets machinery. The `sync=True` keyword argument tells the widget framework to handle synchronizing that value to the front-end. Without `sync=True`, the front-end would have no knowledge of `_view_name`."
95 ]
102 ]
96 },
103 },
97 {
104 {
@@ -175,7 +182,7 b''
175 "cell_type": "markdown",
182 "cell_type": "markdown",
176 "metadata": {},
183 "metadata": {},
177 "source": [
184 "source": [
178 "You first need to import the WidgetManager. You will use it later to register your view by name (the same name you used in the backend). To import the widget manager, use the `require` method of [require.js](http://requirejs.org/) (as seen below)."
185 "You first need to import the WidgetManager. You will use it later to register your view by name (the same name you used in the back-end). To import the widget manager, use the `require` method of [require.js](http://requirejs.org/) (as seen below)."
179 ]
186 ]
180 },
187 },
181 {
188 {
@@ -205,7 +212,7 b''
205 ]
212 ]
206 }
213 }
207 ],
214 ],
208 "prompt_number": 22
215 "prompt_number": 3
209 },
216 },
210 {
217 {
211 "cell_type": "markdown",
218 "cell_type": "markdown",
@@ -255,13 +262,13 b''
255 ]
262 ]
256 }
263 }
257 ],
264 ],
258 "prompt_number": 23
265 "prompt_number": 4
259 },
266 },
260 {
267 {
261 "cell_type": "markdown",
268 "cell_type": "markdown",
262 "metadata": {},
269 "metadata": {},
263 "source": [
270 "source": [
264 "Lastly, override the base `render` method of the view to define custom rendering logic. A handle to the widget's default div element can be aquired via `this.$el`. The `$el` property is a [jQuery](http://jquery.com/) object handle (which can be thought of as a supercharged version of the normal DOM element's handle)."
271 "Lastly, override the base `render` method of the view to define custom rendering logic. A handle to the widget's default div element can be acquired via `this.$el`. The `$el` property is a [jQuery](http://jquery.com/) object handle (which can be thought of as a supercharged version of the normal DOM element's handle)."
265 ]
272 ]
266 },
273 },
267 {
274 {
@@ -309,7 +316,7 b''
309 ]
316 ]
310 }
317 }
311 ],
318 ],
312 "prompt_number": 24
319 "prompt_number": 5
313 },
320 },
314 {
321 {
315 "cell_type": "heading",
322 "cell_type": "heading",
@@ -335,7 +342,7 b''
335 "language": "python",
342 "language": "python",
336 "metadata": {},
343 "metadata": {},
337 "outputs": [],
344 "outputs": [],
338 "prompt_number": 25
345 "prompt_number": 6
339 },
346 },
340 {
347 {
341 "cell_type": "heading",
348 "cell_type": "heading",
@@ -349,7 +356,7 b''
349 "cell_type": "markdown",
356 "cell_type": "markdown",
350 "metadata": {},
357 "metadata": {},
351 "source": [
358 "source": [
352 "There isn't much that you can do with the above example that you can't do with the IPython display framework. To change this, you will make the widget stateful. Instead of displaying a static \"hello world\" message, it will display a string set by the backend. First you need to add the traitlet in the back-end. Use the name of `value` to stay consistent with the rest of the widget framework and to allow your widget to be used with interact."
359 "There is not much that you can do with the above example that you can't do with the IPython display framework. To change this, you will make the widget stateful. Instead of displaying a static \"hello world\" message, it will display a string set by the back-end. First you need to add the traitlet in the back-end. Use the name of `value` to stay consistent with the rest of the widget framework and to allow your widget to be used with interact."
353 ]
360 ]
354 },
361 },
355 {
362 {
@@ -363,7 +370,7 b''
363 "language": "python",
370 "language": "python",
364 "metadata": {},
371 "metadata": {},
365 "outputs": [],
372 "outputs": [],
366 "prompt_number": 26
373 "prompt_number": 7
367 },
374 },
368 {
375 {
369 "cell_type": "heading",
376 "cell_type": "heading",
@@ -438,7 +445,7 b''
438 ]
445 ]
439 }
446 }
440 ],
447 ],
441 "prompt_number": 27
448 "prompt_number": 8
442 },
449 },
443 {
450 {
444 "cell_type": "markdown",
451 "cell_type": "markdown",
@@ -502,7 +509,7 b''
502 ]
509 ]
503 }
510 }
504 ],
511 ],
505 "prompt_number": 38
512 "prompt_number": 9
506 },
513 },
507 {
514 {
508 "cell_type": "heading",
515 "cell_type": "heading",
@@ -522,7 +529,7 b''
522 "language": "python",
529 "language": "python",
523 "metadata": {},
530 "metadata": {},
524 "outputs": [],
531 "outputs": [],
525 "prompt_number": 39
532 "prompt_number": 10
526 },
533 },
527 {
534 {
528 "cell_type": "code",
535 "cell_type": "code",
@@ -533,7 +540,7 b''
533 "language": "python",
540 "language": "python",
534 "metadata": {},
541 "metadata": {},
535 "outputs": [],
542 "outputs": [],
536 "prompt_number": 40
543 "prompt_number": 11
537 },
544 },
538 {
545 {
539 "cell_type": "heading",
546 "cell_type": "heading",
@@ -577,7 +584,7 b''
577 "language": "python",
584 "language": "python",
578 "metadata": {},
585 "metadata": {},
579 "outputs": [],
586 "outputs": [],
580 "prompt_number": 41
587 "prompt_number": 12
581 },
588 },
582 {
589 {
583 "cell_type": "heading",
590 "cell_type": "heading",
@@ -636,13 +643,20 b''
636 " var SpinnerView = IPython.DOMWidgetView.extend({\n",
643 " var SpinnerView = IPython.DOMWidgetView.extend({\n",
637 " \n",
644 " \n",
638 " render: function(){ \n",
645 " render: function(){ \n",
639 " this.$spinner = this.$el.spinner();\n",
646 " \n",
647 " // jQuery code to create a spinner and append it to $el\n",
648 " this.$input = $('<input />');\n",
649 " this.$el.append(this.$input);\n",
650 " this.$spinner = this.$input.spinner({\n",
651 " change: function( event, ui ) {}\n",
652 " });\n",
653 " \n",
640 " this.value_changed();\n",
654 " this.value_changed();\n",
641 " this.model.on('change:value', this.value_changed, this);\n",
655 " this.model.on('change:value', this.value_changed, this);\n",
642 " },\n",
656 " },\n",
643 " \n",
657 " \n",
644 " value_changed: function() {\n",
658 " value_changed: function() {\n",
645 " //this.$el.text(this.model.get('value')); \n",
659 " \n",
646 " },\n",
660 " },\n",
647 " });\n",
661 " });\n",
648 " \n",
662 " \n",
@@ -656,7 +670,7 b''
656 ]
670 ]
657 }
671 }
658 ],
672 ],
659 "prompt_number": 44
673 "prompt_number": 13
660 },
674 },
661 {
675 {
662 "cell_type": "markdown",
676 "cell_type": "markdown",
@@ -754,7 +768,7 b''
754 ]
768 ]
755 }
769 }
756 ],
770 ],
757 "prompt_number": 74
771 "prompt_number": 14
758 },
772 },
759 {
773 {
760 "cell_type": "heading",
774 "cell_type": "heading",
@@ -774,7 +788,7 b''
774 "language": "python",
788 "language": "python",
775 "metadata": {},
789 "metadata": {},
776 "outputs": [],
790 "outputs": [],
777 "prompt_number": 75
791 "prompt_number": 15
778 },
792 },
779 {
793 {
780 "cell_type": "code",
794 "cell_type": "code",
@@ -788,13 +802,13 b''
788 {
802 {
789 "metadata": {},
803 "metadata": {},
790 "output_type": "pyout",
804 "output_type": "pyout",
791 "prompt_number": 76,
805 "prompt_number": 16,
792 "text": [
806 "text": [
793 "5"
807 "5"
794 ]
808 ]
795 }
809 }
796 ],
810 ],
797 "prompt_number": 76
811 "prompt_number": 16
798 },
812 },
799 {
813 {
800 "cell_type": "code",
814 "cell_type": "code",
@@ -805,7 +819,7 b''
805 "language": "python",
819 "language": "python",
806 "metadata": {},
820 "metadata": {},
807 "outputs": [],
821 "outputs": [],
808 "prompt_number": 77
822 "prompt_number": 17
809 },
823 },
810 {
824 {
811 "cell_type": "markdown",
825 "cell_type": "markdown",
@@ -818,6 +832,7 b''
818 "cell_type": "code",
832 "cell_type": "code",
819 "collapsed": false,
833 "collapsed": false,
820 "input": [
834 "input": [
835 "from IPython.display import display\n",
821 "w1 = SpinnerWidget(value=0)\n",
836 "w1 = SpinnerWidget(value=0)\n",
822 "w2 = widgets.IntSliderWidget()\n",
837 "w2 = widgets.IntSliderWidget()\n",
823 "display(w1,w2)\n",
838 "display(w1,w2)\n",
@@ -828,7 +843,14 b''
828 "language": "python",
843 "language": "python",
829 "metadata": {},
844 "metadata": {},
830 "outputs": [],
845 "outputs": [],
831 "prompt_number": 78
846 "prompt_number": 18
847 },
848 {
849 "cell_type": "markdown",
850 "metadata": {},
851 "source": [
852 "[Index](Index.ipynb) - [Back](Widget Styling.ipynb)"
853 ]
832 }
854 }
833 ],
855 ],
834 "metadata": {}
856 "metadata": {}
@@ -1,7 +1,7 b''
1 {
1 {
2 "metadata": {
2 "metadata": {
3 "name": "",
3 "name": "",
4 "signature": "sha256:d788f17db7e02e94777b4b8aa36e55b29fc1806059dbb8a1cc9de60cdbe58825"
4 "signature": "sha256:30ea15a6e6354e2477229e50d01b6caa3c5033e422acfbff730d7c20ca875e78"
5 },
5 },
6 "nbformat": 3,
6 "nbformat": 3,
7 "nbformat_minor": 0,
7 "nbformat_minor": 0,
@@ -12,7 +12,14 b''
12 "cell_type": "markdown",
12 "cell_type": "markdown",
13 "metadata": {},
13 "metadata": {},
14 "source": [
14 "source": [
15 "# Simple widget introduction\n",
15 "[Index](Index.ipynb) - [Next](Widget List.ipynb)"
16 ]
17 },
18 {
19 "cell_type": "markdown",
20 "metadata": {},
21 "source": [
22 "# Simple Widget Introduction\n",
16 "\n",
23 "\n",
17 "## What are widgets?\n",
24 "## What are widgets?\n",
18 "<blockquote>Widgets are elements that exists in both the front-end and the back-end.</blockquote>\n",
25 "<blockquote>Widgets are elements that exists in both the front-end and the back-end.</blockquote>\n",
@@ -33,7 +40,7 b''
33 "language": "python",
40 "language": "python",
34 "metadata": {},
41 "metadata": {},
35 "outputs": [],
42 "outputs": [],
36 "prompt_number": 8
43 "prompt_number": 1
37 },
44 },
38 {
45 {
39 "cell_type": "markdown",
46 "cell_type": "markdown",
@@ -51,7 +58,7 b''
51 "language": "python",
58 "language": "python",
52 "metadata": {},
59 "metadata": {},
53 "outputs": [],
60 "outputs": [],
54 "prompt_number": 9
61 "prompt_number": 2
55 },
62 },
56 {
63 {
57 "cell_type": "markdown",
64 "cell_type": "markdown",
@@ -71,7 +78,7 b''
71 "language": "python",
78 "language": "python",
72 "metadata": {},
79 "metadata": {},
73 "outputs": [],
80 "outputs": [],
74 "prompt_number": 10
81 "prompt_number": 3
75 },
82 },
76 {
83 {
77 "cell_type": "markdown",
84 "cell_type": "markdown",
@@ -89,7 +96,7 b''
89 "language": "python",
96 "language": "python",
90 "metadata": {},
97 "metadata": {},
91 "outputs": [],
98 "outputs": [],
92 "prompt_number": 11
99 "prompt_number": 4
93 },
100 },
94 {
101 {
95 "cell_type": "markdown",
102 "cell_type": "markdown",
@@ -107,7 +114,7 b''
107 "language": "python",
114 "language": "python",
108 "metadata": {},
115 "metadata": {},
109 "outputs": [],
116 "outputs": [],
110 "prompt_number": 12
117 "prompt_number": 5
111 },
118 },
112 {
119 {
113 "cell_type": "markdown",
120 "cell_type": "markdown",
@@ -132,13 +139,13 b''
132 {
139 {
133 "metadata": {},
140 "metadata": {},
134 "output_type": "pyout",
141 "output_type": "pyout",
135 "prompt_number": 31,
142 "prompt_number": 6,
136 "text": [
143 "text": [
137 "41"
144 "0"
138 ]
145 ]
139 }
146 }
140 ],
147 ],
141 "prompt_number": 31
148 "prompt_number": 6
142 },
149 },
143 {
150 {
144 "cell_type": "markdown",
151 "cell_type": "markdown",
@@ -156,7 +163,7 b''
156 "language": "python",
163 "language": "python",
157 "metadata": {},
164 "metadata": {},
158 "outputs": [],
165 "outputs": [],
159 "prompt_number": 32
166 "prompt_number": 7
160 },
167 },
161 {
168 {
162 "cell_type": "markdown",
169 "cell_type": "markdown",
@@ -177,7 +184,7 b''
177 {
184 {
178 "metadata": {},
185 "metadata": {},
179 "output_type": "pyout",
186 "output_type": "pyout",
180 "prompt_number": 33,
187 "prompt_number": 8,
181 "text": [
188 "text": [
182 "['_view_name',\n",
189 "['_view_name',\n",
183 " 'orientation',\n",
190 " 'orientation',\n",
@@ -194,7 +201,7 b''
194 ]
201 ]
195 }
202 }
196 ],
203 ],
197 "prompt_number": 33
204 "prompt_number": 8
198 },
205 },
199 {
206 {
200 "cell_type": "markdown",
207 "cell_type": "markdown",
@@ -213,23 +220,7 b''
213 "language": "python",
220 "language": "python",
214 "metadata": {},
221 "metadata": {},
215 "outputs": [],
222 "outputs": [],
216 "prompt_number": 34
223 "prompt_number": 9
217 },
218 {
219 "cell_type": "markdown",
220 "metadata": {},
221 "source": [
222 "## Excercise\n",
223 "Create and display a `TextWidget`. Change that widget's `value` and some of it's other properties. Discover the other properties by querying the `keys` property of the instance."
224 ]
225 },
226 {
227 "cell_type": "code",
228 "collapsed": false,
229 "input": [],
230 "language": "python",
231 "metadata": {},
232 "outputs": []
233 },
224 },
234 {
225 {
235 "cell_type": "markdown",
226 "cell_type": "markdown",
@@ -255,7 +246,7 b''
255 "language": "python",
246 "language": "python",
256 "metadata": {},
247 "metadata": {},
257 "outputs": [],
248 "outputs": [],
258 "prompt_number": 51
249 "prompt_number": 10
259 },
250 },
260 {
251 {
261 "cell_type": "markdown",
252 "cell_type": "markdown",
@@ -273,13 +264,13 b''
273 "language": "python",
264 "language": "python",
274 "metadata": {},
265 "metadata": {},
275 "outputs": [],
266 "outputs": [],
276 "prompt_number": 52
267 "prompt_number": 11
277 },
268 },
278 {
269 {
279 "cell_type": "markdown",
270 "cell_type": "markdown",
280 "metadata": {},
271 "metadata": {},
281 "source": [
272 "source": [
282 "[Next](Widget List.ipynb)"
273 "[Index](Index.ipynb) - [Next](Widget List.ipynb)"
283 ]
274 ]
284 }
275 }
285 ],
276 ],
@@ -7,7 +7,7 b''
7 ]
7 ]
8 ],
8 ],
9 "name": "",
9 "name": "",
10 "signature": "sha256:b22622c3f45a7044f2bec2270852ca07a20e589d185d87a6c659f6e3f33547f4"
10 "signature": "sha256:32c66e8148a9ddc503302503ecda740cc85cf4a8930e2c69f06025f1dfd80780"
11 },
11 },
12 "nbformat": 3,
12 "nbformat": 3,
13 "nbformat_minor": 0,
13 "nbformat_minor": 0,
@@ -15,6 +15,29 b''
15 {
15 {
16 "cells": [
16 "cells": [
17 {
17 {
18 "cell_type": "markdown",
19 "metadata": {},
20 "source": [
21 "[Index](Index.ipynb) - [Back](Widget List.ipynb) - [Next](Widget Styling.ipynb)"
22 ]
23 },
24 {
25 "cell_type": "heading",
26 "level": 1,
27 "metadata": {},
28 "source": [
29 "Widget Events"
30 ]
31 },
32 {
33 "cell_type": "heading",
34 "level": 2,
35 "metadata": {},
36 "source": [
37 "Special events"
38 ]
39 },
40 {
18 "cell_type": "code",
41 "cell_type": "code",
19 "collapsed": false,
42 "collapsed": false,
20 "input": [
43 "input": [
@@ -23,13 +46,13 b''
23 "language": "python",
46 "language": "python",
24 "metadata": {},
47 "metadata": {},
25 "outputs": [],
48 "outputs": [],
26 "prompt_number": 12
49 "prompt_number": 1
27 },
50 },
28 {
51 {
29 "cell_type": "markdown",
52 "cell_type": "markdown",
30 "metadata": {},
53 "metadata": {},
31 "source": [
54 "source": [
32 "The `ButtonWidget` isn't used to represent a data type. Instead the button widget is used to handle mouse clicks. The `on_click` method of the `ButtonWidget` can be used to register function to be called when the button is clicked. The docstring of the `on_click` can be seen below."
55 "The `ButtonWidget` is not used to represent a data type. Instead the button widget is used to handle mouse clicks. The `on_click` method of the `ButtonWidget` can be used to register function to be called when the button is clicked. The doc string of the `on_click` can be seen below."
33 ]
56 ]
34 },
57 },
35 {
58 {
@@ -58,7 +81,7 b''
58 ]
81 ]
59 }
82 }
60 ],
83 ],
61 "prompt_number": 13
84 "prompt_number": 2
62 },
85 },
63 {
86 {
64 "cell_type": "markdown",
87 "cell_type": "markdown",
@@ -83,7 +106,7 b''
83 "language": "python",
106 "language": "python",
84 "metadata": {},
107 "metadata": {},
85 "outputs": [],
108 "outputs": [],
86 "prompt_number": 14
109 "prompt_number": 3
87 },
110 },
88 {
111 {
89 "cell_type": "markdown",
112 "cell_type": "markdown",
@@ -107,21 +130,21 b''
107 "language": "python",
130 "language": "python",
108 "metadata": {},
131 "metadata": {},
109 "outputs": [],
132 "outputs": [],
110 "prompt_number": 15
133 "prompt_number": 4
111 },
134 },
112 {
135 {
113 "cell_type": "heading",
136 "cell_type": "heading",
114 "level": 1,
137 "level": 2,
115 "metadata": {},
138 "metadata": {},
116 "source": [
139 "source": [
117 "Traitlet Events"
140 "Traitlet events"
118 ]
141 ]
119 },
142 },
120 {
143 {
121 "cell_type": "markdown",
144 "cell_type": "markdown",
122 "metadata": {},
145 "metadata": {},
123 "source": [
146 "source": [
124 "Widget properties are IPython traitlets. Traitlets are eventful. To handle changes, the `on_trait_change` method of the widget can be used to register a callback. The docstring for `on_trait_change` can be seen below. Both the `name` and `remove` properties are optional."
147 "Widget properties are IPython traitlets and traitlets are eventful. To handle changes, the `on_trait_change` method of the widget can be used to register a callback. The doc string for `on_trait_change` can be seen below. Both the `name` and `remove` properties are optional."
125 ]
148 ]
126 },
149 },
127 {
150 {
@@ -164,7 +187,7 b''
164 ]
187 ]
165 }
188 }
166 ],
189 ],
167 "prompt_number": 16
190 "prompt_number": 5
168 },
191 },
169 {
192 {
170 "cell_type": "markdown",
193 "cell_type": "markdown",
@@ -195,13 +218,13 b''
195 "language": "python",
218 "language": "python",
196 "metadata": {},
219 "metadata": {},
197 "outputs": [],
220 "outputs": [],
198 "prompt_number": 17
221 "prompt_number": 6
199 },
222 },
200 {
223 {
201 "cell_type": "markdown",
224 "cell_type": "markdown",
202 "metadata": {},
225 "metadata": {},
203 "source": [
226 "source": [
204 "[Next](Widget Styling.ipynb)"
227 "[Index](Index.ipynb) - [Back](Widget List.ipynb) - [Next](Widget Styling.ipynb)"
205 ]
228 ]
206 }
229 }
207 ],
230 ],
@@ -1,7 +1,7 b''
1 {
1 {
2 "metadata": {
2 "metadata": {
3 "name": "",
3 "name": "",
4 "signature": "sha256:6c84353e4cf4ba713ae4744419206f2fc8beb7bb3a709f21e1bc70e70c2c49cd"
4 "signature": "sha256:131de6f76f08282147aa3b67b3ad76b8c0fb76a8582d771c7f864f4e1e7c0e2a"
5 },
5 },
6 "nbformat": 3,
6 "nbformat": 3,
7 "nbformat_minor": 0,
7 "nbformat_minor": 0,
@@ -12,6 +12,13 b''
12 "cell_type": "markdown",
12 "cell_type": "markdown",
13 "metadata": {},
13 "metadata": {},
14 "source": [
14 "source": [
15 "[Index](Index.ipynb) - [Back](Widget Basics.ipynb) - [Next](Widget Events.ipynb)"
16 ]
17 },
18 {
19 "cell_type": "markdown",
20 "metadata": {},
21 "source": [
15 "# Widget List\n",
22 "# Widget List\n",
16 "\n",
23 "\n",
17 "## Complete list\n",
24 "## Complete list\n",
@@ -31,7 +38,7 b''
31 {
38 {
32 "metadata": {},
39 "metadata": {},
33 "output_type": "pyout",
40 "output_type": "pyout",
34 "prompt_number": 2,
41 "prompt_number": 1,
35 "text": [
42 "text": [
36 "['AccordionWidget',\n",
43 "['AccordionWidget',\n",
37 " 'BoundedFloatTextWidget',\n",
44 " 'BoundedFloatTextWidget',\n",
@@ -62,7 +69,7 b''
62 ]
69 ]
63 }
70 }
64 ],
71 ],
65 "prompt_number": 2
72 "prompt_number": 1
66 },
73 },
67 {
74 {
68 "cell_type": "heading",
75 "cell_type": "heading",
@@ -76,7 +83,7 b''
76 "cell_type": "markdown",
83 "cell_type": "markdown",
77 "metadata": {},
84 "metadata": {},
78 "source": [
85 "source": [
79 "There are 8 widgets distrubted with IPython that are designed to display numeric values. Widgets exist for displaying integers and floats, both bounded and unbounded. The integer widgets share a similar naming scheme to their floating point counterparts. By replacing `Float` with `Int` in the widget name, you can find the Integer equivalent."
86 "There are 8 widgets distributed with IPython that are designed to display numeric values. Widgets exist for displaying integers and floats, both bounded and unbounded. The integer widgets share a similar naming scheme to their floating point counterparts. By replacing `Float` with `Int` in the widget name, you can find the Integer equivalent."
80 ]
87 ]
81 },
88 },
82 {
89 {
@@ -102,7 +109,7 b''
102 "language": "python",
109 "language": "python",
103 "metadata": {},
110 "metadata": {},
104 "outputs": [],
111 "outputs": [],
105 "prompt_number": 3
112 "prompt_number": 2
106 },
113 },
107 {
114 {
108 "cell_type": "markdown",
115 "cell_type": "markdown",
@@ -127,7 +134,7 b''
127 "language": "python",
134 "language": "python",
128 "metadata": {},
135 "metadata": {},
129 "outputs": [],
136 "outputs": [],
130 "prompt_number": 5
137 "prompt_number": 3
131 },
138 },
132 {
139 {
133 "cell_type": "heading",
140 "cell_type": "heading",
@@ -152,7 +159,7 b''
152 "language": "python",
159 "language": "python",
153 "metadata": {},
160 "metadata": {},
154 "outputs": [],
161 "outputs": [],
155 "prompt_number": 6
162 "prompt_number": 4
156 },
163 },
157 {
164 {
158 "cell_type": "heading",
165 "cell_type": "heading",
@@ -176,7 +183,7 b''
176 "language": "python",
183 "language": "python",
177 "metadata": {},
184 "metadata": {},
178 "outputs": [],
185 "outputs": [],
179 "prompt_number": 10
186 "prompt_number": 5
180 },
187 },
181 {
188 {
182 "cell_type": "heading",
189 "cell_type": "heading",
@@ -198,7 +205,7 b''
198 "language": "python",
205 "language": "python",
199 "metadata": {},
206 "metadata": {},
200 "outputs": [],
207 "outputs": [],
201 "prompt_number": 11
208 "prompt_number": 6
202 },
209 },
203 {
210 {
204 "cell_type": "heading",
211 "cell_type": "heading",
@@ -235,7 +242,7 b''
235 "language": "python",
242 "language": "python",
236 "metadata": {},
243 "metadata": {},
237 "outputs": [],
244 "outputs": [],
238 "prompt_number": 14
245 "prompt_number": 7
239 },
246 },
240 {
247 {
241 "cell_type": "heading",
248 "cell_type": "heading",
@@ -257,7 +264,7 b''
257 "language": "python",
264 "language": "python",
258 "metadata": {},
265 "metadata": {},
259 "outputs": [],
266 "outputs": [],
260 "prompt_number": 17
267 "prompt_number": 8
261 },
268 },
262 {
269 {
263 "cell_type": "heading",
270 "cell_type": "heading",
@@ -271,7 +278,7 b''
271 "cell_type": "markdown",
278 "cell_type": "markdown",
272 "metadata": {},
279 "metadata": {},
273 "source": [
280 "source": [
274 "There are four widgets that can be used to display single selection lists. All four inherit from the same base class. You can specify the enumeration of selectables by passing a list. You can also specify the enumeration as a dictionary, in which case the keys will be used as the item displayed in the list and the corropsondong value will be returned when an item is selected."
281 "There are four widgets that can be used to display single selection lists. All four inherit from the same base class. You can specify the enumeration of selectables by passing a list. You can also specify the enumeration as a dictionary, in which case the keys will be used as the item displayed in the list and the corresponding value will be returned when an item is selected."
275 ]
282 ]
276 },
283 },
277 {
284 {
@@ -297,7 +304,7 b''
297 "language": "python",
304 "language": "python",
298 "metadata": {},
305 "metadata": {},
299 "outputs": [],
306 "outputs": [],
300 "prompt_number": 28
307 "prompt_number": 9
301 },
308 },
302 {
309 {
303 "cell_type": "code",
310 "cell_type": "code",
@@ -311,13 +318,13 b''
311 {
318 {
312 "metadata": {},
319 "metadata": {},
313 "output_type": "pyout",
320 "output_type": "pyout",
314 "prompt_number": 29,
321 "prompt_number": 10,
315 "text": [
322 "text": [
316 "2"
323 "2"
317 ]
324 ]
318 }
325 }
319 ],
326 ],
320 "prompt_number": 29
327 "prompt_number": 10
321 },
328 },
322 {
329 {
323 "cell_type": "markdown",
330 "cell_type": "markdown",
@@ -340,7 +347,7 b''
340 "language": "python",
347 "language": "python",
341 "metadata": {},
348 "metadata": {},
342 "outputs": [],
349 "outputs": [],
343 "prompt_number": 30
350 "prompt_number": 11
344 },
351 },
345 {
352 {
346 "cell_type": "code",
353 "cell_type": "code",
@@ -354,13 +361,13 b''
354 {
361 {
355 "metadata": {},
362 "metadata": {},
356 "output_type": "pyout",
363 "output_type": "pyout",
357 "prompt_number": 31,
364 "prompt_number": 12,
358 "text": [
365 "text": [
359 "2"
366 "2"
360 ]
367 ]
361 }
368 }
362 ],
369 ],
363 "prompt_number": 31
370 "prompt_number": 12
364 },
371 },
365 {
372 {
366 "cell_type": "heading",
373 "cell_type": "heading",
@@ -382,7 +389,7 b''
382 "language": "python",
389 "language": "python",
383 "metadata": {},
390 "metadata": {},
384 "outputs": [],
391 "outputs": [],
385 "prompt_number": 32
392 "prompt_number": 13
386 },
393 },
387 {
394 {
388 "cell_type": "heading",
395 "cell_type": "heading",
@@ -404,7 +411,7 b''
404 "language": "python",
411 "language": "python",
405 "metadata": {},
412 "metadata": {},
406 "outputs": [],
413 "outputs": [],
407 "prompt_number": 33
414 "prompt_number": 14
408 },
415 },
409 {
416 {
410 "cell_type": "heading",
417 "cell_type": "heading",
@@ -426,7 +433,7 b''
426 "language": "python",
433 "language": "python",
427 "metadata": {},
434 "metadata": {},
428 "outputs": [],
435 "outputs": [],
429 "prompt_number": 34
436 "prompt_number": 15
430 },
437 },
431 {
438 {
432 "cell_type": "heading",
439 "cell_type": "heading",
@@ -440,7 +447,7 b''
440 "cell_type": "markdown",
447 "cell_type": "markdown",
441 "metadata": {},
448 "metadata": {},
442 "source": [
449 "source": [
443 "There are 4 widgets that can be used to display a string value. Of those, the `TextWidget` and `TextareaWidget` accept input. The `LatexWidget` and `HTMLWidget` display the string as either Latex or HTML respecively, but do not accept input."
450 "There are 4 widgets that can be used to display a string value. Of those, the `TextWidget` and `TextareaWidget` accept input. The `LatexWidget` and `HTMLWidget` display the string as either Latex or HTML respectively, but do not accept input."
444 ]
451 ]
445 },
452 },
446 {
453 {
@@ -457,13 +464,13 b''
457 "input": [
464 "input": [
458 "widgets.TextWidget(\n",
465 "widgets.TextWidget(\n",
459 " description='String:',\n",
466 " description='String:',\n",
460 " value='Hello PyData',\n",
467 " value='Hello World',\n",
461 ")"
468 ")"
462 ],
469 ],
463 "language": "python",
470 "language": "python",
464 "metadata": {},
471 "metadata": {},
465 "outputs": [],
472 "outputs": [],
466 "prompt_number": 39
473 "prompt_number": 16
467 },
474 },
468 {
475 {
469 "cell_type": "heading",
476 "cell_type": "heading",
@@ -479,13 +486,13 b''
479 "input": [
486 "input": [
480 "widgets.TextareaWidget(\n",
487 "widgets.TextareaWidget(\n",
481 " description='String:',\n",
488 " description='String:',\n",
482 " value='Hello PyData',\n",
489 " value='Hello World',\n",
483 ")"
490 ")"
484 ],
491 ],
485 "language": "python",
492 "language": "python",
486 "metadata": {},
493 "metadata": {},
487 "outputs": [],
494 "outputs": [],
488 "prompt_number": 40
495 "prompt_number": 17
489 },
496 },
490 {
497 {
491 "cell_type": "heading",
498 "cell_type": "heading",
@@ -506,7 +513,7 b''
506 "language": "python",
513 "language": "python",
507 "metadata": {},
514 "metadata": {},
508 "outputs": [],
515 "outputs": [],
509 "prompt_number": 52
516 "prompt_number": 18
510 },
517 },
511 {
518 {
512 "cell_type": "heading",
519 "cell_type": "heading",
@@ -521,36 +528,13 b''
521 "collapsed": false,
528 "collapsed": false,
522 "input": [
529 "input": [
523 "widgets.HTMLWidget(\n",
530 "widgets.HTMLWidget(\n",
524 " value=\"Hello <b>PyData</b>\"\n",
531 " value=\"Hello <b>World</b>\"\n",
525 ")"
532 ")"
526 ],
533 ],
527 "language": "python",
534 "language": "python",
528 "metadata": {},
535 "metadata": {},
529 "outputs": [],
536 "outputs": [],
530 "prompt_number": 53
537 "prompt_number": 20
531 },
532 {
533 "cell_type": "heading",
534 "level": 3,
535 "metadata": {},
536 "source": [
537 "Using link to make a simple Latex editor"
538 ]
539 },
540 {
541 "cell_type": "code",
542 "collapsed": false,
543 "input": [
544 "from IPython.utils.traitlets import link\n",
545 "w1 = widgets.TextareaWidget()\n",
546 "w2 = widgets.LatexWidget()\n",
547 "display(w1, w2)\n",
548 "mylink = link((w1, 'value'), (w2, 'value'))"
549 ],
550 "language": "python",
551 "metadata": {},
552 "outputs": [],
553 "prompt_number": 58
554 },
538 },
555 {
539 {
556 "cell_type": "heading",
540 "cell_type": "heading",
@@ -569,13 +553,13 b''
569 "language": "python",
553 "language": "python",
570 "metadata": {},
554 "metadata": {},
571 "outputs": [],
555 "outputs": [],
572 "prompt_number": 60
556 "prompt_number": 21
573 },
557 },
574 {
558 {
575 "cell_type": "markdown",
559 "cell_type": "markdown",
576 "metadata": {},
560 "metadata": {},
577 "source": [
561 "source": [
578 "[Next](Widget Events.ipynb)"
562 "[Index](Index.ipynb) - [Back](Widget Basics.ipynb) - [Next](Widget Events.ipynb)"
579 ]
563 ]
580 }
564 }
581 ],
565 ],
@@ -7,7 +7,7 b''
7 ]
7 ]
8 ],
8 ],
9 "name": "",
9 "name": "",
10 "signature": "sha256:55ee4a4661f0939c40550752218a4c127b985536811190a2b7e581d7fe25cec7"
10 "signature": "sha256:98ca4ae261d3dc9c0b43b3fa822772a47fff9956e443c640b2caead8d02efece"
11 },
11 },
12 "nbformat": 3,
12 "nbformat": 3,
13 "nbformat_minor": 0,
13 "nbformat_minor": 0,
@@ -15,6 +15,21 b''
15 {
15 {
16 "cells": [
16 "cells": [
17 {
17 {
18 "cell_type": "markdown",
19 "metadata": {},
20 "source": [
21 "[Index](Index.ipynb) - [Back](Widget Events.ipynb) - [Next](Custom Widget - Hello World.ipynb)"
22 ]
23 },
24 {
25 "cell_type": "heading",
26 "level": 1,
27 "metadata": {},
28 "source": [
29 "Widget Styling"
30 ]
31 },
32 {
18 "cell_type": "code",
33 "cell_type": "code",
19 "collapsed": false,
34 "collapsed": false,
20 "input": [
35 "input": [
@@ -47,11 +62,11 b''
47 ]
62 ]
48 }
63 }
49 ],
64 ],
50 "prompt_number": 145
65 "prompt_number": 1
51 },
66 },
52 {
67 {
53 "cell_type": "heading",
68 "cell_type": "heading",
54 "level": 1,
69 "level": 2,
55 "metadata": {},
70 "metadata": {},
56 "source": [
71 "source": [
57 "CSS"
72 "CSS"
@@ -76,7 +91,7 b''
76 "language": "python",
91 "language": "python",
77 "metadata": {},
92 "metadata": {},
78 "outputs": [],
93 "outputs": [],
79 "prompt_number": 146
94 "prompt_number": 2
80 },
95 },
81 {
96 {
82 "cell_type": "markdown",
97 "cell_type": "markdown",
@@ -94,7 +109,7 b''
94 "language": "python",
109 "language": "python",
95 "metadata": {},
110 "metadata": {},
96 "outputs": [],
111 "outputs": [],
97 "prompt_number": 147
112 "prompt_number": 3
98 },
113 },
99 {
114 {
100 "cell_type": "markdown",
115 "cell_type": "markdown",
@@ -112,7 +127,7 b''
112 "language": "python",
127 "language": "python",
113 "metadata": {},
128 "metadata": {},
114 "outputs": [],
129 "outputs": [],
115 "prompt_number": 148
130 "prompt_number": 4
116 },
131 },
117 {
132 {
118 "cell_type": "markdown",
133 "cell_type": "markdown",
@@ -130,7 +145,7 b''
130 "language": "python",
145 "language": "python",
131 "metadata": {},
146 "metadata": {},
132 "outputs": [],
147 "outputs": [],
133 "prompt_number": 149
148 "prompt_number": 5
134 },
149 },
135 {
150 {
136 "cell_type": "markdown",
151 "cell_type": "markdown",
@@ -153,7 +168,7 b''
153 "language": "python",
168 "language": "python",
154 "metadata": {},
169 "metadata": {},
155 "outputs": [],
170 "outputs": [],
156 "prompt_number": 150
171 "prompt_number": 6
157 },
172 },
158 {
173 {
159 "cell_type": "markdown",
174 "cell_type": "markdown",
@@ -164,10 +179,10 b''
164 },
179 },
165 {
180 {
166 "cell_type": "heading",
181 "cell_type": "heading",
167 "level": 1,
182 "level": 2,
168 "metadata": {},
183 "metadata": {},
169 "source": [
184 "source": [
170 "Parent/Child Relationships"
185 "Parent/child relationships"
171 ]
186 ]
172 },
187 },
173 {
188 {
@@ -176,7 +191,7 b''
176 "source": [
191 "source": [
177 "To display widget A inside widget B, widget A must be a child of widget B. Only one instance of any particular widget can be child of another. In other words, *widget A* cannot have *widget B* listed twice in it's list of children.\n",
192 "To display widget A inside widget B, widget A must be a child of widget B. Only one instance of any particular widget can be child of another. In other words, *widget A* cannot have *widget B* listed twice in it's list of children.\n",
178 "\n",
193 "\n",
179 "Widgets that can contain other widgets have a `children` attribute. This attribute can be set via a kwarg in the widget's constructor or after construction. Calling display on an object with children automatically displays those children, too."
194 "Widgets that can contain other widgets have a `children` attribute. This attribute can be set via a keyword argument in the widget's constructor or after construction. Calling display on an object with children automatically displays those children, too."
180 ]
195 ]
181 },
196 },
182 {
197 {
@@ -196,7 +211,7 b''
196 "language": "python",
211 "language": "python",
197 "metadata": {},
212 "metadata": {},
198 "outputs": [],
213 "outputs": [],
199 "prompt_number": 151
214 "prompt_number": 7
200 },
215 },
201 {
216 {
202 "cell_type": "markdown",
217 "cell_type": "markdown",
@@ -219,7 +234,7 b''
219 "language": "python",
234 "language": "python",
220 "metadata": {},
235 "metadata": {},
221 "outputs": [],
236 "outputs": [],
222 "prompt_number": 152
237 "prompt_number": 8
223 },
238 },
224 {
239 {
225 "cell_type": "heading",
240 "cell_type": "heading",
@@ -265,7 +280,7 b''
265 "language": "python",
280 "language": "python",
266 "metadata": {},
281 "metadata": {},
267 "outputs": [],
282 "outputs": [],
268 "prompt_number": 153
283 "prompt_number": 9
269 },
284 },
270 {
285 {
271 "cell_type": "heading",
286 "cell_type": "heading",
@@ -296,7 +311,7 b''
296 "language": "python",
311 "language": "python",
297 "metadata": {},
312 "metadata": {},
298 "outputs": [],
313 "outputs": [],
299 "prompt_number": 154
314 "prompt_number": 10
300 },
315 },
301 {
316 {
302 "cell_type": "heading",
317 "cell_type": "heading",
@@ -324,7 +339,7 b''
324 "language": "python",
339 "language": "python",
325 "metadata": {},
340 "metadata": {},
326 "outputs": [],
341 "outputs": [],
327 "prompt_number": 155
342 "prompt_number": 11
328 },
343 },
329 {
344 {
330 "cell_type": "code",
345 "cell_type": "code",
@@ -335,7 +350,7 b''
335 "language": "python",
350 "language": "python",
336 "metadata": {},
351 "metadata": {},
337 "outputs": [],
352 "outputs": [],
338 "prompt_number": 156
353 "prompt_number": 12
339 },
354 },
340 {
355 {
341 "cell_type": "code",
356 "cell_type": "code",
@@ -344,7 +359,7 b''
344 "language": "python",
359 "language": "python",
345 "metadata": {},
360 "metadata": {},
346 "outputs": [],
361 "outputs": [],
347 "prompt_number": 156
362 "prompt_number": 12
348 },
363 },
349 {
364 {
350 "cell_type": "code",
365 "cell_type": "code",
@@ -353,7 +368,7 b''
353 "language": "python",
368 "language": "python",
354 "metadata": {},
369 "metadata": {},
355 "outputs": [],
370 "outputs": [],
356 "prompt_number": 156
371 "prompt_number": 12
357 },
372 },
358 {
373 {
359 "cell_type": "code",
374 "cell_type": "code",
@@ -362,7 +377,7 b''
362 "language": "python",
377 "language": "python",
363 "metadata": {},
378 "metadata": {},
364 "outputs": [],
379 "outputs": [],
365 "prompt_number": 156
380 "prompt_number": 12
366 },
381 },
367 {
382 {
368 "cell_type": "code",
383 "cell_type": "code",
@@ -371,7 +386,7 b''
371 "language": "python",
386 "language": "python",
372 "metadata": {},
387 "metadata": {},
373 "outputs": [],
388 "outputs": [],
374 "prompt_number": 156
389 "prompt_number": 12
375 },
390 },
376 {
391 {
377 "cell_type": "code",
392 "cell_type": "code",
@@ -380,7 +395,7 b''
380 "language": "python",
395 "language": "python",
381 "metadata": {},
396 "metadata": {},
382 "outputs": [],
397 "outputs": [],
383 "prompt_number": 156
398 "prompt_number": 12
384 },
399 },
385 {
400 {
386 "cell_type": "code",
401 "cell_type": "code",
@@ -389,7 +404,7 b''
389 "language": "python",
404 "language": "python",
390 "metadata": {},
405 "metadata": {},
391 "outputs": [],
406 "outputs": [],
392 "prompt_number": 156
407 "prompt_number": 12
393 },
408 },
394 {
409 {
395 "cell_type": "code",
410 "cell_type": "code",
@@ -398,7 +413,7 b''
398 "language": "python",
413 "language": "python",
399 "metadata": {},
414 "metadata": {},
400 "outputs": [],
415 "outputs": [],
401 "prompt_number": 156
416 "prompt_number": 12
402 },
417 },
403 {
418 {
404 "cell_type": "code",
419 "cell_type": "code",
@@ -407,7 +422,7 b''
407 "language": "python",
422 "language": "python",
408 "metadata": {},
423 "metadata": {},
409 "outputs": [],
424 "outputs": [],
410 "prompt_number": 156
425 "prompt_number": 12
411 },
426 },
412 {
427 {
413 "cell_type": "code",
428 "cell_type": "code",
@@ -416,7 +431,7 b''
416 "language": "python",
431 "language": "python",
417 "metadata": {},
432 "metadata": {},
418 "outputs": [],
433 "outputs": [],
419 "prompt_number": 156
434 "prompt_number": 12
420 },
435 },
421 {
436 {
422 "cell_type": "code",
437 "cell_type": "code",
@@ -425,7 +440,7 b''
425 "language": "python",
440 "language": "python",
426 "metadata": {},
441 "metadata": {},
427 "outputs": [],
442 "outputs": [],
428 "prompt_number": 156
443 "prompt_number": 12
429 },
444 },
430 {
445 {
431 "cell_type": "code",
446 "cell_type": "code",
@@ -434,7 +449,7 b''
434 "language": "python",
449 "language": "python",
435 "metadata": {},
450 "metadata": {},
436 "outputs": [],
451 "outputs": [],
437 "prompt_number": 156
452 "prompt_number": 12
438 },
453 },
439 {
454 {
440 "cell_type": "code",
455 "cell_type": "code",
@@ -443,7 +458,7 b''
443 "language": "python",
458 "language": "python",
444 "metadata": {},
459 "metadata": {},
445 "outputs": [],
460 "outputs": [],
446 "prompt_number": 156
461 "prompt_number": 12
447 },
462 },
448 {
463 {
449 "cell_type": "code",
464 "cell_type": "code",
@@ -452,7 +467,7 b''
452 "language": "python",
467 "language": "python",
453 "metadata": {},
468 "metadata": {},
454 "outputs": [],
469 "outputs": [],
455 "prompt_number": 156
470 "prompt_number": 12
456 },
471 },
457 {
472 {
458 "cell_type": "code",
473 "cell_type": "code",
@@ -461,7 +476,7 b''
461 "language": "python",
476 "language": "python",
462 "metadata": {},
477 "metadata": {},
463 "outputs": [],
478 "outputs": [],
464 "prompt_number": 156
479 "prompt_number": 12
465 },
480 },
466 {
481 {
467 "cell_type": "code",
482 "cell_type": "code",
@@ -472,7 +487,7 b''
472 "language": "python",
487 "language": "python",
473 "metadata": {},
488 "metadata": {},
474 "outputs": [],
489 "outputs": [],
475 "prompt_number": 157
490 "prompt_number": 13
476 },
491 },
477 {
492 {
478 "cell_type": "code",
493 "cell_type": "code",
@@ -483,7 +498,7 b''
483 "language": "python",
498 "language": "python",
484 "metadata": {},
499 "metadata": {},
485 "outputs": [],
500 "outputs": [],
486 "prompt_number": 158
501 "prompt_number": 14
487 },
502 },
488 {
503 {
489 "cell_type": "heading",
504 "cell_type": "heading",
@@ -513,7 +528,7 b''
513 "language": "python",
528 "language": "python",
514 "metadata": {},
529 "metadata": {},
515 "outputs": [],
530 "outputs": [],
516 "prompt_number": 159
531 "prompt_number": 15
517 },
532 },
518 {
533 {
519 "cell_type": "markdown",
534 "cell_type": "markdown",
@@ -534,7 +549,7 b''
534 "language": "python",
549 "language": "python",
535 "metadata": {},
550 "metadata": {},
536 "outputs": [],
551 "outputs": [],
537 "prompt_number": 160
552 "prompt_number": 16
538 },
553 },
539 {
554 {
540 "cell_type": "markdown",
555 "cell_type": "markdown",
@@ -555,7 +570,7 b''
555 "language": "python",
570 "language": "python",
556 "metadata": {},
571 "metadata": {},
557 "outputs": [],
572 "outputs": [],
558 "prompt_number": 161
573 "prompt_number": 17
559 },
574 },
560 {
575 {
561 "cell_type": "heading",
576 "cell_type": "heading",
@@ -616,7 +631,7 b''
616 ]
631 ]
617 }
632 }
618 ],
633 ],
619 "prompt_number": 162
634 "prompt_number": 18
620 },
635 },
621 {
636 {
622 "cell_type": "code",
637 "cell_type": "code",
@@ -635,7 +650,7 b''
635 "language": "python",
650 "language": "python",
636 "metadata": {},
651 "metadata": {},
637 "outputs": [],
652 "outputs": [],
638 "prompt_number": 163
653 "prompt_number": 19
639 },
654 },
640 {
655 {
641 "cell_type": "code",
656 "cell_type": "code",
@@ -649,7 +664,7 b''
649 "language": "python",
664 "language": "python",
650 "metadata": {},
665 "metadata": {},
651 "outputs": [],
666 "outputs": [],
652 "prompt_number": 164
667 "prompt_number": 20
653 },
668 },
654 {
669 {
655 "cell_type": "code",
670 "cell_type": "code",
@@ -663,7 +678,7 b''
663 "language": "python",
678 "language": "python",
664 "metadata": {},
679 "metadata": {},
665 "outputs": [],
680 "outputs": [],
666 "prompt_number": 165
681 "prompt_number": 21
667 },
682 },
668 {
683 {
669 "cell_type": "heading",
684 "cell_type": "heading",
@@ -719,7 +734,7 b''
719 "</div>\n",
734 "</div>\n",
720 "\n",
735 "\n",
721 "### Aligning classes\n",
736 "### Aligning classes\n",
722 "These examples use the hbox layout to show alignment. Packing is the alignment of the widgets along the the axis perpindicular to the one that they are displayed on.\n",
737 "These examples use the hbox layout to show alignment. Packing is the alignment of the widgets along the the axis perpendicular to the one that they are displayed on.\n",
723 "#### \"align-start\"\n",
738 "#### \"align-start\"\n",
724 "<div class=\"example-container hbox align-start\">\n",
739 "<div class=\"example-container hbox align-start\">\n",
725 "<div class=\"example-box\">A</div>\n",
740 "<div class=\"example-box\">A</div>\n",
@@ -814,7 +829,7 b''
814 "language": "python",
829 "language": "python",
815 "metadata": {},
830 "metadata": {},
816 "outputs": [],
831 "outputs": [],
817 "prompt_number": 166
832 "prompt_number": 22
818 },
833 },
819 {
834 {
820 "cell_type": "markdown",
835 "cell_type": "markdown",
@@ -835,7 +850,7 b''
835 "language": "python",
850 "language": "python",
836 "metadata": {},
851 "metadata": {},
837 "outputs": [],
852 "outputs": [],
838 "prompt_number": 167
853 "prompt_number": 23
839 },
854 },
840 {
855 {
841 "cell_type": "markdown",
856 "cell_type": "markdown",
@@ -854,7 +869,7 b''
854 "language": "python",
869 "language": "python",
855 "metadata": {},
870 "metadata": {},
856 "outputs": [],
871 "outputs": [],
857 "prompt_number": 168
872 "prompt_number": 24
858 },
873 },
859 {
874 {
860 "cell_type": "heading",
875 "cell_type": "heading",
@@ -907,7 +922,7 b''
907 "language": "python",
922 "language": "python",
908 "metadata": {},
923 "metadata": {},
909 "outputs": [],
924 "outputs": [],
910 "prompt_number": 180
925 "prompt_number": 25
911 },
926 },
912 {
927 {
913 "cell_type": "heading",
928 "cell_type": "heading",
@@ -937,7 +952,7 b''
937 "language": "python",
952 "language": "python",
938 "metadata": {},
953 "metadata": {},
939 "outputs": [],
954 "outputs": [],
940 "prompt_number": 181
955 "prompt_number": 26
941 },
956 },
942 {
957 {
943 "cell_type": "heading",
958 "cell_type": "heading",
@@ -972,11 +987,11 b''
972 "language": "python",
987 "language": "python",
973 "metadata": {},
988 "metadata": {},
974 "outputs": [],
989 "outputs": [],
975 "prompt_number": 182
990 "prompt_number": 27
976 },
991 },
977 {
992 {
978 "cell_type": "heading",
993 "cell_type": "heading",
979 "level": 1,
994 "level": 2,
980 "metadata": {},
995 "metadata": {},
981 "source": [
996 "source": [
982 "Visibility"
997 "Visibility"
@@ -986,7 +1001,7 b''
986 "cell_type": "markdown",
1001 "cell_type": "markdown",
987 "metadata": {},
1002 "metadata": {},
988 "source": [
1003 "source": [
989 "Sometimes it is necessary to hide or show widgets in place, without having to redisplay the widget.\n",
1004 "Sometimes it is necessary to hide or show widgets in place, without having to re-display the widget.\n",
990 "The `visibility` property of widgets can be used to hide or show widgets that have already been displayed (as seen below)."
1005 "The `visibility` property of widgets can be used to hide or show widgets that have already been displayed (as seen below)."
991 ]
1006 ]
992 },
1007 },
@@ -1000,7 +1015,7 b''
1000 "language": "python",
1015 "language": "python",
1001 "metadata": {},
1016 "metadata": {},
1002 "outputs": [],
1017 "outputs": [],
1003 "prompt_number": 183
1018 "prompt_number": 28
1004 },
1019 },
1005 {
1020 {
1006 "cell_type": "code",
1021 "cell_type": "code",
@@ -1011,7 +1026,7 b''
1011 "language": "python",
1026 "language": "python",
1012 "metadata": {},
1027 "metadata": {},
1013 "outputs": [],
1028 "outputs": [],
1014 "prompt_number": 184
1029 "prompt_number": 29
1015 },
1030 },
1016 {
1031 {
1017 "cell_type": "code",
1032 "cell_type": "code",
@@ -1022,7 +1037,7 b''
1022 "language": "python",
1037 "language": "python",
1023 "metadata": {},
1038 "metadata": {},
1024 "outputs": [],
1039 "outputs": [],
1025 "prompt_number": 185
1040 "prompt_number": 30
1026 },
1041 },
1027 {
1042 {
1028 "cell_type": "markdown",
1043 "cell_type": "markdown",
@@ -1059,13 +1074,13 b''
1059 "language": "python",
1074 "language": "python",
1060 "metadata": {},
1075 "metadata": {},
1061 "outputs": [],
1076 "outputs": [],
1062 "prompt_number": 186
1077 "prompt_number": 31
1063 },
1078 },
1064 {
1079 {
1065 "cell_type": "markdown",
1080 "cell_type": "markdown",
1066 "metadata": {},
1081 "metadata": {},
1067 "source": [
1082 "source": [
1068 "[Next](Custom Widget - Hello World.ipynb)"
1083 "[Index](Index.ipynb) - [Back](Widget Events.ipynb) - [Next](Custom Widget - Hello World.ipynb)"
1069 ]
1084 ]
1070 }
1085 }
1071 ],
1086 ],
General Comments 0
You need to be logged in to leave comments. Login now