Skip to content

Commit

Permalink
Added local serving notebook (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
delsim committed Feb 3, 2020
1 parent 57e9032 commit b65a531
Show file tree
Hide file tree
Showing 2 changed files with 163 additions and 157 deletions.
185 changes: 28 additions & 157 deletions JupyterDash.ipynb
Expand Up @@ -20,7 +20,7 @@
"import dash_html_components as html\n",
"from dash.dependencies import Input, Output\n",
"\n",
"dd = JupyterDash('SomeID')\n",
"dd = JupyterDash('SomeID', serve_locally=False)\n",
"\n",
"dd.layout = html.Div([dcc.RadioItems(id='item_list', \n",
" options = [dict(label = k, value = k) for k in ['Hey', 'HiHi']]), \n",
Expand All @@ -46,12 +46,12 @@
"data": {
"text/html": [
"<div>\n",
" <iframe src=\"/app/endpoints/2f2216256833454083843ddf993755de/\" width=600 height=200 frameborder=\"0\"></iframe>\n",
" <hr/><a href=\"/app/endpoints/2f2216256833454083843ddf993755de/\" target=\"_new\">Open in new window</a> for /app/endpoints/2f2216256833454083843ddf993755de/\n",
" <iframe src=\"/app/endpoints/b721a9cd65a1465eb22b8dbc13875c4d/\" width=600 height=200 frameborder=\"0\"></iframe>\n",
" <hr/><a href=\"/app/endpoints/b721a9cd65a1465eb22b8dbc13875c4d/\" target=\"_new\">Open in new window</a> for /app/endpoints/b721a9cd65a1465eb22b8dbc13875c4d/\n",
"</div>"
],
"text/plain": [
"<jupyter_plotly_dash.dash_wrapper.JupyterDash at 0x7f44e5bd7518>"
"<jupyter_plotly_dash.dash_wrapper.JupyterDash at 0x7f9d9f80c1d0>"
]
},
"execution_count": 3,
Expand All @@ -73,7 +73,7 @@
{
"data": {
"text/plain": [
"'/app/endpoints/2f2216256833454083843ddf993755de/'"
"'/app/endpoints/b721a9cd65a1465eb22b8dbc13875c4d/'"
]
},
"execution_count": 4,
Expand Down Expand Up @@ -104,33 +104,16 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
" <iframe src=\"/proxy/8055/SomeID/\" width=600 height=200 frameborder=\"0\"></iframe>\n",
" <hr/><a href=\"/proxy/8055/SomeID/\" target=\"_new\">Open in new window</a> for /proxy/8055/SomeID/\n",
"</div>"
],
"text/plain": [
"<jupyter_plotly_dash.dash_wrapper.JupyterDash at 0x7f44e5bd7518>"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"dd"
]
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -195,61 +178,27 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
" <iframe src=\"/app/endpoints/58cceed54a4c4c28988d2d255833b001/\" width=800 height=100 frameborder=\"0\"></iframe>\n",
" <hr/><a href=\"/app/endpoints/58cceed54a4c4c28988d2d255833b001/\" target=\"_new\">Open in new window</a> for /app/endpoints/58cceed54a4c4c28988d2d255833b001/\n",
"</div>"
],
"text/plain": [
"<jupyter_plotly_dash.dash_wrapper.JupyterDash at 0x7f44c219a160>"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"app.height=100\n",
"app"
]
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
" <iframe src=\"/app/endpoints/ff6cf46043a848b696a66ffeedcee85b/\" width=800 height=100 frameborder=\"0\"></iframe>\n",
" <hr/><a href=\"/app/endpoints/ff6cf46043a848b696a66ffeedcee85b/\" target=\"_new\">Open in new window</a> for /app/endpoints/ff6cf46043a848b696a66ffeedcee85b/\n",
"</div>"
],
"text/plain": [
"<jupyter_plotly_dash.dash_wrapper.JupyterDash at 0x7f44c219a3c8>"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"a2.height = 100\n",
"a2"
]
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -261,33 +210,16 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
" <iframe src=\"/app/endpoints/ff6cf46043a848b696a66ffeedcee85b/\" width=800 height=100 frameborder=\"0\"></iframe>\n",
" <hr/><a href=\"/app/endpoints/ff6cf46043a848b696a66ffeedcee85b/\" target=\"_new\">Open in new window</a> for /app/endpoints/ff6cf46043a848b696a66ffeedcee85b/\n",
"</div>"
],
"text/plain": [
"<jupyter_plotly_dash.dash_wrapper.JupyterDash at 0x7f44c219a3c8>"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"a2"
]
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -296,26 +228,16 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"dash_app magic\n",
"feed\n",
"None\n"
]
}
],
"outputs": [],
"source": [
"%dash_app feed"
]
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -324,44 +246,18 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{}"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"app.app_state"
]
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "e14393b0cbf4489ca495d227ab79f8ee",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Button(description='Click Me!', style=ButtonStyle())"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"import ipywidgets as widgets\n",
"from IPython.display import display\n",
Expand All @@ -377,43 +273,18 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{}"
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"dd.app_state"
]
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"config dir: /home/mark/local/jpd/env/etc/jupyter\n",
" jupyter_plotly_dash.serverext \u001b[32m enabled \u001b[0m\n",
" - Validating...\n",
" jupyter_plotly_dash.serverext \u001b[32mOK\u001b[0m\n",
" nbserverproxy \u001b[32m enabled \u001b[0m\n",
" - Validating...\n",
" nbserverproxy \u001b[32mOK\u001b[0m\n"
]
}
],
"outputs": [],
"source": [
"!jupyter serverextension list"
]
Expand Down Expand Up @@ -442,7 +313,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"version": "3.7.6"
}
},
"nbformat": 4,
Expand Down

0 comments on commit b65a531

Please sign in to comment.