Skip to content

Commit b65a531

Browse files
authored
Added local serving notebook (#51)
1 parent 57e9032 commit b65a531

File tree

2 files changed

+163
-157
lines changed

2 files changed

+163
-157
lines changed

JupyterDash.ipynb

Lines changed: 28 additions & 157 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"import dash_html_components as html\n",
2121
"from dash.dependencies import Input, Output\n",
2222
"\n",
23-
"dd = JupyterDash('SomeID')\n",
23+
"dd = JupyterDash('SomeID', serve_locally=False)\n",
2424
"\n",
2525
"dd.layout = html.Div([dcc.RadioItems(id='item_list', \n",
2626
" options = [dict(label = k, value = k) for k in ['Hey', 'HiHi']]), \n",
@@ -46,12 +46,12 @@
4646
"data": {
4747
"text/html": [
4848
"<div>\n",
49-
" <iframe src=\"/app/endpoints/2f2216256833454083843ddf993755de/\" width=600 height=200 frameborder=\"0\"></iframe>\n",
50-
" <hr/><a href=\"/app/endpoints/2f2216256833454083843ddf993755de/\" target=\"_new\">Open in new window</a> for /app/endpoints/2f2216256833454083843ddf993755de/\n",
49+
" <iframe src=\"/app/endpoints/b721a9cd65a1465eb22b8dbc13875c4d/\" width=600 height=200 frameborder=\"0\"></iframe>\n",
50+
" <hr/><a href=\"/app/endpoints/b721a9cd65a1465eb22b8dbc13875c4d/\" target=\"_new\">Open in new window</a> for /app/endpoints/b721a9cd65a1465eb22b8dbc13875c4d/\n",
5151
"</div>"
5252
],
5353
"text/plain": [
54-
"<jupyter_plotly_dash.dash_wrapper.JupyterDash at 0x7f44e5bd7518>"
54+
"<jupyter_plotly_dash.dash_wrapper.JupyterDash at 0x7f9d9f80c1d0>"
5555
]
5656
},
5757
"execution_count": 3,
@@ -73,7 +73,7 @@
7373
{
7474
"data": {
7575
"text/plain": [
76-
"'/app/endpoints/2f2216256833454083843ddf993755de/'"
76+
"'/app/endpoints/b721a9cd65a1465eb22b8dbc13875c4d/'"
7777
]
7878
},
7979
"execution_count": 4,
@@ -104,33 +104,16 @@
104104
},
105105
{
106106
"cell_type": "code",
107-
"execution_count": 6,
107+
"execution_count": null,
108108
"metadata": {},
109-
"outputs": [
110-
{
111-
"data": {
112-
"text/html": [
113-
"<div>\n",
114-
" <iframe src=\"/proxy/8055/SomeID/\" width=600 height=200 frameborder=\"0\"></iframe>\n",
115-
" <hr/><a href=\"/proxy/8055/SomeID/\" target=\"_new\">Open in new window</a> for /proxy/8055/SomeID/\n",
116-
"</div>"
117-
],
118-
"text/plain": [
119-
"<jupyter_plotly_dash.dash_wrapper.JupyterDash at 0x7f44e5bd7518>"
120-
]
121-
},
122-
"execution_count": 6,
123-
"metadata": {},
124-
"output_type": "execute_result"
125-
}
126-
],
109+
"outputs": [],
127110
"source": [
128111
"dd"
129112
]
130113
},
131114
{
132115
"cell_type": "code",
133-
"execution_count": 7,
116+
"execution_count": null,
134117
"metadata": {},
135118
"outputs": [],
136119
"source": [
@@ -195,61 +178,27 @@
195178
},
196179
{
197180
"cell_type": "code",
198-
"execution_count": 8,
181+
"execution_count": null,
199182
"metadata": {},
200-
"outputs": [
201-
{
202-
"data": {
203-
"text/html": [
204-
"<div>\n",
205-
" <iframe src=\"/app/endpoints/58cceed54a4c4c28988d2d255833b001/\" width=800 height=100 frameborder=\"0\"></iframe>\n",
206-
" <hr/><a href=\"/app/endpoints/58cceed54a4c4c28988d2d255833b001/\" target=\"_new\">Open in new window</a> for /app/endpoints/58cceed54a4c4c28988d2d255833b001/\n",
207-
"</div>"
208-
],
209-
"text/plain": [
210-
"<jupyter_plotly_dash.dash_wrapper.JupyterDash at 0x7f44c219a160>"
211-
]
212-
},
213-
"execution_count": 8,
214-
"metadata": {},
215-
"output_type": "execute_result"
216-
}
217-
],
183+
"outputs": [],
218184
"source": [
219185
"app.height=100\n",
220186
"app"
221187
]
222188
},
223189
{
224190
"cell_type": "code",
225-
"execution_count": 9,
191+
"execution_count": null,
226192
"metadata": {},
227-
"outputs": [
228-
{
229-
"data": {
230-
"text/html": [
231-
"<div>\n",
232-
" <iframe src=\"/app/endpoints/ff6cf46043a848b696a66ffeedcee85b/\" width=800 height=100 frameborder=\"0\"></iframe>\n",
233-
" <hr/><a href=\"/app/endpoints/ff6cf46043a848b696a66ffeedcee85b/\" target=\"_new\">Open in new window</a> for /app/endpoints/ff6cf46043a848b696a66ffeedcee85b/\n",
234-
"</div>"
235-
],
236-
"text/plain": [
237-
"<jupyter_plotly_dash.dash_wrapper.JupyterDash at 0x7f44c219a3c8>"
238-
]
239-
},
240-
"execution_count": 9,
241-
"metadata": {},
242-
"output_type": "execute_result"
243-
}
244-
],
193+
"outputs": [],
245194
"source": [
246195
"a2.height = 100\n",
247196
"a2"
248197
]
249198
},
250199
{
251200
"cell_type": "code",
252-
"execution_count": 10,
201+
"execution_count": null,
253202
"metadata": {},
254203
"outputs": [],
255204
"source": [
@@ -261,33 +210,16 @@
261210
},
262211
{
263212
"cell_type": "code",
264-
"execution_count": 11,
213+
"execution_count": null,
265214
"metadata": {},
266-
"outputs": [
267-
{
268-
"data": {
269-
"text/html": [
270-
"<div>\n",
271-
" <iframe src=\"/app/endpoints/ff6cf46043a848b696a66ffeedcee85b/\" width=800 height=100 frameborder=\"0\"></iframe>\n",
272-
" <hr/><a href=\"/app/endpoints/ff6cf46043a848b696a66ffeedcee85b/\" target=\"_new\">Open in new window</a> for /app/endpoints/ff6cf46043a848b696a66ffeedcee85b/\n",
273-
"</div>"
274-
],
275-
"text/plain": [
276-
"<jupyter_plotly_dash.dash_wrapper.JupyterDash at 0x7f44c219a3c8>"
277-
]
278-
},
279-
"execution_count": 11,
280-
"metadata": {},
281-
"output_type": "execute_result"
282-
}
283-
],
215+
"outputs": [],
284216
"source": [
285217
"a2"
286218
]
287219
},
288220
{
289221
"cell_type": "code",
290-
"execution_count": 12,
222+
"execution_count": null,
291223
"metadata": {},
292224
"outputs": [],
293225
"source": [
@@ -296,26 +228,16 @@
296228
},
297229
{
298230
"cell_type": "code",
299-
"execution_count": 13,
231+
"execution_count": null,
300232
"metadata": {},
301-
"outputs": [
302-
{
303-
"name": "stdout",
304-
"output_type": "stream",
305-
"text": [
306-
"dash_app magic\n",
307-
"feed\n",
308-
"None\n"
309-
]
310-
}
311-
],
233+
"outputs": [],
312234
"source": [
313235
"%dash_app feed"
314236
]
315237
},
316238
{
317239
"cell_type": "code",
318-
"execution_count": 14,
240+
"execution_count": null,
319241
"metadata": {},
320242
"outputs": [],
321243
"source": [
@@ -324,44 +246,18 @@
324246
},
325247
{
326248
"cell_type": "code",
327-
"execution_count": 15,
249+
"execution_count": null,
328250
"metadata": {},
329-
"outputs": [
330-
{
331-
"data": {
332-
"text/plain": [
333-
"{}"
334-
]
335-
},
336-
"execution_count": 15,
337-
"metadata": {},
338-
"output_type": "execute_result"
339-
}
340-
],
251+
"outputs": [],
341252
"source": [
342253
"app.app_state"
343254
]
344255
},
345256
{
346257
"cell_type": "code",
347-
"execution_count": 16,
258+
"execution_count": null,
348259
"metadata": {},
349-
"outputs": [
350-
{
351-
"data": {
352-
"application/vnd.jupyter.widget-view+json": {
353-
"model_id": "e14393b0cbf4489ca495d227ab79f8ee",
354-
"version_major": 2,
355-
"version_minor": 0
356-
},
357-
"text/plain": [
358-
"Button(description='Click Me!', style=ButtonStyle())"
359-
]
360-
},
361-
"metadata": {},
362-
"output_type": "display_data"
363-
}
364-
],
260+
"outputs": [],
365261
"source": [
366262
"import ipywidgets as widgets\n",
367263
"from IPython.display import display\n",
@@ -377,43 +273,18 @@
377273
},
378274
{
379275
"cell_type": "code",
380-
"execution_count": 17,
276+
"execution_count": null,
381277
"metadata": {},
382-
"outputs": [
383-
{
384-
"data": {
385-
"text/plain": [
386-
"{}"
387-
]
388-
},
389-
"execution_count": 17,
390-
"metadata": {},
391-
"output_type": "execute_result"
392-
}
393-
],
278+
"outputs": [],
394279
"source": [
395280
"dd.app_state"
396281
]
397282
},
398283
{
399284
"cell_type": "code",
400-
"execution_count": 18,
285+
"execution_count": null,
401286
"metadata": {},
402-
"outputs": [
403-
{
404-
"name": "stdout",
405-
"output_type": "stream",
406-
"text": [
407-
"config dir: /home/mark/local/jpd/env/etc/jupyter\n",
408-
" jupyter_plotly_dash.serverext \u001b[32m enabled \u001b[0m\n",
409-
" - Validating...\n",
410-
" jupyter_plotly_dash.serverext \u001b[32mOK\u001b[0m\n",
411-
" nbserverproxy \u001b[32m enabled \u001b[0m\n",
412-
" - Validating...\n",
413-
" nbserverproxy \u001b[32mOK\u001b[0m\n"
414-
]
415-
}
416-
],
287+
"outputs": [],
417288
"source": [
418289
"!jupyter serverextension list"
419290
]
@@ -442,7 +313,7 @@
442313
"name": "python",
443314
"nbconvert_exporter": "python",
444315
"pygments_lexer": "ipython3",
445-
"version": "3.6.8"
316+
"version": "3.7.6"
446317
}
447318
},
448319
"nbformat": 4,

0 commit comments

Comments
 (0)