Skip to content

Instantly share code, notes, and snippets.

@demotu
Last active July 12, 2019 17:40
Show Gist options
  • Save demotu/6264b663a9c7432e5639c82a82c0ce95 to your computer and use it in GitHub Desktop.
Save demotu/6264b663a9c7432e5639c82a82c0ce95 to your computer and use it in GitHub Desktop.
A Bokeh interactive plot as standalone HTML
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# A Bokeh interactive plot as standalone HTML\n",
"\n",
"In response to http://stackoverflow.com/questions/43793578/using-bokeh-jupyter-notebook-and-pelican-for-interactive-plots"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"First, generate the standard Bokeh plot:"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Bokeh version: 0.12.5\n"
]
},
{
"data": {
"text/html": [
"\n",
" <div class=\"bk-root\">\n",
" <a href=\"http://bokeh.pydata.org\" target=\"_blank\" class=\"bk-logo bk-logo-small bk-logo-notebook\"></a>\n",
" <span id=\"2b2d48bb-1b65-44f6-950d-ebd9e116d380\">Loading BokehJS ...</span>\n",
" </div>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
"(function(global) {\n",
" function now() {\n",
" return new Date();\n",
" }\n",
"\n",
" var force = true;\n",
"\n",
" if (typeof (window._bokeh_onload_callbacks) === \"undefined\" || force === true) {\n",
" window._bokeh_onload_callbacks = [];\n",
" window._bokeh_is_loading = undefined;\n",
" }\n",
"\n",
"\n",
" \n",
" if (typeof (window._bokeh_timeout) === \"undefined\" || force === true) {\n",
" window._bokeh_timeout = Date.now() + 5000;\n",
" window._bokeh_failed_load = false;\n",
" }\n",
"\n",
" var NB_LOAD_WARNING = {'data': {'text/html':\n",
" \"<div style='background-color: #fdd'>\\n\"+\n",
" \"<p>\\n\"+\n",
" \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n",
" \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n",
" \"</p>\\n\"+\n",
" \"<ul>\\n\"+\n",
" \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n",
" \"<li>use INLINE resources instead, as so:</li>\\n\"+\n",
" \"</ul>\\n\"+\n",
" \"<code>\\n\"+\n",
" \"from bokeh.resources import INLINE\\n\"+\n",
" \"output_notebook(resources=INLINE)\\n\"+\n",
" \"</code>\\n\"+\n",
" \"</div>\"}};\n",
"\n",
" function display_loaded() {\n",
" if (window.Bokeh !== undefined) {\n",
" var el = document.getElementById(\"2b2d48bb-1b65-44f6-950d-ebd9e116d380\");\n",
" el.textContent = \"BokehJS \" + Bokeh.version + \" successfully loaded.\";\n",
" } else if (Date.now() < window._bokeh_timeout) {\n",
" setTimeout(display_loaded, 100)\n",
" }\n",
" }\n",
"\n",
" function run_callbacks() {\n",
" window._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n",
" delete window._bokeh_onload_callbacks\n",
" console.info(\"Bokeh: all callbacks have finished\");\n",
" }\n",
"\n",
" function load_libs(js_urls, callback) {\n",
" window._bokeh_onload_callbacks.push(callback);\n",
" if (window._bokeh_is_loading > 0) {\n",
" console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
" return null;\n",
" }\n",
" if (js_urls == null || js_urls.length === 0) {\n",
" run_callbacks();\n",
" return null;\n",
" }\n",
" console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
" window._bokeh_is_loading = js_urls.length;\n",
" for (var i = 0; i < js_urls.length; i++) {\n",
" var url = js_urls[i];\n",
" var s = document.createElement('script');\n",
" s.src = url;\n",
" s.async = false;\n",
" s.onreadystatechange = s.onload = function() {\n",
" window._bokeh_is_loading--;\n",
" if (window._bokeh_is_loading === 0) {\n",
" console.log(\"Bokeh: all BokehJS libraries loaded\");\n",
" run_callbacks()\n",
" }\n",
" };\n",
" s.onerror = function() {\n",
" console.warn(\"failed to load library \" + url);\n",
" };\n",
" console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
" document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
" }\n",
" };var element = document.getElementById(\"2b2d48bb-1b65-44f6-950d-ebd9e116d380\");\n",
" if (element == null) {\n",
" console.log(\"Bokeh: ERROR: autoload.js configured with elementid '2b2d48bb-1b65-44f6-950d-ebd9e116d380' but no matching script tag was found. \")\n",
" return false;\n",
" }\n",
"\n",
" var js_urls = [\"https://cdn.pydata.org/bokeh/release/bokeh-0.12.5.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.5.min.js\"];\n",
"\n",
" var inline_js = [\n",
" function(Bokeh) {\n",
" Bokeh.set_log_level(\"info\");\n",
" },\n",
" \n",
" function(Bokeh) {\n",
" \n",
" },\n",
" \n",
" function(Bokeh) {\n",
" \n",
" document.getElementById(\"2b2d48bb-1b65-44f6-950d-ebd9e116d380\").textContent = \"BokehJS is loading...\";\n",
" },\n",
" function(Bokeh) {\n",
" console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-0.12.5.min.css\");\n",
" Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-0.12.5.min.css\");\n",
" console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.5.min.css\");\n",
" Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.5.min.css\");\n",
" }\n",
" ];\n",
"\n",
" function run_inline_js() {\n",
" \n",
" if ((window.Bokeh !== undefined) || (force === true)) {\n",
" for (var i = 0; i < inline_js.length; i++) {\n",
" inline_js[i](window.Bokeh);\n",
" }if (force === true) {\n",
" display_loaded();\n",
" }} else if (Date.now() < window._bokeh_timeout) {\n",
" setTimeout(run_inline_js, 100);\n",
" } else if (!window._bokeh_failed_load) {\n",
" console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n",
" window._bokeh_failed_load = true;\n",
" } else if (force !== true) {\n",
" var cell = $(document.getElementById(\"2b2d48bb-1b65-44f6-950d-ebd9e116d380\")).parents('.cell').data().cell;\n",
" cell.output_area.append_execute_result(NB_LOAD_WARNING)\n",
" }\n",
"\n",
" }\n",
"\n",
" if (window._bokeh_is_loading === 0) {\n",
" console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n",
" run_inline_js();\n",
" } else {\n",
" load_libs(js_urls, function() {\n",
" console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n",
" run_inline_js();\n",
" });\n",
" }\n",
"}(this));"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
"\n",
" <div class=\"bk-root\">\n",
" <div class=\"bk-plotdiv\" id=\"bba33e35-b624-4478-84fb-f7e810a71a09\"></div>\n",
" </div>\n",
"<script type=\"text/javascript\">\n",
" \n",
" (function(global) {\n",
" function now() {\n",
" return new Date();\n",
" }\n",
" \n",
" var force = false;\n",
" \n",
" if (typeof (window._bokeh_onload_callbacks) === \"undefined\" || force === true) {\n",
" window._bokeh_onload_callbacks = [];\n",
" window._bokeh_is_loading = undefined;\n",
" }\n",
" \n",
" \n",
" \n",
" if (typeof (window._bokeh_timeout) === \"undefined\" || force === true) {\n",
" window._bokeh_timeout = Date.now() + 0;\n",
" window._bokeh_failed_load = false;\n",
" }\n",
" \n",
" var NB_LOAD_WARNING = {'data': {'text/html':\n",
" \"<div style='background-color: #fdd'>\\n\"+\n",
" \"<p>\\n\"+\n",
" \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n",
" \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n",
" \"</p>\\n\"+\n",
" \"<ul>\\n\"+\n",
" \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n",
" \"<li>use INLINE resources instead, as so:</li>\\n\"+\n",
" \"</ul>\\n\"+\n",
" \"<code>\\n\"+\n",
" \"from bokeh.resources import INLINE\\n\"+\n",
" \"output_notebook(resources=INLINE)\\n\"+\n",
" \"</code>\\n\"+\n",
" \"</div>\"}};\n",
" \n",
" function display_loaded() {\n",
" if (window.Bokeh !== undefined) {\n",
" var el = document.getElementById(\"bba33e35-b624-4478-84fb-f7e810a71a09\");\n",
" el.textContent = \"BokehJS \" + Bokeh.version + \" successfully loaded.\";\n",
" } else if (Date.now() < window._bokeh_timeout) {\n",
" setTimeout(display_loaded, 100)\n",
" }\n",
" }if ((window.Jupyter !== undefined) && Jupyter.notebook.kernel) {\n",
" comm_manager = Jupyter.notebook.kernel.comm_manager\n",
" comm_manager.register_target(\"757971fd-e8ff-45f2-9236-3ac14f84c351\", function () {});\n",
" }\n",
" \n",
" function run_callbacks() {\n",
" window._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n",
" delete window._bokeh_onload_callbacks\n",
" console.info(\"Bokeh: all callbacks have finished\");\n",
" }\n",
" \n",
" function load_libs(js_urls, callback) {\n",
" window._bokeh_onload_callbacks.push(callback);\n",
" if (window._bokeh_is_loading > 0) {\n",
" console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
" return null;\n",
" }\n",
" if (js_urls == null || js_urls.length === 0) {\n",
" run_callbacks();\n",
" return null;\n",
" }\n",
" console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
" window._bokeh_is_loading = js_urls.length;\n",
" for (var i = 0; i < js_urls.length; i++) {\n",
" var url = js_urls[i];\n",
" var s = document.createElement('script');\n",
" s.src = url;\n",
" s.async = false;\n",
" s.onreadystatechange = s.onload = function() {\n",
" window._bokeh_is_loading--;\n",
" if (window._bokeh_is_loading === 0) {\n",
" console.log(\"Bokeh: all BokehJS libraries loaded\");\n",
" run_callbacks()\n",
" }\n",
" };\n",
" s.onerror = function() {\n",
" console.warn(\"failed to load library \" + url);\n",
" };\n",
" console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
" document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
" }\n",
" };var element = document.getElementById(\"bba33e35-b624-4478-84fb-f7e810a71a09\");\n",
" if (element == null) {\n",
" console.log(\"Bokeh: ERROR: autoload.js configured with elementid 'bba33e35-b624-4478-84fb-f7e810a71a09' but no matching script tag was found. \")\n",
" return false;\n",
" }\n",
" \n",
" var js_urls = [];\n",
" \n",
" var inline_js = [\n",
" function(Bokeh) {\n",
" (function() {\n",
" var fn = function() {\n",
" var docs_json = {\"a3d1e7df-5c9e-4cf3-a28f-7dbfc557dbc6\":{\"roots\":{\"references\":[{\"attributes\":{\"plot\":{\"id\":\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"a136a255-67af-488c-b1d1-cc3adc7ca73a\",\"type\":\"BasicTicker\"}},\"id\":\"bd798fba-2aaa-4b56-8b3d-8ddb97627342\",\"type\":\"Grid\"},{\"attributes\":{\"formatter\":{\"id\":\"61d87393-cf00-4499-82b4-261e61dfaf91\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"3afc6846-986b-40a7-a37d-c7d2796a4c4f\",\"type\":\"BasicTicker\"}},\"id\":\"d550d6c5-3667-4c36-a9a2-10fad47f4852\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"3afc6846-986b-40a7-a37d-c7d2796a4c4f\",\"type\":\"BasicTicker\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"3afc6846-986b-40a7-a37d-c7d2796a4c4f\",\"type\":\"BasicTicker\"}},\"id\":\"436bdf09-504e-4201-91e6-c0a4c73cd6d7\",\"type\":\"Grid\"},{\"attributes\":{\"data_source\":{\"id\":\"89929e99-904f-4740-b94d-40434d54bb92\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1016319b-24e6-4eff-94db-78868e227a9c\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"45d8c71e-14c5-435f-bb11-8c0e732da5e3\",\"type\":\"Circle\"},\"selection_glyph\":null},\"id\":\"75d5ddb3-8f82-416e-bd9e-d8bd94b6da7c\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":7},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1016319b-24e6-4eff-94db-78868e227a9c\",\"type\":\"Circle\"},{\"attributes\":{\"callback\":null,\"plot\":{\"id\":\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"fc7a1324-58f5-4ebe-8333-9ca25c63ac4c\",\"type\":\"HoverTool\"},{\"attributes\":{\"below\":[{\"id\":\"72f241d5-e7b9-4d7c-a0db-b847d91982a9\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"d550d6c5-3667-4c36-a9a2-10fad47f4852\",\"type\":\"LinearAxis\"}],\"plot_height\":400,\"renderers\":[{\"id\":\"72f241d5-e7b9-4d7c-a0db-b847d91982a9\",\"type\":\"LinearAxis\"},{\"id\":\"bd798fba-2aaa-4b56-8b3d-8ddb97627342\",\"type\":\"Grid\"},{\"id\":\"d550d6c5-3667-4c36-a9a2-10fad47f4852\",\"type\":\"LinearAxis\"},{\"id\":\"436bdf09-504e-4201-91e6-c0a4c73cd6d7\",\"type\":\"Grid\"},{\"id\":\"e0b77d7c-1411-4875-a8d4-8c5bf16b8b22\",\"type\":\"BoxAnnotation\"},{\"id\":\"ec7ec3a6-2b24-441e-be55-f4309b6491f0\",\"type\":\"BoxAnnotation\"},{\"id\":\"75d5ddb3-8f82-416e-bd9e-d8bd94b6da7c\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"7835772a-d000-456d-b61e-b8ec099673a8\",\"type\":\"Title\"},\"tool_events\":{\"id\":\"65501ef1-5699-4613-aa04-3832a3895c52\",\"type\":\"ToolEvents\"},\"toolbar\":{\"id\":\"f0b57205-5dde-4329-921c-020f0c4856b5\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"9e263aef-dca3-4046-88d8-33340e00ceb1\",\"type\":\"DataRange1d\"},\"y_range\":{\"id\":\"0998ddb9-81a6-4c89-adf4-3b7352b26284\",\"type\":\"DataRange1d\"}},\"id\":\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"ec7ec3a6-2b24-441e-be55-f4309b6491f0\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"fc7a1324-58f5-4ebe-8333-9ca25c63ac4c\",\"type\":\"HoverTool\"},{\"id\":\"00a4a34a-bd64-42c7-8426-ea4b6505d218\",\"type\":\"BoxZoomTool\"},{\"id\":\"ad7d5fa3-62a1-42da-b319-a238c748dd9e\",\"type\":\"BoxSelectTool\"},{\"id\":\"3ba6e3aa-4e4b-465f-954b-fe08a2fdc0ea\",\"type\":\"CrosshairTool\"},{\"id\":\"fdd02ec3-1a86-4ea2-9db4-9bb27216de73\",\"type\":\"ResizeTool\"},{\"id\":\"3cd4e1ed-08be-4ce6-9a45-06699edb16bf\",\"type\":\"ResetTool\"}]},\"id\":\"f0b57205-5dde-4329-921c-020f0c4856b5\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"61d87393-cf00-4499-82b4-261e61dfaf91\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"callback\":null,\"overlay\":{\"id\":\"ec7ec3a6-2b24-441e-be55-f4309b6491f0\",\"type\":\"BoxAnnotation\"},\"plot\":{\"id\":\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"renderers\":[{\"id\":\"75d5ddb3-8f82-416e-bd9e-d8bd94b6da7c\",\"type\":\"GlyphRenderer\"}]},\"id\":\"ad7d5fa3-62a1-42da-b319-a238c748dd9e\",\"type\":\"BoxSelectTool\"},{\"attributes\":{\"plot\":{\"id\":\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"3ba6e3aa-4e4b-465f-954b-fe08a2fdc0ea\",\"type\":\"CrosshairTool\"},{\"attributes\":{\"plot\":{\"id\":\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"fdd02ec3-1a86-4ea2-9db4-9bb27216de73\",\"type\":\"ResizeTool\"},{\"attributes\":{\"plot\":{\"id\":\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"3cd4e1ed-08be-4ce6-9a45-06699edb16bf\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"65501ef1-5699-4613-aa04-3832a3895c52\",\"type\":\"ToolEvents\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":7},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"45d8c71e-14c5-435f-bb11-8c0e732da5e3\",\"type\":\"Circle\"},{\"attributes\":{\"overlay\":{\"id\":\"e0b77d7c-1411-4875-a8d4-8c5bf16b8b22\",\"type\":\"BoxAnnotation\"},\"plot\":{\"id\":\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"00a4a34a-bd64-42c7-8426-ea4b6505d218\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"plot\":null,\"text\":\"\"},\"id\":\"7835772a-d000-456d-b61e-b8ec099673a8\",\"type\":\"Title\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\",\"index\"],\"data\":{\"index\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99],\"x\":{\"__ndarray__\":\"QtDvFw7EFUC6dPuBf9YVQELWbHUV8Q1AonSoYSYaEEBlB7YBLMQQwBpqtyFo9f0/6WiZWZRF979FLujzaZAPwLugH4jBCB5A0BMnwH8CJMA6yNdFVvMBwGdF8XGQ+OI/XKri1IKlDkA51Bc5CrIHQJLw+KYXEfG/FBvHiTxDAECnR/AnwxDrP+BiztkpDBhA0HnNIkYvE0CvvKhqgs0SQGDx6CCTHiBAcahLKv+EEcBBrBvcaikBQBT3/KnsPiDA4CEKg1IxAUD+kZRP++AZwMLle2l65RVAhOwxkJDv9D/WiFXE3LQbQIuAJBCzuBPA681yDXbO879jNUI2I8oBwJBTo9dxVQNA+av5vH2BHEABe+rdw2jvP4Zb4M5x9vc/gRCZlSEYD8Bq62qezg0JwOaMtahRDilAHiWfovdwIECx7CP0DD0YQL2rP67s6hFAkIMPhI3h6T8uJCgPHY7Wv0RtL2oNjADA1fq/Qr98D0BQSeJ0pjAbwJ0k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P6yCp6j+YRlAFjmmYzffF8Aexxh6sO8iQL0gVijSShdAcDLnOUx78z8mfVcKfD0RQPJvoaxw7f+/8j7f3GMEJsArSbqtyAQBQHRC/ClLcQdAyClc1bTXBUDdgRs5obMJwLCQkL84cB9ABJbv/ny5FEC17G/MYYD2PwbIYCR94wtAI1rc8lOAE8CwQZ0fje0kwG3bY4CItQhA9qiMX2rTD0BIjehyCgYjQCART/dXwRDA6pZItUokFcB4xGZGdMsQwFMf3btW+RzAIbvzMGDrIMBSULR7Adn7v9wty3XcOuO/LRuLaNvg8L+ssL9wRpIDQBdQtqiCbvE/8OXvip6EBkBJCwpaep7bv7aWmpleX9Y/FVT5SiYaFkCMyv5n804RQJYZdwVOtQvAiJGr/6DDFsCVtXGeGJEpQHr2Uz0/zBHAKI3QvdyaIcBIQnRXVarZP4jvefzgiBPAshnEP5w7GEA+EZ1k4iggwHiA4jOb/xZAzt4eovawEkDmikQjnOQTQAihGq0/tRpAT8LdSFx7DkDOhl/J46P+P9qbGcnBlAJA/4kEbmCEH0CIztrIQVEUwEXTp4P6OxzAbc5a5k6EEsA=\",\"dtype\":\"float64\",\"shape\":[100]}}},\"id\":\"89929e99-904f-4740-b94d-40434d54bb92\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"91ae7643-0c5e-41a6-8ef3-c467ef1ffb1f\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"callback\":null},\"id\":\"9e263aef-dca3-4046-88d8-33340e00ceb1\",\"type\":\"DataRange1d\"},{\"attributes\":{\"callback\":null},\"id\":\"0998ddb9-81a6-4c89-adf4-3b7352b26284\",\"type\":\"DataRange1d\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"e0b77d7c-1411-4875-a8d4-8c5bf16b8b22\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"formatter\":{\"id\":\"91ae7643-0c5e-41a6-8ef3-c467ef1ffb1f\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"a136a255-67af-488c-b1d1-cc3adc7ca73a\",\"type\":\"BasicTicker\"}},\"id\":\"72f241d5-e7b9-4d7c-a0db-b847d91982a9\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"a136a255-67af-488c-b1d1-cc3adc7ca73a\",\"type\":\"BasicTicker\"}],\"root_ids\":[\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.5\"}};\n",
" var render_items = [{\"docid\":\"a3d1e7df-5c9e-4cf3-a28f-7dbfc557dbc6\",\"elementid\":\"bba33e35-b624-4478-84fb-f7e810a71a09\",\"modelid\":\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\",\"notebook_comms_target\":\"757971fd-e8ff-45f2-9236-3ac14f84c351\"}];\n",
" \n",
" Bokeh.embed.embed_items(docs_json, render_items);\n",
" };\n",
" if (document.readyState != \"loading\") fn();\n",
" else document.addEventListener(\"DOMContentLoaded\", fn);\n",
" })();\n",
" },\n",
" function(Bokeh) {\n",
" }\n",
" ];\n",
" \n",
" function run_inline_js() {\n",
" \n",
" if ((window.Bokeh !== undefined) || (force === true)) {\n",
" for (var i = 0; i < inline_js.length; i++) {\n",
" inline_js[i](window.Bokeh);\n",
" }if (force === true) {\n",
" display_loaded();\n",
" }} else if (Date.now() < window._bokeh_timeout) {\n",
" setTimeout(run_inline_js, 100);\n",
" } else if (!window._bokeh_failed_load) {\n",
" console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n",
" window._bokeh_failed_load = true;\n",
" } else if (force !== true) {\n",
" var cell = $(document.getElementById(\"bba33e35-b624-4478-84fb-f7e810a71a09\")).parents('.cell').data().cell;\n",
" cell.output_area.append_execute_result(NB_LOAD_WARNING)\n",
" }\n",
" \n",
" }\n",
" \n",
" if (window._bokeh_is_loading === 0) {\n",
" console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n",
" run_inline_js();\n",
" } else {\n",
" load_libs(js_urls, function() {\n",
" console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n",
" run_inline_js();\n",
" });\n",
" }\n",
" }(this));\n",
"</script>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"import numpy as np\n",
"import pandas as pd\n",
"from IPython.core.display import HTML\n",
"\n",
"import bokeh\n",
"print('Bokeh version:', bokeh.__version__)\n",
"\n",
"from bokeh.plotting import figure, show\n",
"from bokeh.charts import ColumnDataSource\n",
"from bokeh.io import output_notebook\n",
"from bokeh.models import HoverTool\n",
"from bokeh.resources import CDN\n",
"from bokeh.embed import file_html\n",
"output_notebook()\n",
"\n",
"df = pd.DataFrame(np.random.normal(0, 5, (100, 2)), columns=['x','y'])\n",
"source = ColumnDataSource(df)\n",
"hover = HoverTool(tooltips=[(\"x\", \"@x\"), (\"y\", \"@y\")])\n",
"myplot = figure(plot_width=600, plot_height=400, tools='hover,box_zoom,box_select,crosshair,resize,reset')\n",
"myplot.circle('x', 'y', size=7, fill_alpha=0.5, source=source)\n",
"show(myplot, notebook_handle=True);"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now, generate the standalone HTML code using Bokeh's function, see http://bokeh.pydata.org/en/latest/docs/user_guide/embed.html:"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"<!DOCTYPE html>\n",
"<html lang=\"en\">\n",
" <head>\n",
" <meta charset=\"utf-8\">\n",
" <title>Bokeh Application</title>\n",
" \n",
"<link rel=\"stylesheet\" href=\"https://cdn.pydata.org/bokeh/release/bokeh-0.12.5.min.css\" type=\"text/css\" />\n",
" \n",
"<script type=\"text/javascript\" src=\"https://cdn.pydata.org/bokeh/release/bokeh-0.12.5.min.js\"></script>\n",
"<script type=\"text/javascript\">\n",
" Bokeh.set_log_level(\"info\");\n",
"</script>\n",
" <style>\n",
" html {\n",
" width: 100%;\n",
" height: 100%;\n",
" }\n",
" body {\n",
" width: 90%;\n",
" height: 100%;\n",
" margin: auto;\n",
" }\n",
" </style>\n",
" </head>\n",
" <body>\n",
" \n",
" <div class=\"bk-root\">\n",
" <div class=\"bk-plotdiv\" id=\"7fba5f3c-9768-4da5-a715-2ce2313b03ea\"></div>\n",
" </div>\n",
" \n",
" <script type=\"text/javascript\">\n",
" (function() {\n",
" var fn = function() {\n",
" Bokeh.safely(function() {\n",
" var docs_json = {\"a9bf11cd-94a3-4d4b-9f0f-822f753a0002\":{\"roots\":{\"references\":[{\"attributes\":{\"plot\":{\"id\":\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"a136a255-67af-488c-b1d1-cc3adc7ca73a\",\"type\":\"BasicTicker\"}},\"id\":\"bd798fba-2aaa-4b56-8b3d-8ddb97627342\",\"type\":\"Grid\"},{\"attributes\":{\"formatter\":{\"id\":\"61d87393-cf00-4499-82b4-261e61dfaf91\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"3afc6846-986b-40a7-a37d-c7d2796a4c4f\",\"type\":\"BasicTicker\"}},\"id\":\"d550d6c5-3667-4c36-a9a2-10fad47f4852\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"3afc6846-986b-40a7-a37d-c7d2796a4c4f\",\"type\":\"BasicTicker\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"3afc6846-986b-40a7-a37d-c7d2796a4c4f\",\"type\":\"BasicTicker\"}},\"id\":\"436bdf09-504e-4201-91e6-c0a4c73cd6d7\",\"type\":\"Grid\"},{\"attributes\":{\"data_source\":{\"id\":\"89929e99-904f-4740-b94d-40434d54bb92\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1016319b-24e6-4eff-94db-78868e227a9c\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"45d8c71e-14c5-435f-bb11-8c0e732da5e3\",\"type\":\"Circle\"},\"selection_glyph\":null},\"id\":\"75d5ddb3-8f82-416e-bd9e-d8bd94b6da7c\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":7},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1016319b-24e6-4eff-94db-78868e227a9c\",\"type\":\"Circle\"},{\"attributes\":{\"callback\":null,\"plot\":{\"id\":\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"fc7a1324-58f5-4ebe-8333-9ca25c63ac4c\",\"type\":\"HoverTool\"},{\"attributes\":{\"below\":[{\"id\":\"72f241d5-e7b9-4d7c-a0db-b847d91982a9\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"d550d6c5-3667-4c36-a9a2-10fad47f4852\",\"type\":\"LinearAxis\"}],\"plot_height\":400,\"renderers\":[{\"id\":\"72f241d5-e7b9-4d7c-a0db-b847d91982a9\",\"type\":\"LinearAxis\"},{\"id\":\"bd798fba-2aaa-4b56-8b3d-8ddb97627342\",\"type\":\"Grid\"},{\"id\":\"d550d6c5-3667-4c36-a9a2-10fad47f4852\",\"type\":\"LinearAxis\"},{\"id\":\"436bdf09-504e-4201-91e6-c0a4c73cd6d7\",\"type\":\"Grid\"},{\"id\":\"e0b77d7c-1411-4875-a8d4-8c5bf16b8b22\",\"type\":\"BoxAnnotation\"},{\"id\":\"ec7ec3a6-2b24-441e-be55-f4309b6491f0\",\"type\":\"BoxAnnotation\"},{\"id\":\"75d5ddb3-8f82-416e-bd9e-d8bd94b6da7c\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"7835772a-d000-456d-b61e-b8ec099673a8\",\"type\":\"Title\"},\"tool_events\":{\"id\":\"65501ef1-5699-4613-aa04-3832a3895c52\",\"type\":\"ToolEvents\"},\"toolbar\":{\"id\":\"f0b57205-5dde-4329-921c-020f0c4856b5\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"9e263aef-dca3-4046-88d8-33340e00ceb1\",\"type\":\"DataRange1d\"},\"y_range\":{\"id\":\"0998ddb9-81a6-4c89-adf4-3b7352b26284\",\"type\":\"DataRange1d\"}},\"id\":\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"ec7ec3a6-2b24-441e-be55-f4309b6491f0\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"fc7a1324-58f5-4ebe-8333-9ca25c63ac4c\",\"type\":\"HoverTool\"},{\"id\":\"00a4a34a-bd64-42c7-8426-ea4b6505d218\",\"type\":\"BoxZoomTool\"},{\"id\":\"ad7d5fa3-62a1-42da-b319-a238c748dd9e\",\"type\":\"BoxSelectTool\"},{\"id\":\"3ba6e3aa-4e4b-465f-954b-fe08a2fdc0ea\",\"type\":\"CrosshairTool\"},{\"id\":\"fdd02ec3-1a86-4ea2-9db4-9bb27216de73\",\"type\":\"ResizeTool\"},{\"id\":\"3cd4e1ed-08be-4ce6-9a45-06699edb16bf\",\"type\":\"ResetTool\"}]},\"id\":\"f0b57205-5dde-4329-921c-020f0c4856b5\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"61d87393-cf00-4499-82b4-261e61dfaf91\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"callback\":null,\"overlay\":{\"id\":\"ec7ec3a6-2b24-441e-be55-f4309b6491f0\",\"type\":\"BoxAnnotation\"},\"plot\":{\"id\":\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"renderers\":[{\"id\":\"75d5ddb3-8f82-416e-bd9e-d8bd94b6da7c\",\"type\":\"GlyphRenderer\"}]},\"id\":\"ad7d5fa3-62a1-42da-b319-a238c748dd9e\",\"type\":\"BoxSelectTool\"},{\"attributes\":{\"plot\":{\"id\":\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"3ba6e3aa-4e4b-465f-954b-fe08a2fdc0ea\",\"type\":\"CrosshairTool\"},{\"attributes\":{\"plot\":{\"id\":\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"fdd02ec3-1a86-4ea2-9db4-9bb27216de73\",\"type\":\"ResizeTool\"},{\"attributes\":{\"plot\":{\"id\":\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"3cd4e1ed-08be-4ce6-9a45-06699edb16bf\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"65501ef1-5699-4613-aa04-3832a3895c52\",\"type\":\"ToolEvents\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":7},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"45d8c71e-14c5-435f-bb11-8c0e732da5e3\",\"type\":\"Circle\"},{\"attributes\":{\"overlay\":{\"id\":\"e0b77d7c-1411-4875-a8d4-8c5bf16b8b22\",\"type\":\"BoxAnnotation\"},\"plot\":{\"id\":\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"00a4a34a-bd64-42c7-8426-ea4b6505d218\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"plot\":null,\"text\":\"\"},\"id\":\"7835772a-d000-456d-b61e-b8ec099673a8\",\"type\":\"Title\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\",\"index\"],\"data\":{\"index\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99],\"x\":{\"__ndarray__\":\"QtDvFw7EFUC6dPuBf9YVQELWbHUV8Q1AonSoYSYaEEBlB7YBLMQQwBpqtyFo9f0/6WiZWZRF979FLujzaZAPwLugH4jBCB5A0BMnwH8CJMA6yNdFVvMBwGdF8XGQ+OI/XKri1IKlDkA51Bc5CrIHQJLw+KYXEfG/FBvHiTxDAECnR/AnwxDrP+BiztkpDBhA0HnNIkYvE0CvvKhqgs0SQGDx6CCTHiBAcahLKv+EEcBBrBv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4r+E/xoncxPpP+ECZhMhtwJA4J+LJnUC+7/eJ3QoPTP7P1QdxvC+cgtALxU2C9hkHsAnWAjW+hsXQBizFei3LgFAIPZ22+j6I8CUIauhdbwawC/DVlfBIABApoceq6mlD0CnoxuAB6AIwCbbzzl8SgVADue707fKE8BP14fy4xIpwK/A5UZLchNANS8SMlR8BEDuf/wkXI8UwMxfF5ddVBTA+GBnF9pXBMDkKsQT+ED9P+SLL6NkwPm/yh73qgZ4BUAy90Ova0f3P6yCp6j+YRlAFjmmYzffF8Aexxh6sO8iQL0gVijSShdAcDLnOUx78z8mfVcKfD0RQPJvoaxw7f+/8j7f3GMEJsArSbqtyAQBQHRC/ClLcQdAyClc1bTXBUDdgRs5obMJwLCQkL84cB9ABJbv/ny5FEC17G/MYYD2PwbIYCR94wtAI1rc8lOAE8CwQZ0fje0kwG3bY4CItQhA9qiMX2rTD0BIjehyCgYjQCART/dXwRDA6pZItUokFcB4xGZGdMsQwFMf3btW+RzAIbvzMGDrIMBSULR7Adn7v9wty3XcOuO/LRuLaNvg8L+ssL9wRpIDQBdQtqiCbvE/8OXvip6EBkBJCwpaep7bv7aWmpleX9Y/FVT5SiYaFkCMyv5n804RQJYZdwVOtQvAiJGr/6DDFsCVtXGeGJEpQHr2Uz0/zBHAKI3QvdyaIcBIQnRXVarZP4jvefzgiBPAshnEP5w7GEA+EZ1k4iggwHiA4jOb/xZAzt4eovawEkDmikQjnOQTQAihGq0/tRpAT8LdSFx7DkDOhl/J46P+P9qbGcnBlAJA/4kEbmCEH0CIztrIQVEUwEXTp4P6OxzAbc5a5k6EEsA=\",\"dtype\":\"float64\",\"shape\":[100]}}},\"id\":\"89929e99-904f-4740-b94d-40434d54bb92\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"91ae7643-0c5e-41a6-8ef3-c467ef1ffb1f\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"callback\":null},\"id\":\"9e263aef-dca3-4046-88d8-33340e00ceb1\",\"type\":\"DataRange1d\"},{\"attributes\":{\"callback\":null},\"id\":\"0998ddb9-81a6-4c89-adf4-3b7352b26284\",\"type\":\"DataRange1d\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"e0b77d7c-1411-4875-a8d4-8c5bf16b8b22\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"formatter\":{\"id\":\"91ae7643-0c5e-41a6-8ef3-c467ef1ffb1f\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"a136a255-67af-488c-b1d1-cc3adc7ca73a\",\"type\":\"BasicTicker\"}},\"id\":\"72f241d5-e7b9-4d7c-a0db-b847d91982a9\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"a136a255-67af-488c-b1d1-cc3adc7ca73a\",\"type\":\"BasicTicker\"}],\"root_ids\":[\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.5\"}};\n",
" var render_items = [{\"docid\":\"a9bf11cd-94a3-4d4b-9f0f-822f753a0002\",\"elementid\":\"7fba5f3c-9768-4da5-a715-2ce2313b03ea\",\"modelid\":\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\"}];\n",
" \n",
" Bokeh.embed.embed_items(docs_json, render_items);\n",
" });\n",
" };\n",
" if (document.readyState != \"loading\") fn();\n",
" else document.addEventListener(\"DOMContentLoaded\", fn);\n",
" })();\n",
" \n",
" </script>\n",
" </body>\n",
"</html>\n"
]
}
],
"source": [
"myplot_html = file_html(myplot, CDN)\n",
"# this HTML code is very long (~30 K), the cell below doesn't show all the code in NBviewer\n",
"print(myplot_html) "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"And we can execute this HTML code and get the interactive plot again:"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"<!DOCTYPE html>\n",
"<html lang=\"en\">\n",
" <head>\n",
" <meta charset=\"utf-8\">\n",
" <title>Bokeh Application</title>\n",
" \n",
"<link rel=\"stylesheet\" href=\"https://cdn.pydata.org/bokeh/release/bokeh-0.12.5.min.css\" type=\"text/css\" />\n",
" \n",
"<script type=\"text/javascript\" src=\"https://cdn.pydata.org/bokeh/release/bokeh-0.12.5.min.js\"></script>\n",
"<script type=\"text/javascript\">\n",
" Bokeh.set_log_level(\"info\");\n",
"</script>\n",
" <style>\n",
" html {\n",
" width: 100%;\n",
" height: 100%;\n",
" }\n",
" body {\n",
" width: 90%;\n",
" height: 100%;\n",
" margin: auto;\n",
" }\n",
" </style>\n",
" </head>\n",
" <body>\n",
" \n",
" <div class=\"bk-root\">\n",
" <div class=\"bk-plotdiv\" id=\"7fba5f3c-9768-4da5-a715-2ce2313b03ea\"></div>\n",
" </div>\n",
" \n",
" <script type=\"text/javascript\">\n",
" (function() {\n",
" var fn = function() {\n",
" Bokeh.safely(function() {\n",
" var docs_json = {\"a9bf11cd-94a3-4d4b-9f0f-822f753a0002\":{\"roots\":{\"references\":[{\"attributes\":{\"plot\":{\"id\":\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"a136a255-67af-488c-b1d1-cc3adc7ca73a\",\"type\":\"BasicTicker\"}},\"id\":\"bd798fba-2aaa-4b56-8b3d-8ddb97627342\",\"type\":\"Grid\"},{\"attributes\":{\"formatter\":{\"id\":\"61d87393-cf00-4499-82b4-261e61dfaf91\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"3afc6846-986b-40a7-a37d-c7d2796a4c4f\",\"type\":\"BasicTicker\"}},\"id\":\"d550d6c5-3667-4c36-a9a2-10fad47f4852\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"3afc6846-986b-40a7-a37d-c7d2796a4c4f\",\"type\":\"BasicTicker\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"3afc6846-986b-40a7-a37d-c7d2796a4c4f\",\"type\":\"BasicTicker\"}},\"id\":\"436bdf09-504e-4201-91e6-c0a4c73cd6d7\",\"type\":\"Grid\"},{\"attributes\":{\"data_source\":{\"id\":\"89929e99-904f-4740-b94d-40434d54bb92\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1016319b-24e6-4eff-94db-78868e227a9c\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"45d8c71e-14c5-435f-bb11-8c0e732da5e3\",\"type\":\"Circle\"},\"selection_glyph\":null},\"id\":\"75d5ddb3-8f82-416e-bd9e-d8bd94b6da7c\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":7},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1016319b-24e6-4eff-94db-78868e227a9c\",\"type\":\"Circle\"},{\"attributes\":{\"callback\":null,\"plot\":{\"id\":\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"fc7a1324-58f5-4ebe-8333-9ca25c63ac4c\",\"type\":\"HoverTool\"},{\"attributes\":{\"below\":[{\"id\":\"72f241d5-e7b9-4d7c-a0db-b847d91982a9\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"d550d6c5-3667-4c36-a9a2-10fad47f4852\",\"type\":\"LinearAxis\"}],\"plot_height\":400,\"renderers\":[{\"id\":\"72f241d5-e7b9-4d7c-a0db-b847d91982a9\",\"type\":\"LinearAxis\"},{\"id\":\"bd798fba-2aaa-4b56-8b3d-8ddb97627342\",\"type\":\"Grid\"},{\"id\":\"d550d6c5-3667-4c36-a9a2-10fad47f4852\",\"type\":\"LinearAxis\"},{\"id\":\"436bdf09-504e-4201-91e6-c0a4c73cd6d7\",\"type\":\"Grid\"},{\"id\":\"e0b77d7c-1411-4875-a8d4-8c5bf16b8b22\",\"type\":\"BoxAnnotation\"},{\"id\":\"ec7ec3a6-2b24-441e-be55-f4309b6491f0\",\"type\":\"BoxAnnotation\"},{\"id\":\"75d5ddb3-8f82-416e-bd9e-d8bd94b6da7c\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"7835772a-d000-456d-b61e-b8ec099673a8\",\"type\":\"Title\"},\"tool_events\":{\"id\":\"65501ef1-5699-4613-aa04-3832a3895c52\",\"type\":\"ToolEvents\"},\"toolbar\":{\"id\":\"f0b57205-5dde-4329-921c-020f0c4856b5\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"9e263aef-dca3-4046-88d8-33340e00ceb1\",\"type\":\"DataRange1d\"},\"y_range\":{\"id\":\"0998ddb9-81a6-4c89-adf4-3b7352b26284\",\"type\":\"DataRange1d\"}},\"id\":\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"ec7ec3a6-2b24-441e-be55-f4309b6491f0\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"fc7a1324-58f5-4ebe-8333-9ca25c63ac4c\",\"type\":\"HoverTool\"},{\"id\":\"00a4a34a-bd64-42c7-8426-ea4b6505d218\",\"type\":\"BoxZoomTool\"},{\"id\":\"ad7d5fa3-62a1-42da-b319-a238c748dd9e\",\"type\":\"BoxSelectTool\"},{\"id\":\"3ba6e3aa-4e4b-465f-954b-fe08a2fdc0ea\",\"type\":\"CrosshairTool\"},{\"id\":\"fdd02ec3-1a86-4ea2-9db4-9bb27216de73\",\"type\":\"ResizeTool\"},{\"id\":\"3cd4e1ed-08be-4ce6-9a45-06699edb16bf\",\"type\":\"ResetTool\"}]},\"id\":\"f0b57205-5dde-4329-921c-020f0c4856b5\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"61d87393-cf00-4499-82b4-261e61dfaf91\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"callback\":null,\"overlay\":{\"id\":\"ec7ec3a6-2b24-441e-be55-f4309b6491f0\",\"type\":\"BoxAnnotation\"},\"plot\":{\"id\":\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"renderers\":[{\"id\":\"75d5ddb3-8f82-416e-bd9e-d8bd94b6da7c\",\"type\":\"GlyphRenderer\"}]},\"id\":\"ad7d5fa3-62a1-42da-b319-a238c748dd9e\",\"type\":\"BoxSelectTool\"},{\"attributes\":{\"plot\":{\"id\":\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"3ba6e3aa-4e4b-465f-954b-fe08a2fdc0ea\",\"type\":\"CrosshairTool\"},{\"attributes\":{\"plot\":{\"id\":\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"fdd02ec3-1a86-4ea2-9db4-9bb27216de73\",\"type\":\"ResizeTool\"},{\"attributes\":{\"plot\":{\"id\":\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"3cd4e1ed-08be-4ce6-9a45-06699edb16bf\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"65501ef1-5699-4613-aa04-3832a3895c52\",\"type\":\"ToolEvents\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":7},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"45d8c71e-14c5-435f-bb11-8c0e732da5e3\",\"type\":\"Circle\"},{\"attributes\":{\"overlay\":{\"id\":\"e0b77d7c-1411-4875-a8d4-8c5bf16b8b22\",\"type\":\"BoxAnnotation\"},\"plot\":{\"id\":\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"00a4a34a-bd64-42c7-8426-ea4b6505d218\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"plot\":null,\"text\":\"\"},\"id\":\"7835772a-d000-456d-b61e-b8ec099673a8\",\"type\":\"Title\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x\",\"y\",\"index\"],\"data\":{\"index\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,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DkDOhl/J46P+P9qbGcnBlAJA/4kEbmCEH0CIztrIQVEUwEXTp4P6OxzAbc5a5k6EEsA=\",\"dtype\":\"float64\",\"shape\":[100]}}},\"id\":\"89929e99-904f-4740-b94d-40434d54bb92\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"91ae7643-0c5e-41a6-8ef3-c467ef1ffb1f\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"callback\":null},\"id\":\"9e263aef-dca3-4046-88d8-33340e00ceb1\",\"type\":\"DataRange1d\"},{\"attributes\":{\"callback\":null},\"id\":\"0998ddb9-81a6-4c89-adf4-3b7352b26284\",\"type\":\"DataRange1d\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"e0b77d7c-1411-4875-a8d4-8c5bf16b8b22\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"formatter\":{\"id\":\"91ae7643-0c5e-41a6-8ef3-c467ef1ffb1f\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"a136a255-67af-488c-b1d1-cc3adc7ca73a\",\"type\":\"BasicTicker\"}},\"id\":\"72f241d5-e7b9-4d7c-a0db-b847d91982a9\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"a136a255-67af-488c-b1d1-cc3adc7ca73a\",\"type\":\"BasicTicker\"}],\"root_ids\":[\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.5\"}};\n",
" var render_items = [{\"docid\":\"a9bf11cd-94a3-4d4b-9f0f-822f753a0002\",\"elementid\":\"7fba5f3c-9768-4da5-a715-2ce2313b03ea\",\"modelid\":\"7e77cf28-6fda-45b1-a5c8-de8a84864f3e\"}];\n",
" \n",
" Bokeh.embed.embed_items(docs_json, render_items);\n",
" });\n",
" };\n",
" if (document.readyState != \"loading\") fn();\n",
" else document.addEventListener(\"DOMContentLoaded\", fn);\n",
" })();\n",
" \n",
" </script>\n",
" </body>\n",
"</html>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from IPython.core.display import HTML\n",
"HTML(myplot_html)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.1"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment