Skip to content

Instantly share code, notes, and snippets.

@rsignell-usgs
Last active July 9, 2018 11:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rsignell-usgs/dc4de1264b85ca762571e976f70b74e5 to your computer and use it in GitHub Desktop.
Save rsignell-usgs/dc4de1264b85ca762571e976f70b74e5 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import urllib\n",
"import os\n",
"\n",
"N = 500\n",
"x = np.linspace(0, 10, N)\n",
"y = np.linspace(0, 10, N)\n",
"xx, yy = np.meshgrid(x, y)\n",
"z = np.sin(xx) * np.cos(yy)"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
" <div class=\"bk-root\">\n",
" <a href=\"https://bokeh.pydata.org\" target=\"_blank\" class=\"bk-logo bk-logo-small bk-logo-notebook\"></a>\n",
" <span id=\"eefc8f80-9aaf-4f47-839a-b4532a371a61\">Loading BokehJS ...</span>\n",
" </div>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
"(function(root) {\n",
" function now() {\n",
" return new Date();\n",
" }\n",
"\n",
" var force = true;\n",
"\n",
" if (typeof (root._bokeh_onload_callbacks) === \"undefined\" || force === true) {\n",
" root._bokeh_onload_callbacks = [];\n",
" root._bokeh_is_loading = undefined;\n",
" }\n",
"\n",
" var JS_MIME_TYPE = 'application/javascript';\n",
" var HTML_MIME_TYPE = 'text/html';\n",
" var EXEC_MIME_TYPE = 'application/vnd.bokehjs_exec.v0+json';\n",
" var CLASS_NAME = 'output_bokeh rendered_html';\n",
"\n",
" /**\n",
" * Render data to the DOM node\n",
" */\n",
" function render(props, node) {\n",
" var script = document.createElement(\"script\");\n",
" node.appendChild(script);\n",
" }\n",
"\n",
" /**\n",
" * Handle when an output is cleared or removed\n",
" */\n",
" function handleClearOutput(event, handle) {\n",
" var cell = handle.cell;\n",
"\n",
" var id = cell.output_area._bokeh_element_id;\n",
" var server_id = cell.output_area._bokeh_server_id;\n",
" // Clean up Bokeh references\n",
" if (id !== undefined) {\n",
" Bokeh.index[id].model.document.clear();\n",
" delete Bokeh.index[id];\n",
" }\n",
"\n",
" if (server_id !== undefined) {\n",
" // Clean up Bokeh references\n",
" var cmd = \"from bokeh.io.state import curstate; print(curstate().uuid_to_server['\" + server_id + \"'].get_sessions()[0].document.roots[0]._id)\";\n",
" cell.notebook.kernel.execute(cmd, {\n",
" iopub: {\n",
" output: function(msg) {\n",
" var element_id = msg.content.text.trim();\n",
" Bokeh.index[element_id].model.document.clear();\n",
" delete Bokeh.index[element_id];\n",
" }\n",
" }\n",
" });\n",
" // Destroy server and session\n",
" var cmd = \"import bokeh.io.notebook as ion; ion.destroy_server('\" + server_id + \"')\";\n",
" cell.notebook.kernel.execute(cmd);\n",
" }\n",
" }\n",
"\n",
" /**\n",
" * Handle when a new output is added\n",
" */\n",
" function handleAddOutput(event, handle) {\n",
" var output_area = handle.output_area;\n",
" var output = handle.output;\n",
"\n",
" // limit handleAddOutput to display_data with EXEC_MIME_TYPE content only\n",
" if ((output.output_type != \"display_data\") || (!output.data.hasOwnProperty(EXEC_MIME_TYPE))) {\n",
" return\n",
" }\n",
"\n",
" var toinsert = output_area.element.find(\".\" + CLASS_NAME.split(' ')[0]);\n",
"\n",
" if (output.metadata[EXEC_MIME_TYPE][\"id\"] !== undefined) {\n",
" toinsert[toinsert.length - 1].firstChild.textContent = output.data[JS_MIME_TYPE];\n",
" // store reference to embed id on output_area\n",
" output_area._bokeh_element_id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n",
" }\n",
" if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n",
" var bk_div = document.createElement(\"div\");\n",
" bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n",
" var script_attrs = bk_div.children[0].attributes;\n",
" for (var i = 0; i < script_attrs.length; i++) {\n",
" toinsert[toinsert.length - 1].firstChild.setAttribute(script_attrs[i].name, script_attrs[i].value);\n",
" }\n",
" // store reference to server id on output_area\n",
" output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n",
" }\n",
" }\n",
"\n",
" function register_renderer(events, OutputArea) {\n",
"\n",
" function append_mime(data, metadata, element) {\n",
" // create a DOM node to render to\n",
" var toinsert = this.create_output_subarea(\n",
" metadata,\n",
" CLASS_NAME,\n",
" EXEC_MIME_TYPE\n",
" );\n",
" this.keyboard_manager.register_events(toinsert);\n",
" // Render to node\n",
" var props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n",
" render(props, toinsert[toinsert.length - 1]);\n",
" element.append(toinsert);\n",
" return toinsert\n",
" }\n",
"\n",
" /* Handle when an output is cleared or removed */\n",
" events.on('clear_output.CodeCell', handleClearOutput);\n",
" events.on('delete.Cell', handleClearOutput);\n",
"\n",
" /* Handle when a new output is added */\n",
" events.on('output_added.OutputArea', handleAddOutput);\n",
"\n",
" /**\n",
" * Register the mime type and append_mime function with output_area\n",
" */\n",
" OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n",
" /* Is output safe? */\n",
" safe: true,\n",
" /* Index of renderer in `output_area.display_order` */\n",
" index: 0\n",
" });\n",
" }\n",
"\n",
" // register the mime type if in Jupyter Notebook environment and previously unregistered\n",
" if (root.Jupyter !== undefined) {\n",
" var events = require('base/js/events');\n",
" var OutputArea = require('notebook/js/outputarea').OutputArea;\n",
"\n",
" if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n",
" register_renderer(events, OutputArea);\n",
" }\n",
" }\n",
"\n",
" \n",
" if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n",
" root._bokeh_timeout = Date.now() + 5000;\n",
" root._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",
" var el = document.getElementById(\"eefc8f80-9aaf-4f47-839a-b4532a371a61\");\n",
" if (el != null) {\n",
" el.textContent = \"BokehJS is loading...\";\n",
" }\n",
" if (root.Bokeh !== undefined) {\n",
" if (el != null) {\n",
" el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n",
" }\n",
" } else if (Date.now() < root._bokeh_timeout) {\n",
" setTimeout(display_loaded, 100)\n",
" }\n",
" }\n",
"\n",
"\n",
" function run_callbacks() {\n",
" try {\n",
" root._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n",
" }\n",
" finally {\n",
" delete root._bokeh_onload_callbacks\n",
" }\n",
" console.info(\"Bokeh: all callbacks have finished\");\n",
" }\n",
"\n",
" function load_libs(js_urls, callback) {\n",
" root._bokeh_onload_callbacks.push(callback);\n",
" if (root._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",
" root._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",
" root._bokeh_is_loading--;\n",
" if (root._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(\"eefc8f80-9aaf-4f47-839a-b4532a371a61\");\n",
" if (element == null) {\n",
" console.log(\"Bokeh: ERROR: autoload.js configured with elementid 'eefc8f80-9aaf-4f47-839a-b4532a371a61' 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.16.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.16.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.16.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-gl-0.12.16.min.js\"];\n",
"\n",
" var inline_js = [\n",
" function(Bokeh) {\n",
" Bokeh.set_log_level(\"info\");\n",
" },\n",
" \n",
" function(Bokeh) {\n",
" \n",
" },\n",
" function(Bokeh) {\n",
" console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-0.12.16.min.css\");\n",
" Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-0.12.16.min.css\");\n",
" console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.16.min.css\");\n",
" Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.16.min.css\");\n",
" console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.16.min.css\");\n",
" Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.16.min.css\");\n",
" }\n",
" ];\n",
"\n",
" function run_inline_js() {\n",
" \n",
" if ((root.Bokeh !== undefined) || (force === true)) {\n",
" for (var i = 0; i < inline_js.length; i++) {\n",
" inline_js[i].call(root, root.Bokeh);\n",
" }if (force === true) {\n",
" display_loaded();\n",
" }} else if (Date.now() < root._bokeh_timeout) {\n",
" setTimeout(run_inline_js, 100);\n",
" } else if (!root._bokeh_failed_load) {\n",
" console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n",
" root._bokeh_failed_load = true;\n",
" } else if (force !== true) {\n",
" var cell = $(document.getElementById(\"eefc8f80-9aaf-4f47-839a-b4532a371a61\")).parents('.cell').data().cell;\n",
" cell.output_area.append_execute_result(NB_LOAD_WARNING)\n",
" }\n",
"\n",
" }\n",
"\n",
" if (root._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",
"}(window));"
],
"application/vnd.bokehjs_load.v0+json": "\n(function(root) {\n function now() {\n return new Date();\n }\n\n var force = true;\n\n if (typeof (root._bokeh_onload_callbacks) === \"undefined\" || force === true) {\n root._bokeh_onload_callbacks = [];\n root._bokeh_is_loading = undefined;\n }\n\n \n\n \n if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n root._bokeh_timeout = Date.now() + 5000;\n root._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 var el = document.getElementById(\"eefc8f80-9aaf-4f47-839a-b4532a371a61\");\n if (el != null) {\n el.textContent = \"BokehJS is loading...\";\n }\n if (root.Bokeh !== undefined) {\n if (el != null) {\n el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n }\n } else if (Date.now() < root._bokeh_timeout) {\n setTimeout(display_loaded, 100)\n }\n }\n\n\n function run_callbacks() {\n try {\n root._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n }\n finally {\n delete root._bokeh_onload_callbacks\n }\n console.info(\"Bokeh: all callbacks have finished\");\n }\n\n function load_libs(js_urls, callback) {\n root._bokeh_onload_callbacks.push(callback);\n if (root._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 root._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 root._bokeh_is_loading--;\n if (root._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(\"eefc8f80-9aaf-4f47-839a-b4532a371a61\");\n if (element == null) {\n console.log(\"Bokeh: ERROR: autoload.js configured with elementid 'eefc8f80-9aaf-4f47-839a-b4532a371a61' 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.16.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.16.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.16.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-gl-0.12.16.min.js\"];\n\n var inline_js = [\n function(Bokeh) {\n Bokeh.set_log_level(\"info\");\n },\n \n function(Bokeh) {\n \n },\n function(Bokeh) {\n console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-0.12.16.min.css\");\n Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-0.12.16.min.css\");\n console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.16.min.css\");\n Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.16.min.css\");\n console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.16.min.css\");\n Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-tables-0.12.16.min.css\");\n }\n ];\n\n function run_inline_js() {\n \n if ((root.Bokeh !== undefined) || (force === true)) {\n for (var i = 0; i < inline_js.length; i++) {\n inline_js[i].call(root, root.Bokeh);\n }if (force === true) {\n display_loaded();\n }} else if (Date.now() < root._bokeh_timeout) {\n setTimeout(run_inline_js, 100);\n } else if (!root._bokeh_failed_load) {\n console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n root._bokeh_failed_load = true;\n } else if (force !== true) {\n var cell = $(document.getElementById(\"eefc8f80-9aaf-4f47-839a-b4532a371a61\")).parents('.cell').data().cell;\n cell.output_area.append_execute_result(NB_LOAD_WARNING)\n }\n\n }\n\n if (root._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}(window));"
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from bokeh import events\n",
"from bokeh.io import show, output_notebook\n",
"from bokeh.plotting import figure\n",
"\n",
"output_notebook()"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [],
"source": [
"def remote_jupyter_proxy_url(port):\n",
" \"\"\"\n",
" Callable to configure Bokeh's show method when a proxy must be\n",
" configured.\n",
"\n",
" If port is None we're asking about the URL\n",
" for the origin header.\n",
" \"\"\"\n",
" #base_url = os.environ['EXTERNAL_URL']\n",
" base_url = 'http://pangeo.esipfed.org'\n",
" host = urllib.parse.urlparse(base_url).netloc\n",
"\n",
" # If port is None we're asking for the URL origin\n",
" # so return the public hostname.\n",
" if port is None:\n",
" return host\n",
"\n",
" service_url_path = os.environ['JUPYTERHUB_SERVICE_PREFIX']\n",
" proxy_url_path = 'proxy/%d' % port\n",
"\n",
" user_url = urllib.parse.urljoin(base_url, service_url_path)\n",
" full_url = urllib.parse.urljoin(user_url, proxy_url_path)\n",
" return full_url"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [],
"source": [
"geom = {}\n",
"global geom\n",
"\n",
"def print_event(attributes=[]):\n",
" def python_callback(event):\n",
" geom.update(event.__dict__['geometry'])\n",
"# print(event.__dict__['geometry'])\n",
" return python_callback\n",
"\n",
"\n",
"def modify_doc(doc):\n",
" p = figure(x_range=(0, 10), y_range=(0, 10), plot_height=300,\n",
" tools='reset,box_select,lasso_select,poly_select')\n",
"\n",
" p.image(image=[z], x=0, y=0, dw=10, dh=10, palette='Spectral11')\n",
"\n",
" # register Python event callbacks\n",
" p.on_event(events.SelectionGeometry, print_event(attributes=['geometry']))\n",
"\n",
" doc.add_root(p)"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {
"scrolled": false
},
"outputs": [
{
"data": {
"application/vnd.bokehjs_exec.v0+json": "",
"text/html": [
"\n",
"<script\n",
" src=\"http://pangeo.esipfed.org/user/rsignell-usgs/proxy/44402/autoload.js?bokeh-autoload-element=e2f05b5d-cfd9-4dc3-be3f-443d0dee5f61&bokeh-app-path=/user/rsignell-usgs/proxy/44402&bokeh-absolute-url=http://pangeo.esipfed.org/user/rsignell-usgs/proxy/44402&resources=none\"\n",
" id=\"e2f05b5d-cfd9-4dc3-be3f-443d0dee5f61\"\n",
" data-bokeh-model-id=\"\"\n",
" data-bokeh-doc-id=\"\"\n",
"></script>"
]
},
"metadata": {
"application/vnd.bokehjs_exec.v0+json": {
"server_id": "d046fa83af1d43b29599f67d4595a73d"
}
},
"output_type": "display_data"
}
],
"source": [
"show(modify_doc, notebook_url=remote_jupyter_proxy_url)"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'type': 'poly', 'sx': [312.45997619628906, 312.45997619628906, 312.45997619628906, 312.45997619628906, 313.09999084472656, 314.38002014160156, 316.9400177001953, 318.86000061035156, 319.50001525878906, 319.50001525878906, 319.50001525878906, 319.50001525878906, 319.50001525878906, 319.50001525878906, 320.1399688720703, 320.7799835205078, 321.42005920410156, 329.74000549316406, 342.5399932861328, 348.3000030517578, 353.42005920410156, 355.33998107910156, 361.74000549316406, 365.57997131347656, 368.7799835205078, 370.69996643066406, 375.1800079345703, 382.2200469970703, 385.42005920410156, 394.38002014160156, 402.69996643066406, 414.86000061035156, 418.0600128173828, 423.1800079345703, 425.74000549316406, 427.0199737548828, 428.3000030517578, 428.9400177001953, 430.21998596191406, 430.86000061035156, 432.1399688720703, 432.7799835205078, 435.97999572753906, 437.2599639892578, 441.09999084472656, 441.09999084472656, 442.38002014160156, 443.6599884033203, 444.9400177001953, 444.9400177001953, 445.57997131347656, 445.57997131347656, 445.57997131347656, 445.57997131347656, 445.57997131347656, 444.9400177001953, 443.6599884033203, 440.45997619628906, 436.62001037597656, 435.33998107910156, 431.50001525878906, 427.0199737548828, 425.09999084472656, 421.2599639892578, 418.0600128173828, 418.0600128173828, 416.7799835205078, 416.1399688720703, 415.50001525878906, 414.86000061035156, 414.21998596191406, 413.57997131347656, 413.57997131347656], 'sy': [69.00001525878906, 86.00001525878906, 97.51998901367188, 102.00001525878906, 110.31999206542969, 114.80001831054688, 122.47999572753906, 125.67999267578125, 126.95999145507812, 128.239990234375, 128.87998962402344, 129.51998901367188, 130.1599884033203, 130.80001831054688, 130.80001831054688, 131.44000244140625, 132.0800018310547, 134.00001525878906, 138.47999572753906, 139.75999450683594, 140.40000915527344, 141.0399932861328, 141.0399932861328, 141.0399932861328, 141.0399932861328, 141.0399932861328, 141.0399932861328, 141.0399932861328, 141.6800079345703, 141.6800079345703, 141.6800079345703, 141.6800079345703, 141.6800079345703, 141.6800079345703, 140.40000915527344, 140.40000915527344, 139.75999450683594, 138.47999572753906, 137.83998107910156, 137.20001220703125, 136.55999755859375, 134.63999938964844, 132.0800018310547, 128.239990234375, 123.1199951171875, 121.20001220703125, 117.36000061035156, 113.51998901367188, 109.03999328613281, 107.1199951171875, 103.27999877929688, 102.63999938964844, 101.36000061035156, 100.72000122070312, 100.08000183105469, 98.80001831054688, 97.51998901367188, 93.67999267578125, 90.47999572753906, 89.83999633789062, 87.27999877929688, 84.72000122070312, 82.80001831054688, 76.40000915527344, 70.63999938964844, 69.36000061035156, 66.80001831054688, 65.51998901367188, 64.87998962402344, 64.87998962402344, 64.239990234375, 63.60002136230469, 63.60002136230469], 'x': {'0': 5.2831497471847815, '1': 5.2831497471847815, '2': 5.2831497471847815, '3': 5.2831497471847815, '4': 5.294871627192794, '5': 5.31831538720882, '6': 5.365201789380866, '7': 5.4003663115449, '8': 5.412088191552913, '9': 5.412088191552913, '10': 5.412088191552913, '11': 5.412088191552913, '12': 5.412088191552913, '13': 5.412088191552913, '14': 5.423808953700921, '15': 5.435530833708934, '16': 5.447253831576951, '17': 5.5996338002411, '18': 5.8340658111013335, '19': 5.939560495453439, '20': 6.033334417657538, '21': 6.068497821961567, '22': 6.185714386321686, '23': 6.256043430649754, '24': 6.314651712829813, '25': 6.349816234993847, '26': 6.431868277189932, '27': 6.560806721558064, '28': 6.619415003738124, '29': 6.783516852410285, '30': 6.935896821074433, '31': 7.158608069786658, '32': 7.217216351966718, '33': 7.310989156310812, '34': 7.357875558482858, '35': 7.381318200638879, '36': 7.404761960654905, '37': 7.416483840662917, '38': 7.439926482818938, '39': 7.451648362826951, '40': 7.475091004982972, '41': 7.486812884990985, '42': 7.545421167171045, '43': 7.568863809327066, '44': 7.639193971515138, '45': 7.639193971515138, '46': 7.662637731531164, '47': 7.686080373687185, '48': 7.70952413370321, '49': 7.70952413370321, '50': 7.7212448958512185, '51': 7.7212448958512185, '52': 7.7212448958512185, '53': 7.7212448958512185, '54': 7.7212448958512185, '55': 7.70952413370321, '56': 7.686080373687185, '57': 7.6274720915071255, '58': 7.557143047179058, '59': 7.533699287163032, '60': 7.463370242834964, '61': 7.381318200638879, '62': 7.346153678474845, '63': 7.275823516286773, '64': 7.217216351966718, '65': 7.217216351966718, '66': 7.193772591950692, '67': 7.182050711942679, '68': 7.170329949794671, '69': 7.158608069786658, '70': 7.1468861897786455, '71': 7.135164309770633, '72': 7.135164309770633}, 'y': {'0': 7.63837582070889, '1': 7.0110695476461595, '2': 6.585978265178159, '3': 6.420663643587119, '4': 6.113653429319937, '5': 5.948338807728898, '6': 5.66494480710188, '7': 5.54686373890106, '8': 5.499631311620733, '9': 5.452398884340406, '10': 5.428782670700242, '11': 5.405166457060078, '12': 5.381550243419914, '13': 5.357932903669857, '14': 5.357932903669857, '15': 5.33431725308464, '16': 5.310701039444476, '17': 5.239851835469038, '18': 5.074538903042839, '19': 5.027306475762511, '20': 5.003689699067401, '21': 4.980074048482184, '22': 4.980074048482184, '23': 4.980074048482184, '24': 4.980074048482184, '25': 4.980074048482184, '26': 4.980074048482184, '27': 4.980074048482184, '28': 4.956457271787073, '29': 4.956457271787073, '30': 4.956457271787073, '31': 4.956457271787073, '32': 4.956457271787073, '33': 4.956457271787073, '34': 5.003689699067401, '35': 5.003689699067401, '36': 5.027306475762511, '37': 5.074538903042839, '38': 5.09815567973795, '39': 5.121770767268219, '40': 5.14538754396333, '41': 5.2162361848838215, '42': 5.310701039444476, '43': 5.452398884340406, '44': 5.641328593461716, '45': 5.71217667132726, '46': 5.853874516223189, '47': 5.995572361119119, '48': 6.160885856600265, '49': 6.2317344975207565, '50': 6.373431779361739, '51': 6.397047993001903, '52': 6.4442804202822295, '53': 6.467896633922393, '54': 6.491512847562557, '55': 6.538744711787938, '56': 6.585978265178159, '57': 6.727675547019142, '58': 6.84575661521996, '59': 6.869372828860124, '60': 6.963837683420779, '61': 7.058302537981434, '62': 7.129150615846979, '63': 7.365313315303562, '64': 7.577859801119984, '65': 7.625092228400311, '66': 7.7195565199060185, '67': 7.7667900732962405, '68': 7.790406286936404, '69': 7.790406286936404, '70': 7.814022500576568, '71': 7.837637588106838, '72': 7.837637588106838}}\n"
]
}
],
"source": [
"print(geom)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"gist": {
"data": {
"description": "bokeh_image_selector",
"public": true
},
"id": ""
},
"kernelspec": {
"display_name": "Python [conda root]",
"language": "python",
"name": "conda-root-py"
},
"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.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment