Skip to content

Commit 53d5ec7

Browse files
committed
Add more content to notebook
Signed-off-by: Itay Dafna <[email protected]>
1 parent abe1f26 commit 53d5ec7

File tree

1 file changed

+100
-58
lines changed

1 file changed

+100
-58
lines changed

notebooks/08.Ipywidgets_8/08.00-ipywidgets_8.ipynb

+100-58
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,14 @@
3030
"id": "8d1c293b-9eee-4355-af38-34a997efaf44",
3131
"metadata": {},
3232
"source": [
33-
"#### In this session will cover some of the main changes in ipywidgets 8 for both users and developers"
33+
"#### In this session will cover some of the main changes in ipywidgets 8 for users. These changes are also documented in [here](https://ipywidgets.readthedocs.io/en/latest/user_migration_guides.html)\n",
34+
"\n",
35+
"#### If you are a widgets developer, please refer to [the migration guide](https://ipywidgets.readthedocs.io/en/latest/migration_guides.html)"
3436
]
3537
},
3638
{
3739
"cell_type": "code",
38-
"execution_count": 3,
40+
"execution_count": null,
3941
"id": "a0881c40-c4b0-434d-a1a4-857cba969601",
4042
"metadata": {},
4143
"outputs": [],
@@ -45,21 +47,10 @@
4547
},
4648
{
4749
"cell_type": "code",
48-
"execution_count": 4,
50+
"execution_count": null,
4951
"id": "a89234b0-b0a0-46d3-8567-97465d69dff4",
5052
"metadata": {},
51-
"outputs": [
52-
{
53-
"data": {
54-
"text/plain": [
55-
"'8.0.0rc1'"
56-
]
57-
},
58-
"execution_count": 4,
59-
"metadata": {},
60-
"output_type": "execute_result"
61-
}
62-
],
53+
"outputs": [],
6354
"source": [
6455
"widgets.__version__"
6556
]
@@ -69,13 +60,15 @@
6960
"id": "a407df5a-d525-46f7-adf2-fac35c2b9d8a",
7061
"metadata": {},
7162
"source": [
72-
"#### Python 2.x and <=3.5 is not supported in ipywidgets 8."
63+
"<span style=\"color: red; font-weight: bold\">Python 2.x and <=3.5 are not supported in ipywidgets 8.</span>"
7364
]
7465
},
7566
{
7667
"cell_type": "markdown",
7768
"id": "b35372a7-dc80-48f5-9c03-f7d59c52c59e",
78-
"metadata": {},
69+
"metadata": {
70+
"tags": []
71+
},
7972
"source": [
8073
"#### New styling attributes support for core widgets:\n",
8174
"1. `font-family` \n",
@@ -88,28 +81,12 @@
8881
},
8982
{
9083
"cell_type": "code",
91-
"execution_count": 53,
84+
"execution_count": null,
9285
"id": "dbe91b98-bb7a-4292-8df0-efbc49fdfef0",
9386
"metadata": {},
94-
"outputs": [
95-
{
96-
"data": {
97-
"application/vnd.jupyter.widget-view+json": {
98-
"model_id": "554101bd5a314be4bcefc9f34465a7e3",
99-
"version_major": 2,
100-
"version_minor": 0
101-
},
102-
"text/plain": [
103-
"VBox(children=(HBox(children=(Combobox(value='option B', options=('option A', 'option B', 'Another option'), s…"
104-
]
105-
},
106-
"execution_count": 53,
107-
"metadata": {},
108-
"output_type": "execute_result"
109-
}
110-
],
87+
"outputs": [],
11188
"source": [
112-
"from ipywidgets import ToggleButton, Checkbox, Button, HTML, HTMLMath, Label, Textarea, Password, Combobox, HBox, VBox\n",
89+
"from ipywidgets import Valid, Text, ToggleButton, Checkbox, Button, HTML, HTMLMath, Label, Textarea, Password, Combobox, HBox, VBox\n",
11390
"\n",
11491
"checkbox = Checkbox(description='Option A', style=dict(background='lightblue'))\n",
11592
"valid = Valid(value=False, style=dict(background='lightblue'))\n",
@@ -204,29 +181,13 @@
204181
},
205182
{
206183
"cell_type": "code",
207-
"execution_count": 43,
184+
"execution_count": null,
208185
"id": "22dd3054-3c92-4377-b708-542bd7f4db4e",
209186
"metadata": {},
210-
"outputs": [
211-
{
212-
"data": {
213-
"application/vnd.jupyter.widget-view+json": {
214-
"model_id": "661df8350d804df79494075c43f4a2f9",
215-
"version_major": 2,
216-
"version_minor": 0
217-
},
218-
"text/plain": [
219-
"Button(layout=Layout(border_bottom='5px solid red', border_left='5px solid green', border_right='5px solid blu…"
220-
]
221-
},
222-
"execution_count": 43,
223-
"metadata": {},
224-
"output_type": "execute_result"
225-
}
226-
],
187+
"outputs": [],
227188
"source": [
228189
"from ipywidgets import Button, Layout\n",
229-
"btn = widgets.Button(layout=Layout(border_left=\"5px solid green\", border_right=\"5px solid blue\", border_top=\"5px solid yellow\", border_bottom=\"5px solid red\"))\n",
190+
"btn = Button(layout=Layout(border_left=\"5px solid green\", border_right=\"5px solid blue\", border_top=\"5px solid yellow\", border_bottom=\"5px solid red\"))\n",
230191
"btn"
231192
]
232193
},
@@ -238,12 +199,37 @@
238199
"#### New slider implementation based on `nouislider` with support for range dragging."
239200
]
240201
},
202+
{
203+
"cell_type": "code",
204+
"execution_count": null,
205+
"id": "1aed6d31-834e-48f4-b196-526d6de2de39",
206+
"metadata": {},
207+
"outputs": [],
208+
"source": [
209+
"from ipywidgets import IntRangeSlider\n",
210+
"slider = IntRangeSlider(min=0, max=100)\n",
211+
"slider"
212+
]
213+
},
241214
{
242215
"cell_type": "markdown",
243216
"id": "709e5005-1569-4232-a618-5bde081247db",
244217
"metadata": {},
245218
"source": [
246-
"#### Tooltip for any HTML-based widget"
219+
"#### Tooltips available on all DOM widgets"
220+
]
221+
},
222+
{
223+
"cell_type": "code",
224+
"execution_count": null,
225+
"id": "efaeb9cb-a34a-4a81-94a2-b4b3329fbe81",
226+
"metadata": {},
227+
"outputs": [],
228+
"source": [
229+
"from ipywidgets import FileUpload\n",
230+
"\n",
231+
"fileupload = FileUpload(tooltip='Upload a file because this tooltip says so')\n",
232+
"fileupload"
247233
]
248234
},
249235
{
@@ -254,13 +240,69 @@
254240
"#### ErrorWidget fallback when widget models or views fail."
255241
]
256242
},
243+
{
244+
"cell_type": "markdown",
245+
"id": "2b912ea3-da50-4579-820e-4bdc3996d918",
246+
"metadata": {},
247+
"source": [
248+
"#### ADd `Stacked` layout attribute"
249+
]
250+
},
251+
{
252+
"cell_type": "code",
253+
"execution_count": null,
254+
"id": "c7bf1da3-f281-483a-962c-cd02be83a207",
255+
"metadata": {},
256+
"outputs": [],
257+
"source": [
258+
"from ipywidgets import Stacked, IntSlider\n",
259+
"button = Button(description='Click here')\n",
260+
"slider = IntSlider(value=100, min=0, max=100)\n",
261+
"stacked = Stacked([button, slider], selected_index=0)\n",
262+
"stacked # will show only the button\""
263+
]
264+
},
265+
{
266+
"cell_type": "markdown",
267+
"id": "21bcd147-9644-46d4-bb7b-54d6669611b0",
268+
"metadata": {},
269+
"source": [
270+
"#### New `TagsInput` widget"
271+
]
272+
},
273+
{
274+
"cell_type": "code",
275+
"execution_count": null,
276+
"id": "c3810042-70bd-4c9e-9328-44cea0332163",
277+
"metadata": {},
278+
"outputs": [],
279+
"source": [
280+
"from ipywidgets import TagsInput\n",
281+
"\n",
282+
"tagsinput = TagsInput(allowed_tags=\"One Two Three Four Five\".split())\n",
283+
"tagsinput"
284+
]
285+
},
286+
{
287+
"cell_type": "markdown",
288+
"id": "a00f2834-6340-4207-96cb-9cbd3cf08e10",
289+
"metadata": {},
290+
"source": [
291+
"#### New `DatetimePicker` widget"
292+
]
293+
},
257294
{
258295
"cell_type": "code",
259296
"execution_count": null,
260-
"id": "bec074df-80ab-4b9f-855e-e9bae4d8b1b5",
297+
"id": "2324621d-1d24-414d-b181-c2f8624e3821",
261298
"metadata": {},
262299
"outputs": [],
263-
"source": []
300+
"source": [
301+
"from ipywidgets import DatetimePicker\n",
302+
"import datetime\n",
303+
"dt = DatetimePicker()\n",
304+
"dt"
305+
]
264306
}
265307
],
266308
"metadata": {

0 commit comments

Comments
 (0)