Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
update notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpython committed Jan 14, 2020
1 parent 131c430 commit d9a8977
Show file tree
Hide file tree
Showing 18 changed files with 214 additions and 247 deletions.
162 changes: 58 additions & 104 deletions _doc/notebooks/custom_widget.ipynb
Expand Up @@ -25,6 +25,7 @@
" a += \" \";\n",
" return a;\n",
"}\n",
"// look up into all sections and builds an automated menu //\n",
"var update_menu_string = function(begin, lfirst, llast, sformat, send, keep_item, begin_format, end_format) {\n",
" var anchors = document.getElementsByClassName(\"section\");\n",
" if (anchors.length == 0) {\n",
Expand Down Expand Up @@ -178,27 +179,12 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "93249cecf20046ab9cadcddc134fe746",
"model_id": "7ead5f57e5114d78a70463666074ed05",
"version_major": 2,
"version_minor": 0
},
"text/html": [
"<p>Failed to display Jupyter Widget of type <code>DatePicker</code>.</p>\n",
"<p>\n",
" If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean\n",
" that the widgets JavaScript is still loading. If this message persists, it\n",
" likely means that the widgets JavaScript library is either not installed or\n",
" not enabled. See the <a href=\"https://ipywidgets.readthedocs.io/en/stable/user_install.html\">Jupyter\n",
" Widgets Documentation</a> for setup instructions.\n",
"</p>\n",
"<p>\n",
" If you're reading this message in another frontend (for example, a static\n",
" rendering on GitHub or <a href=\"https://nbviewer.jupyter.org/\">NBViewer</a>),\n",
" it may mean that your frontend doesn't currently support widgets.\n",
"</p>\n"
],
"text/plain": [
"DatePicker(value=datetime.datetime(2018, 3, 17, 15, 28, 49, 605121), description='Pick a Date')"
"DatePicker(value=datetime.datetime(2020, 1, 14, 14, 41, 54, 26999), description='Pick a Date')"
]
},
"metadata": {},
Expand All @@ -222,7 +208,7 @@
{
"data": {
"text/plain": [
"datetime.datetime(2018, 3, 17, 15, 28, 49, 605121)"
"datetime.datetime(2020, 1, 14, 14, 41, 54, 26999)"
]
},
"execution_count": 5,
Expand All @@ -249,25 +235,10 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "070b21dedc4d407dbc85264a60fbbc5b",
"model_id": "303dc1b8adbb44729b88c94fbf6220d3",
"version_major": 2,
"version_minor": 0
},
"text/html": [
"<p>Failed to display Jupyter Widget of type <code>Button</code>.</p>\n",
"<p>\n",
" If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean\n",
" that the widgets JavaScript is still loading. If this message persists, it\n",
" likely means that the widgets JavaScript library is either not installed or\n",
" not enabled. See the <a href=\"https://ipywidgets.readthedocs.io/en/stable/user_install.html\">Jupyter\n",
" Widgets Documentation</a> for setup instructions.\n",
"</p>\n",
"<p>\n",
" If you're reading this message in another frontend (for example, a static\n",
" rendering on GitHub or <a href=\"https://nbviewer.jupyter.org/\">NBViewer</a>),\n",
" it may mean that your frontend doesn't currently support widgets.\n",
"</p>\n"
],
"text/plain": [
"Button(description='Click Me!', style=ButtonStyle())"
]
Expand Down Expand Up @@ -295,31 +266,59 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "756d316f844f451891a19f5ef514e19c",
"model_id": "da412467a7534735a7e11873ff682a71",
"version_major": 2,
"version_minor": 0
},
"text/html": [
"<p>Failed to display Jupyter Widget of type <code>IntSlider</code>.</p>\n",
"<p>\n",
" If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean\n",
" that the widgets JavaScript is still loading. If this message persists, it\n",
" likely means that the widgets JavaScript library is either not installed or\n",
" not enabled. See the <a href=\"https://ipywidgets.readthedocs.io/en/stable/user_install.html\">Jupyter\n",
" Widgets Documentation</a> for setup instructions.\n",
"</p>\n",
"<p>\n",
" If you're reading this message in another frontend (for example, a static\n",
" rendering on GitHub or <a href=\"https://nbviewer.jupyter.org/\">NBViewer</a>),\n",
" it may mean that your frontend doesn't currently support widgets.\n",
"</p>\n"
],
"text/plain": [
"IntSlider(value=0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"14\n",
"18\n",
"22\n",
"23\n",
"25\n",
"26\n",
"27\n",
"28\n",
"27\n",
"24\n",
"22\n",
"19\n",
"17\n",
"16\n",
"15\n",
"14\n",
"12\n",
"11\n",
"10\n",
"9\n",
"8\n",
"7\n",
"6\n",
"5\n",
"4\n",
"3\n",
"2\n",
"1\n",
"2\n",
"5\n",
"6\n",
"8\n",
"10\n",
"11\n",
"12\n",
"13\n",
"14\n"
]
}
],
"source": [
Expand Down Expand Up @@ -383,27 +382,12 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "3926c76fc1fc447b8f648804654b6c9e",
"model_id": "7a0bf64696cb489ea27ecb88b0387a3e",
"version_major": 2,
"version_minor": 0
},
"text/html": [
"<p>Failed to display Jupyter Widget of type <code>interactive</code>.</p>\n",
"<p>\n",
" If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean\n",
" that the widgets JavaScript is still loading. If this message persists, it\n",
" likely means that the widgets JavaScript library is either not installed or\n",
" not enabled. See the <a href=\"https://ipywidgets.readthedocs.io/en/stable/user_install.html\">Jupyter\n",
" Widgets Documentation</a> for setup instructions.\n",
"</p>\n",
"<p>\n",
" If you're reading this message in another frontend (for example, a static\n",
" rendering on GitHub or <a href=\"https://nbviewer.jupyter.org/\">NBViewer</a>),\n",
" it may mean that your frontend doesn't currently support widgets.\n",
"</p>\n"
],
"text/plain": [
"interactive(children=(IntSlider(value=16, description='n', max=30, min=2), IntSlider(value=5, description='m', max=10, min=1), IntSlider(value=5, description='k', max=10, min=1), FloatSlider(value=0.5, description='p', max=1.0, step=0.001), Dropdown(description='generator', options={'lobster': <function random_lobster at 0x0000028E94E07C80>, 'power law': <function powerlaw_cluster at 0x0000028E93D14BF8>, 'Newman-Watts-Strogatz': <function newman_watts_strogatz at 0x0000028E95825730>, 'Erd\u0151s-R\u00e9nyi': <function erdos_renyi at 0x0000028E95803268>}, value=<function random_lobster at 0x0000028E94E07C80>), Output()), _dom_classes=('widget-interact',))"
"interactive(children=(IntSlider(value=16, description='n', max=30, min=2), IntSlider(value=5, description='m',\u2026"
]
},
"metadata": {},
Expand Down Expand Up @@ -472,7 +456,7 @@
" return {\n",
" HelloView : HelloView\n",
" };\n",
"});"
"});\n"
],
"text/plain": [
"<IPython.core.display.Javascript object>"
Expand Down Expand Up @@ -514,25 +498,10 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "f80611a9bba048cb9d970a60373c84dc",
"model_id": "eaaf30d3b18543f5aad64220ce0bcef2",
"version_major": 2,
"version_minor": 0
},
"text/html": [
"<p>Failed to display Jupyter Widget of type <code>HelloWidget</code>.</p>\n",
"<p>\n",
" If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean\n",
" that the widgets JavaScript is still loading. If this message persists, it\n",
" likely means that the widgets JavaScript library is either not installed or\n",
" not enabled. See the <a href=\"https://ipywidgets.readthedocs.io/en/stable/user_install.html\">Jupyter\n",
" Widgets Documentation</a> for setup instructions.\n",
"</p>\n",
"<p>\n",
" If you're reading this message in another frontend (for example, a static\n",
" rendering on GitHub or <a href=\"https://nbviewer.jupyter.org/\">NBViewer</a>),\n",
" it may mean that your frontend doesn't currently support widgets.\n",
"</p>\n"
],
"text/plain": [
"HelloWidget()"
]
Expand Down Expand Up @@ -576,7 +545,7 @@
" paths: {\n",
" d3: '//cdnjs.cloudflare.com/ajax/libs/d3/3.4.8/d3.min'\n",
" },\n",
"});"
"});\n"
],
"text/plain": [
"<IPython.core.display.Javascript object>"
Expand Down Expand Up @@ -719,7 +688,7 @@
" return {\n",
" CircleView : CircleView\n",
" };\n",
"});"
"});\n"
],
"text/plain": [
"<IPython.core.display.Javascript object>"
Expand Down Expand Up @@ -831,25 +800,10 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "a0aad3a6ee65473399045a47d11ed707",
"model_id": "cecc5402ef9c4967a9b571b5050a594a",
"version_major": 2,
"version_minor": 0
},
"text/html": [
"<p>Failed to display Jupyter Widget of type <code>VBox</code>.</p>\n",
"<p>\n",
" If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean\n",
" that the widgets JavaScript is still loading. If this message persists, it\n",
" likely means that the widgets JavaScript library is either not installed or\n",
" not enabled. See the <a href=\"https://ipywidgets.readthedocs.io/en/stable/user_install.html\">Jupyter\n",
" Widgets Documentation</a> for setup instructions.\n",
"</p>\n",
"<p>\n",
" If you're reading this message in another frontend (for example, a static\n",
" rendering on GitHub or <a href=\"https://nbviewer.jupyter.org/\">NBViewer</a>),\n",
" it may mean that your frontend doesn't currently support widgets.\n",
"</p>\n"
],
"text/plain": [
"VBox(children=(IntSlider(value=1, max=10), CircleWidget(height=100, radius=1, width=500)))"
]
Expand Down Expand Up @@ -917,9 +871,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.4"
"version": "3.7.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 1
}

0 comments on commit d9a8977

Please sign in to comment.