|
30 | 30 | "id": "8d1c293b-9eee-4355-af38-34a997efaf44",
|
31 | 31 | "metadata": {},
|
32 | 32 | "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)" |
34 | 36 | ]
|
35 | 37 | },
|
36 | 38 | {
|
37 | 39 | "cell_type": "code",
|
38 |
| - "execution_count": 3, |
| 40 | + "execution_count": null, |
39 | 41 | "id": "a0881c40-c4b0-434d-a1a4-857cba969601",
|
40 | 42 | "metadata": {},
|
41 | 43 | "outputs": [],
|
|
45 | 47 | },
|
46 | 48 | {
|
47 | 49 | "cell_type": "code",
|
48 |
| - "execution_count": 4, |
| 50 | + "execution_count": null, |
49 | 51 | "id": "a89234b0-b0a0-46d3-8567-97465d69dff4",
|
50 | 52 | "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": [], |
63 | 54 | "source": [
|
64 | 55 | "widgets.__version__"
|
65 | 56 | ]
|
|
69 | 60 | "id": "a407df5a-d525-46f7-adf2-fac35c2b9d8a",
|
70 | 61 | "metadata": {},
|
71 | 62 | "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>" |
73 | 64 | ]
|
74 | 65 | },
|
75 | 66 | {
|
76 | 67 | "cell_type": "markdown",
|
77 | 68 | "id": "b35372a7-dc80-48f5-9c03-f7d59c52c59e",
|
78 |
| - "metadata": {}, |
| 69 | + "metadata": { |
| 70 | + "tags": [] |
| 71 | + }, |
79 | 72 | "source": [
|
80 | 73 | "#### New styling attributes support for core widgets:\n",
|
81 | 74 | "1. `font-family` \n",
|
|
88 | 81 | },
|
89 | 82 | {
|
90 | 83 | "cell_type": "code",
|
91 |
| - "execution_count": 53, |
| 84 | + "execution_count": null, |
92 | 85 | "id": "dbe91b98-bb7a-4292-8df0-efbc49fdfef0",
|
93 | 86 | "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": [], |
111 | 88 | "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", |
113 | 90 | "\n",
|
114 | 91 | "checkbox = Checkbox(description='Option A', style=dict(background='lightblue'))\n",
|
115 | 92 | "valid = Valid(value=False, style=dict(background='lightblue'))\n",
|
|
204 | 181 | },
|
205 | 182 | {
|
206 | 183 | "cell_type": "code",
|
207 |
| - "execution_count": 43, |
| 184 | + "execution_count": null, |
208 | 185 | "id": "22dd3054-3c92-4377-b708-542bd7f4db4e",
|
209 | 186 | "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": [], |
227 | 188 | "source": [
|
228 | 189 | "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", |
230 | 191 | "btn"
|
231 | 192 | ]
|
232 | 193 | },
|
|
238 | 199 | "#### New slider implementation based on `nouislider` with support for range dragging."
|
239 | 200 | ]
|
240 | 201 | },
|
| 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 | + }, |
241 | 214 | {
|
242 | 215 | "cell_type": "markdown",
|
243 | 216 | "id": "709e5005-1569-4232-a618-5bde081247db",
|
244 | 217 | "metadata": {},
|
245 | 218 | "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" |
247 | 233 | ]
|
248 | 234 | },
|
249 | 235 | {
|
|
254 | 240 | "#### ErrorWidget fallback when widget models or views fail."
|
255 | 241 | ]
|
256 | 242 | },
|
| 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 | + }, |
257 | 294 | {
|
258 | 295 | "cell_type": "code",
|
259 | 296 | "execution_count": null,
|
260 |
| - "id": "bec074df-80ab-4b9f-855e-e9bae4d8b1b5", |
| 297 | + "id": "2324621d-1d24-414d-b181-c2f8624e3821", |
261 | 298 | "metadata": {},
|
262 | 299 | "outputs": [],
|
263 |
| - "source": [] |
| 300 | + "source": [ |
| 301 | + "from ipywidgets import DatetimePicker\n", |
| 302 | + "import datetime\n", |
| 303 | + "dt = DatetimePicker()\n", |
| 304 | + "dt" |
| 305 | + ] |
264 | 306 | }
|
265 | 307 | ],
|
266 | 308 | "metadata": {
|
|
0 commit comments