From b5801b7a706aff3df2b921186c8c70ce58013c25 Mon Sep 17 00:00:00 2001 From: Jiwoo Lee Date: Tue, 19 Nov 2024 17:11:03 -0800 Subject: [PATCH 1/2] make parameters to be more consistant to those of taylor diagram --- ESMBenchmarkViz/core_scatter_plot.py | 43 ++++++++++++++---------- docs/examples/example_scatter_plot.ipynb | 12 +++---- 2 files changed, 31 insertions(+), 24 deletions(-) diff --git a/ESMBenchmarkViz/core_scatter_plot.py b/ESMBenchmarkViz/core_scatter_plot.py index ab116e0..602d914 100644 --- a/ESMBenchmarkViz/core_scatter_plot.py +++ b/ESMBenchmarkViz/core_scatter_plot.py @@ -2,15 +2,24 @@ import numpy as np from bokeh.layouts import column, row -from bokeh.models import Button, ColumnDataSource, CustomJS, Div, HoverTool, Select +from bokeh.models import ColumnDataSource, CustomJS, HoverTool from bokeh.plotting import figure, show +from .support_functions import ( + create_image_display, + create_name_select, + create_navigation_buttons, +) + def scatter_plot( x: Union[List[float], np.ndarray], y: Union[List[float], np.ndarray], names: List[str] = None, images: List[str] = None, + title: str = "Interactive Scatter Plot", + width: int = 600, + height: int = 400, show_plot: bool = True, ) -> figure: """ @@ -26,6 +35,12 @@ def scatter_plot( List of names corresponding to the data points. images : list, optional List of image file paths corresponding to the data points, by default None + title : str, optional + Title of the plot, by default "Interactive Scatter Plot" + width : int, optional + Width of the plot, by default 600 + height : int, optional + Height of the plot, by default 400 show_plot : bool, optional If True, the plot will be displayed in the workflow (default is True). @@ -72,10 +87,10 @@ def scatter_plot( # Create a scatter plot p = figure( - title="Interactive Scatter Plot", + width=width, + height=height, + title=title, tools="tap, pan, wheel_zoom, box_zoom, reset", - height=400, - width=600, ) points = p.scatter("x", "y", size=10, source=source) @@ -107,18 +122,14 @@ def scatter_plot( p.add_tools(hover) # Div to display image and x, y values on click - image_display = Div( - text="Click on a point to display the image here.", width=300, height=300 - ) - - max_height = 200 + # maximum height is for the actual image display inside the image_display Div + image_display, max_height = create_image_display(width, height) # Dropdown menu for names with default "Select Data" - name_select = Select( - title="Select Data Point", - value="Select Data", - options=["Select Data"] + data["names"], - ) + name_select = create_name_select(data) + + # Create buttons for Previous and Next Image Navigation + previous_button, next_button = create_navigation_buttons() # JavaScript callback for dropdown selection changes dropdown_callback = CustomJS( @@ -185,10 +196,6 @@ def scatter_plot( ) source.selected.js_on_change("indices", click_callback) - # Button for Previous and Next Image Navigation - previous_button = Button(label="Previous Image", width=150) - next_button = Button(label="Next Image", width=150) - # JavaScript callback for "Previous Image" button previous_callback = CustomJS( args=dict( diff --git a/docs/examples/example_scatter_plot.ipynb b/docs/examples/example_scatter_plot.ipynb index 0cbd6cd..3d74884 100644 --- a/docs/examples/example_scatter_plot.ipynb +++ b/docs/examples/example_scatter_plot.ipynb @@ -39,7 +39,7 @@ " \n", "
\n", " \n", - " Loading BokehJS ...\n", + " Loading BokehJS ...\n", "
\n" ] }, @@ -48,7 +48,7 @@ }, { "data": { - "application/javascript": "'use strict';\n(function(root) {\n function now() {\n return new Date();\n }\n\n const 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\nconst JS_MIME_TYPE = 'application/javascript';\n const HTML_MIME_TYPE = 'text/html';\n const EXEC_MIME_TYPE = 'application/vnd.bokehjs_exec.v0+json';\n const CLASS_NAME = 'output_bokeh rendered_html';\n\n /**\n * Render data to the DOM node\n */\n function render(props, node) {\n const 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 function drop(id) {\n const view = Bokeh.index.get_by_id(id)\n if (view != null) {\n view.model.document.clear()\n Bokeh.index.delete(view)\n }\n }\n\n const cell = handle.cell;\n\n const id = cell.output_area._bokeh_element_id;\n const server_id = cell.output_area._bokeh_server_id;\n\n // Clean up Bokeh references\n if (id != null) {\n drop(id)\n }\n\n if (server_id !== undefined) {\n // Clean up Bokeh references\n const cmd_clean = \"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_clean, {\n iopub: {\n output: function(msg) {\n const id = msg.content.text.trim()\n drop(id)\n }\n }\n });\n // Destroy server and session\n const cmd_destroy = \"import bokeh.io.notebook as ion; ion.destroy_server('\" + server_id + \"')\";\n cell.notebook.kernel.execute(cmd_destroy);\n }\n }\n\n /**\n * Handle when a new output is added\n */\n function handleAddOutput(event, handle) {\n const output_area = handle.output_area;\n const output = handle.output;\n\n // limit handleAddOutput to display_data with EXEC_MIME_TYPE content only\n if ((output.output_type != \"display_data\") || (!Object.prototype.hasOwnProperty.call(output.data, EXEC_MIME_TYPE))) {\n return\n }\n\n const 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 const bk_div = document.createElement(\"div\");\n bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n const script_attrs = bk_div.children[0].attributes;\n for (let i = 0; i < script_attrs.length; i++) {\n toinsert[toinsert.length - 1].firstChild.setAttribute(script_attrs[i].name, script_attrs[i].value);\n toinsert[toinsert.length - 1].firstChild.textContent = bk_div.children[0].textContent\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 const 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 const 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 const events = require('base/js/events');\n const 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 if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n root._bokeh_timeout = Date.now() + 5000;\n root._bokeh_failed_load = false;\n }\n\n const NB_LOAD_WARNING = {'data': {'text/html':\n \"
\\n\"+\n \"

\\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 \"

\\n\"+\n \"\\n\"+\n \"\\n\"+\n \"from bokeh.resources import INLINE\\n\"+\n \"output_notebook(resources=INLINE)\\n\"+\n \"\\n\"+\n \"
\"}};\n\n function display_loaded(error = null) {\n const el = document.getElementById(\"e02ab1ec-15bd-4d56-b50d-51c98563181d\");\n if (el != null) {\n const html = (() => {\n if (typeof root.Bokeh === \"undefined\") {\n if (error == null) {\n return \"BokehJS is loading ...\";\n } else {\n return \"BokehJS failed to load.\";\n }\n } else {\n const prefix = `BokehJS ${root.Bokeh.version}`;\n if (error == null) {\n return `${prefix} successfully loaded.`;\n } else {\n return `${prefix} encountered errors while loading and may not function as expected.`;\n }\n }\n })();\n el.innerHTML = html;\n\n if (error != null) {\n const wrapper = document.createElement(\"div\");\n wrapper.style.overflow = \"auto\";\n wrapper.style.height = \"5em\";\n wrapper.style.resize = \"vertical\";\n const content = document.createElement(\"div\");\n content.style.fontFamily = \"monospace\";\n content.style.whiteSpace = \"pre-wrap\";\n content.style.backgroundColor = \"rgb(255, 221, 221)\";\n content.textContent = error.stack ?? error.toString();\n wrapper.append(content);\n el.append(wrapper);\n }\n } else if (Date.now() < root._bokeh_timeout) {\n setTimeout(() => display_loaded(error), 100);\n }\n }\n\n function run_callbacks() {\n try {\n root._bokeh_onload_callbacks.forEach(function(callback) {\n if (callback != null)\n callback();\n });\n } finally {\n delete root._bokeh_onload_callbacks\n }\n console.debug(\"Bokeh: all callbacks have finished\");\n }\n\n function load_libs(css_urls, js_urls, callback) {\n if (css_urls == null) css_urls = [];\n if (js_urls == null) js_urls = [];\n\n root._bokeh_onload_callbacks.push(callback);\n if (root._bokeh_is_loading > 0) {\n console.debug(\"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.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n root._bokeh_is_loading = css_urls.length + js_urls.length;\n\n function on_load() {\n root._bokeh_is_loading--;\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n run_callbacks()\n }\n }\n\n function on_error(url) {\n console.error(\"failed to load \" + url);\n }\n\n for (let i = 0; i < css_urls.length; i++) {\n const url = css_urls[i];\n const element = document.createElement(\"link\");\n element.onload = on_load;\n element.onerror = on_error.bind(null, url);\n element.rel = \"stylesheet\";\n element.type = \"text/css\";\n element.href = url;\n console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n document.body.appendChild(element);\n }\n\n for (let i = 0; i < js_urls.length; i++) {\n const url = js_urls[i];\n const element = document.createElement('script');\n element.onload = on_load;\n element.onerror = on_error.bind(null, url);\n element.async = false;\n element.src = url;\n console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n document.head.appendChild(element);\n }\n };\n\n function inject_raw_css(css) {\n const element = document.createElement(\"style\");\n element.appendChild(document.createTextNode(css));\n document.body.appendChild(element);\n }\n\n const js_urls = [\"https://cdn.bokeh.org/bokeh/release/bokeh-3.6.0.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-gl-3.6.0.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-3.6.0.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-3.6.0.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-mathjax-3.6.0.min.js\"];\n const css_urls = [];\n\n const inline_js = [ function(Bokeh) {\n Bokeh.set_log_level(\"info\");\n },\nfunction(Bokeh) {\n }\n ];\n\n function run_inline_js() {\n if (root.Bokeh !== undefined || force === true) {\n try {\n for (let i = 0; i < inline_js.length; i++) {\n inline_js[i].call(root, root.Bokeh);\n }\n\n } catch (error) {display_loaded(error);throw error;\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 const cell = $(document.getElementById(\"e02ab1ec-15bd-4d56-b50d-51c98563181d\")).parents('.cell').data().cell;\n cell.output_area.append_execute_result(NB_LOAD_WARNING)\n }\n }\n\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: BokehJS loaded, going straight to plotting\");\n run_inline_js();\n } else {\n load_libs(css_urls, js_urls, function() {\n console.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n run_inline_js();\n });\n }\n}(window));", + "application/javascript": "'use strict';\n(function(root) {\n function now() {\n return new Date();\n }\n\n const 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\nconst JS_MIME_TYPE = 'application/javascript';\n const HTML_MIME_TYPE = 'text/html';\n const EXEC_MIME_TYPE = 'application/vnd.bokehjs_exec.v0+json';\n const CLASS_NAME = 'output_bokeh rendered_html';\n\n /**\n * Render data to the DOM node\n */\n function render(props, node) {\n const 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 function drop(id) {\n const view = Bokeh.index.get_by_id(id)\n if (view != null) {\n view.model.document.clear()\n Bokeh.index.delete(view)\n }\n }\n\n const cell = handle.cell;\n\n const id = cell.output_area._bokeh_element_id;\n const server_id = cell.output_area._bokeh_server_id;\n\n // Clean up Bokeh references\n if (id != null) {\n drop(id)\n }\n\n if (server_id !== undefined) {\n // Clean up Bokeh references\n const cmd_clean = \"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_clean, {\n iopub: {\n output: function(msg) {\n const id = msg.content.text.trim()\n drop(id)\n }\n }\n });\n // Destroy server and session\n const cmd_destroy = \"import bokeh.io.notebook as ion; ion.destroy_server('\" + server_id + \"')\";\n cell.notebook.kernel.execute(cmd_destroy);\n }\n }\n\n /**\n * Handle when a new output is added\n */\n function handleAddOutput(event, handle) {\n const output_area = handle.output_area;\n const output = handle.output;\n\n // limit handleAddOutput to display_data with EXEC_MIME_TYPE content only\n if ((output.output_type != \"display_data\") || (!Object.prototype.hasOwnProperty.call(output.data, EXEC_MIME_TYPE))) {\n return\n }\n\n const 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 const bk_div = document.createElement(\"div\");\n bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n const script_attrs = bk_div.children[0].attributes;\n for (let i = 0; i < script_attrs.length; i++) {\n toinsert[toinsert.length - 1].firstChild.setAttribute(script_attrs[i].name, script_attrs[i].value);\n toinsert[toinsert.length - 1].firstChild.textContent = bk_div.children[0].textContent\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 const 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 const 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 const events = require('base/js/events');\n const 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 if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n root._bokeh_timeout = Date.now() + 5000;\n root._bokeh_failed_load = false;\n }\n\n const NB_LOAD_WARNING = {'data': {'text/html':\n \"
\\n\"+\n \"

\\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 \"

\\n\"+\n \"\\n\"+\n \"\\n\"+\n \"from bokeh.resources import INLINE\\n\"+\n \"output_notebook(resources=INLINE)\\n\"+\n \"\\n\"+\n \"
\"}};\n\n function display_loaded(error = null) {\n const el = document.getElementById(\"fbc6c223-2a34-4297-8df3-95283465287e\");\n if (el != null) {\n const html = (() => {\n if (typeof root.Bokeh === \"undefined\") {\n if (error == null) {\n return \"BokehJS is loading ...\";\n } else {\n return \"BokehJS failed to load.\";\n }\n } else {\n const prefix = `BokehJS ${root.Bokeh.version}`;\n if (error == null) {\n return `${prefix} successfully loaded.`;\n } else {\n return `${prefix} encountered errors while loading and may not function as expected.`;\n }\n }\n })();\n el.innerHTML = html;\n\n if (error != null) {\n const wrapper = document.createElement(\"div\");\n wrapper.style.overflow = \"auto\";\n wrapper.style.height = \"5em\";\n wrapper.style.resize = \"vertical\";\n const content = document.createElement(\"div\");\n content.style.fontFamily = \"monospace\";\n content.style.whiteSpace = \"pre-wrap\";\n content.style.backgroundColor = \"rgb(255, 221, 221)\";\n content.textContent = error.stack ?? error.toString();\n wrapper.append(content);\n el.append(wrapper);\n }\n } else if (Date.now() < root._bokeh_timeout) {\n setTimeout(() => display_loaded(error), 100);\n }\n }\n\n function run_callbacks() {\n try {\n root._bokeh_onload_callbacks.forEach(function(callback) {\n if (callback != null)\n callback();\n });\n } finally {\n delete root._bokeh_onload_callbacks\n }\n console.debug(\"Bokeh: all callbacks have finished\");\n }\n\n function load_libs(css_urls, js_urls, callback) {\n if (css_urls == null) css_urls = [];\n if (js_urls == null) js_urls = [];\n\n root._bokeh_onload_callbacks.push(callback);\n if (root._bokeh_is_loading > 0) {\n console.debug(\"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.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n root._bokeh_is_loading = css_urls.length + js_urls.length;\n\n function on_load() {\n root._bokeh_is_loading--;\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n run_callbacks()\n }\n }\n\n function on_error(url) {\n console.error(\"failed to load \" + url);\n }\n\n for (let i = 0; i < css_urls.length; i++) {\n const url = css_urls[i];\n const element = document.createElement(\"link\");\n element.onload = on_load;\n element.onerror = on_error.bind(null, url);\n element.rel = \"stylesheet\";\n element.type = \"text/css\";\n element.href = url;\n console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n document.body.appendChild(element);\n }\n\n for (let i = 0; i < js_urls.length; i++) {\n const url = js_urls[i];\n const element = document.createElement('script');\n element.onload = on_load;\n element.onerror = on_error.bind(null, url);\n element.async = false;\n element.src = url;\n console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n document.head.appendChild(element);\n }\n };\n\n function inject_raw_css(css) {\n const element = document.createElement(\"style\");\n element.appendChild(document.createTextNode(css));\n document.body.appendChild(element);\n }\n\n const js_urls = [\"https://cdn.bokeh.org/bokeh/release/bokeh-3.6.0.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-gl-3.6.0.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-3.6.0.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-3.6.0.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-mathjax-3.6.0.min.js\"];\n const css_urls = [];\n\n const inline_js = [ function(Bokeh) {\n Bokeh.set_log_level(\"info\");\n },\nfunction(Bokeh) {\n }\n ];\n\n function run_inline_js() {\n if (root.Bokeh !== undefined || force === true) {\n try {\n for (let i = 0; i < inline_js.length; i++) {\n inline_js[i].call(root, root.Bokeh);\n }\n\n } catch (error) {display_loaded(error);throw error;\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 const cell = $(document.getElementById(\"fbc6c223-2a34-4297-8df3-95283465287e\")).parents('.cell').data().cell;\n cell.output_area.append_execute_result(NB_LOAD_WARNING)\n }\n }\n\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: BokehJS loaded, going straight to plotting\");\n run_inline_js();\n } else {\n load_libs(css_urls, js_urls, function() {\n console.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n run_inline_js();\n });\n }\n}(window));", "application/vnd.bokehjs_load.v0+json": "" }, "metadata": {}, @@ -78,7 +78,7 @@ "data": { "text/html": [ "\n", - "
\n" + "
\n" ] }, "metadata": {}, @@ -86,7 +86,7 @@ }, { "data": { - "application/javascript": "(function(root) {\n function embed_document(root) {\n const docs_json = {\"be6ff616-c5a7-498d-873d-8d19999896c4\":{\"version\":\"3.6.0\",\"title\":\"Bokeh Application\",\"roots\":[{\"type\":\"object\",\"name\":\"Figure\",\"id\":\"p1004\",\"attributes\":{\"height\":400,\"x_range\":{\"type\":\"object\",\"name\":\"DataRange1d\",\"id\":\"p1005\"},\"y_range\":{\"type\":\"object\",\"name\":\"DataRange1d\",\"id\":\"p1006\"},\"x_scale\":{\"type\":\"object\",\"name\":\"LinearScale\",\"id\":\"p1014\"},\"y_scale\":{\"type\":\"object\",\"name\":\"LinearScale\",\"id\":\"p1015\"},\"title\":{\"type\":\"object\",\"name\":\"Title\",\"id\":\"p1007\",\"attributes\":{\"text\":\"Interactive Scatter Plot\"}},\"renderers\":[{\"type\":\"object\",\"name\":\"GlyphRenderer\",\"id\":\"p1044\",\"attributes\":{\"data_source\":{\"type\":\"object\",\"name\":\"ColumnDataSource\",\"id\":\"p1001\",\"attributes\":{\"selected\":{\"type\":\"object\",\"name\":\"Selection\",\"id\":\"p1002\",\"attributes\":{\"indices\":[],\"line_indices\":[]}},\"selection_policy\":{\"type\":\"object\",\"name\":\"UnionRenderers\",\"id\":\"p1003\"},\"data\":{\"type\":\"map\",\"entries\":[[\"x\",[1,2,3]],[\"y\",[6,7,2]],[\"names\",[\"Point A\",\"Point B\",\"Point C\"]]]}}},\"view\":{\"type\":\"object\",\"name\":\"CDSView\",\"id\":\"p1045\",\"attributes\":{\"filter\":{\"type\":\"object\",\"name\":\"AllIndices\",\"id\":\"p1046\"}}},\"glyph\":{\"type\":\"object\",\"name\":\"Scatter\",\"id\":\"p1041\",\"attributes\":{\"x\":{\"type\":\"field\",\"field\":\"x\"},\"y\":{\"type\":\"field\",\"field\":\"y\"},\"size\":{\"type\":\"value\",\"value\":10},\"line_color\":{\"type\":\"value\",\"value\":\"#1f77b4\"},\"fill_color\":{\"type\":\"value\",\"value\":\"#1f77b4\"}}},\"nonselection_glyph\":{\"type\":\"object\",\"name\":\"Scatter\",\"id\":\"p1042\",\"attributes\":{\"x\":{\"type\":\"field\",\"field\":\"x\"},\"y\":{\"type\":\"field\",\"field\":\"y\"},\"size\":{\"type\":\"value\",\"value\":10},\"line_color\":{\"type\":\"value\",\"value\":\"#1f77b4\"},\"line_alpha\":{\"type\":\"value\",\"value\":0.1},\"fill_color\":{\"type\":\"value\",\"value\":\"#1f77b4\"},\"fill_alpha\":{\"type\":\"value\",\"value\":0.1},\"hatch_alpha\":{\"type\":\"value\",\"value\":0.1}}},\"muted_glyph\":{\"type\":\"object\",\"name\":\"Scatter\",\"id\":\"p1043\",\"attributes\":{\"x\":{\"type\":\"field\",\"field\":\"x\"},\"y\":{\"type\":\"field\",\"field\":\"y\"},\"size\":{\"type\":\"value\",\"value\":10},\"line_color\":{\"type\":\"value\",\"value\":\"#1f77b4\"},\"line_alpha\":{\"type\":\"value\",\"value\":0.2},\"fill_color\":{\"type\":\"value\",\"value\":\"#1f77b4\"},\"fill_alpha\":{\"type\":\"value\",\"value\":0.2},\"hatch_alpha\":{\"type\":\"value\",\"value\":0.2}}}}}],\"toolbar\":{\"type\":\"object\",\"name\":\"Toolbar\",\"id\":\"p1013\",\"attributes\":{\"tools\":[{\"type\":\"object\",\"name\":\"TapTool\",\"id\":\"p1026\",\"attributes\":{\"renderers\":\"auto\"}},{\"type\":\"object\",\"name\":\"PanTool\",\"id\":\"p1027\"},{\"type\":\"object\",\"name\":\"WheelZoomTool\",\"id\":\"p1028\",\"attributes\":{\"renderers\":\"auto\"}},{\"type\":\"object\",\"name\":\"BoxZoomTool\",\"id\":\"p1029\",\"attributes\":{\"overlay\":{\"type\":\"object\",\"name\":\"BoxAnnotation\",\"id\":\"p1030\",\"attributes\":{\"syncable\":false,\"line_color\":\"black\",\"line_alpha\":1.0,\"line_width\":2,\"line_dash\":[4,4],\"fill_color\":\"lightgrey\",\"fill_alpha\":0.5,\"level\":\"overlay\",\"visible\":false,\"left\":{\"type\":\"number\",\"value\":\"nan\"},\"right\":{\"type\":\"number\",\"value\":\"nan\"},\"top\":{\"type\":\"number\",\"value\":\"nan\"},\"bottom\":{\"type\":\"number\",\"value\":\"nan\"},\"left_units\":\"canvas\",\"right_units\":\"canvas\",\"top_units\":\"canvas\",\"bottom_units\":\"canvas\",\"handles\":{\"type\":\"object\",\"name\":\"BoxInteractionHandles\",\"id\":\"p1036\",\"attributes\":{\"all\":{\"type\":\"object\",\"name\":\"AreaVisuals\",\"id\":\"p1035\",\"attributes\":{\"fill_color\":\"white\",\"hover_fill_color\":\"lightgray\"}}}}}}}},{\"type\":\"object\",\"name\":\"ResetTool\",\"id\":\"p1037\"},{\"type\":\"object\",\"name\":\"HoverTool\",\"id\":\"p1047\",\"attributes\":{\"renderers\":[{\"id\":\"p1044\"}],\"tooltips\":[[\"Name\",\"@names\"],[\"X\",\"@x\"],[\"Y\",\"@y\"]]}}]}},\"left\":[{\"type\":\"object\",\"name\":\"LinearAxis\",\"id\":\"p1021\",\"attributes\":{\"ticker\":{\"type\":\"object\",\"name\":\"BasicTicker\",\"id\":\"p1022\",\"attributes\":{\"mantissas\":[1,2,5]}},\"formatter\":{\"type\":\"object\",\"name\":\"BasicTickFormatter\",\"id\":\"p1023\"},\"major_label_policy\":{\"type\":\"object\",\"name\":\"AllLabels\",\"id\":\"p1024\"}}}],\"below\":[{\"type\":\"object\",\"name\":\"LinearAxis\",\"id\":\"p1016\",\"attributes\":{\"ticker\":{\"type\":\"object\",\"name\":\"BasicTicker\",\"id\":\"p1017\",\"attributes\":{\"mantissas\":[1,2,5]}},\"formatter\":{\"type\":\"object\",\"name\":\"BasicTickFormatter\",\"id\":\"p1018\"},\"major_label_policy\":{\"type\":\"object\",\"name\":\"AllLabels\",\"id\":\"p1019\"}}}],\"center\":[{\"type\":\"object\",\"name\":\"Grid\",\"id\":\"p1020\",\"attributes\":{\"axis\":{\"id\":\"p1016\"}}},{\"type\":\"object\",\"name\":\"Grid\",\"id\":\"p1025\",\"attributes\":{\"dimension\":1,\"axis\":{\"id\":\"p1021\"}}}]}}]}};\n const render_items = [{\"docid\":\"be6ff616-c5a7-498d-873d-8d19999896c4\",\"roots\":{\"p1004\":\"ce44c88d-dc25-4549-9dcb-a9440bb7096f\"},\"root_ids\":[\"p1004\"]}];\n void root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n }\n if (root.Bokeh !== undefined) {\n embed_document(root);\n } else {\n let attempts = 0;\n const timer = setInterval(function(root) {\n if (root.Bokeh !== undefined) {\n clearInterval(timer);\n embed_document(root);\n } else {\n attempts++;\n if (attempts > 100) {\n clearInterval(timer);\n console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n }\n }\n }, 10, root)\n }\n})(window);", + "application/javascript": "(function(root) {\n function embed_document(root) {\n const docs_json = {\"b9b8e1d7-1fd1-4036-b88c-4ccd43e2ca27\":{\"version\":\"3.6.0\",\"title\":\"Bokeh Application\",\"roots\":[{\"type\":\"object\",\"name\":\"Figure\",\"id\":\"p1004\",\"attributes\":{\"height\":400,\"x_range\":{\"type\":\"object\",\"name\":\"DataRange1d\",\"id\":\"p1005\"},\"y_range\":{\"type\":\"object\",\"name\":\"DataRange1d\",\"id\":\"p1006\"},\"x_scale\":{\"type\":\"object\",\"name\":\"LinearScale\",\"id\":\"p1014\"},\"y_scale\":{\"type\":\"object\",\"name\":\"LinearScale\",\"id\":\"p1015\"},\"title\":{\"type\":\"object\",\"name\":\"Title\",\"id\":\"p1007\",\"attributes\":{\"text\":\"Interactive Scatter Plot\"}},\"renderers\":[{\"type\":\"object\",\"name\":\"GlyphRenderer\",\"id\":\"p1044\",\"attributes\":{\"data_source\":{\"type\":\"object\",\"name\":\"ColumnDataSource\",\"id\":\"p1001\",\"attributes\":{\"selected\":{\"type\":\"object\",\"name\":\"Selection\",\"id\":\"p1002\",\"attributes\":{\"indices\":[],\"line_indices\":[]}},\"selection_policy\":{\"type\":\"object\",\"name\":\"UnionRenderers\",\"id\":\"p1003\"},\"data\":{\"type\":\"map\",\"entries\":[[\"x\",[1,2,3]],[\"y\",[6,7,2]],[\"names\",[\"Point A\",\"Point B\",\"Point C\"]]]}}},\"view\":{\"type\":\"object\",\"name\":\"CDSView\",\"id\":\"p1045\",\"attributes\":{\"filter\":{\"type\":\"object\",\"name\":\"AllIndices\",\"id\":\"p1046\"}}},\"glyph\":{\"type\":\"object\",\"name\":\"Scatter\",\"id\":\"p1041\",\"attributes\":{\"x\":{\"type\":\"field\",\"field\":\"x\"},\"y\":{\"type\":\"field\",\"field\":\"y\"},\"size\":{\"type\":\"value\",\"value\":10},\"line_color\":{\"type\":\"value\",\"value\":\"#1f77b4\"},\"fill_color\":{\"type\":\"value\",\"value\":\"#1f77b4\"}}},\"nonselection_glyph\":{\"type\":\"object\",\"name\":\"Scatter\",\"id\":\"p1042\",\"attributes\":{\"x\":{\"type\":\"field\",\"field\":\"x\"},\"y\":{\"type\":\"field\",\"field\":\"y\"},\"size\":{\"type\":\"value\",\"value\":10},\"line_color\":{\"type\":\"value\",\"value\":\"#1f77b4\"},\"line_alpha\":{\"type\":\"value\",\"value\":0.1},\"fill_color\":{\"type\":\"value\",\"value\":\"#1f77b4\"},\"fill_alpha\":{\"type\":\"value\",\"value\":0.1},\"hatch_alpha\":{\"type\":\"value\",\"value\":0.1}}},\"muted_glyph\":{\"type\":\"object\",\"name\":\"Scatter\",\"id\":\"p1043\",\"attributes\":{\"x\":{\"type\":\"field\",\"field\":\"x\"},\"y\":{\"type\":\"field\",\"field\":\"y\"},\"size\":{\"type\":\"value\",\"value\":10},\"line_color\":{\"type\":\"value\",\"value\":\"#1f77b4\"},\"line_alpha\":{\"type\":\"value\",\"value\":0.2},\"fill_color\":{\"type\":\"value\",\"value\":\"#1f77b4\"},\"fill_alpha\":{\"type\":\"value\",\"value\":0.2},\"hatch_alpha\":{\"type\":\"value\",\"value\":0.2}}}}}],\"toolbar\":{\"type\":\"object\",\"name\":\"Toolbar\",\"id\":\"p1013\",\"attributes\":{\"tools\":[{\"type\":\"object\",\"name\":\"TapTool\",\"id\":\"p1026\",\"attributes\":{\"renderers\":\"auto\"}},{\"type\":\"object\",\"name\":\"PanTool\",\"id\":\"p1027\"},{\"type\":\"object\",\"name\":\"WheelZoomTool\",\"id\":\"p1028\",\"attributes\":{\"renderers\":\"auto\"}},{\"type\":\"object\",\"name\":\"BoxZoomTool\",\"id\":\"p1029\",\"attributes\":{\"overlay\":{\"type\":\"object\",\"name\":\"BoxAnnotation\",\"id\":\"p1030\",\"attributes\":{\"syncable\":false,\"line_color\":\"black\",\"line_alpha\":1.0,\"line_width\":2,\"line_dash\":[4,4],\"fill_color\":\"lightgrey\",\"fill_alpha\":0.5,\"level\":\"overlay\",\"visible\":false,\"left\":{\"type\":\"number\",\"value\":\"nan\"},\"right\":{\"type\":\"number\",\"value\":\"nan\"},\"top\":{\"type\":\"number\",\"value\":\"nan\"},\"bottom\":{\"type\":\"number\",\"value\":\"nan\"},\"left_units\":\"canvas\",\"right_units\":\"canvas\",\"top_units\":\"canvas\",\"bottom_units\":\"canvas\",\"handles\":{\"type\":\"object\",\"name\":\"BoxInteractionHandles\",\"id\":\"p1036\",\"attributes\":{\"all\":{\"type\":\"object\",\"name\":\"AreaVisuals\",\"id\":\"p1035\",\"attributes\":{\"fill_color\":\"white\",\"hover_fill_color\":\"lightgray\"}}}}}}}},{\"type\":\"object\",\"name\":\"ResetTool\",\"id\":\"p1037\"},{\"type\":\"object\",\"name\":\"HoverTool\",\"id\":\"p1047\",\"attributes\":{\"renderers\":[{\"id\":\"p1044\"}],\"tooltips\":[[\"Name\",\"@names\"],[\"X\",\"@x\"],[\"Y\",\"@y\"]]}}]}},\"left\":[{\"type\":\"object\",\"name\":\"LinearAxis\",\"id\":\"p1021\",\"attributes\":{\"ticker\":{\"type\":\"object\",\"name\":\"BasicTicker\",\"id\":\"p1022\",\"attributes\":{\"mantissas\":[1,2,5]}},\"formatter\":{\"type\":\"object\",\"name\":\"BasicTickFormatter\",\"id\":\"p1023\"},\"major_label_policy\":{\"type\":\"object\",\"name\":\"AllLabels\",\"id\":\"p1024\"}}}],\"below\":[{\"type\":\"object\",\"name\":\"LinearAxis\",\"id\":\"p1016\",\"attributes\":{\"ticker\":{\"type\":\"object\",\"name\":\"BasicTicker\",\"id\":\"p1017\",\"attributes\":{\"mantissas\":[1,2,5]}},\"formatter\":{\"type\":\"object\",\"name\":\"BasicTickFormatter\",\"id\":\"p1018\"},\"major_label_policy\":{\"type\":\"object\",\"name\":\"AllLabels\",\"id\":\"p1019\"}}}],\"center\":[{\"type\":\"object\",\"name\":\"Grid\",\"id\":\"p1020\",\"attributes\":{\"axis\":{\"id\":\"p1016\"}}},{\"type\":\"object\",\"name\":\"Grid\",\"id\":\"p1025\",\"attributes\":{\"dimension\":1,\"axis\":{\"id\":\"p1021\"}}}]}}]}};\n const render_items = [{\"docid\":\"b9b8e1d7-1fd1-4036-b88c-4ccd43e2ca27\",\"roots\":{\"p1004\":\"da98c449-6e17-4b3d-a8d4-d77d25fc01d1\"},\"root_ids\":[\"p1004\"]}];\n void root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n }\n if (root.Bokeh !== undefined) {\n embed_document(root);\n } else {\n let attempts = 0;\n const timer = setInterval(function(root) {\n if (root.Bokeh !== undefined) {\n clearInterval(timer);\n embed_document(root);\n } else {\n attempts++;\n if (attempts > 100) {\n clearInterval(timer);\n console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n }\n }\n }, 10, root)\n }\n})(window);", "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { @@ -124,7 +124,7 @@ "data": { "text/html": [ "\n", - "
\n" + "
\n" ] }, "metadata": {}, @@ -132,7 +132,7 @@ }, { "data": { - "application/javascript": "(function(root) {\n function embed_document(root) {\n const docs_json = {\"e90cf54a-a422-45db-a109-91d30313a099\":{\"version\":\"3.6.0\",\"title\":\"Bokeh Application\",\"roots\":[{\"type\":\"object\",\"name\":\"Row\",\"id\":\"p1105\",\"attributes\":{\"children\":[{\"type\":\"object\",\"name\":\"Figure\",\"id\":\"p1051\",\"attributes\":{\"height\":400,\"x_range\":{\"type\":\"object\",\"name\":\"DataRange1d\",\"id\":\"p1052\"},\"y_range\":{\"type\":\"object\",\"name\":\"DataRange1d\",\"id\":\"p1053\"},\"x_scale\":{\"type\":\"object\",\"name\":\"LinearScale\",\"id\":\"p1061\"},\"y_scale\":{\"type\":\"object\",\"name\":\"LinearScale\",\"id\":\"p1062\"},\"title\":{\"type\":\"object\",\"name\":\"Title\",\"id\":\"p1054\",\"attributes\":{\"text\":\"Interactive Scatter Plot\"}},\"renderers\":[{\"type\":\"object\",\"name\":\"GlyphRenderer\",\"id\":\"p1091\",\"attributes\":{\"data_source\":{\"type\":\"object\",\"name\":\"ColumnDataSource\",\"id\":\"p1048\",\"attributes\":{\"selected\":{\"type\":\"object\",\"name\":\"Selection\",\"id\":\"p1049\",\"attributes\":{\"js_property_callbacks\":{\"type\":\"map\",\"entries\":[[\"change:indices\",[{\"type\":\"object\",\"name\":\"CustomJS\",\"id\":\"p1098\",\"attributes\":{\"args\":{\"type\":\"map\",\"entries\":[[\"source\",{\"id\":\"p1048\"}],[\"div\",{\"type\":\"object\",\"name\":\"Div\",\"id\":\"p1095\",\"attributes\":{\"width\":300,\"height\":300,\"text\":\"Click on a point to display the image here.\"}}],[\"name_select\",{\"type\":\"object\",\"name\":\"Select\",\"id\":\"p1096\",\"attributes\":{\"js_property_callbacks\":{\"type\":\"map\",\"entries\":[[\"change:value\",[{\"type\":\"object\",\"name\":\"CustomJS\",\"id\":\"p1097\",\"attributes\":{\"args\":{\"type\":\"map\",\"entries\":[[\"source\",{\"id\":\"p1048\"}],[\"div\",{\"id\":\"p1095\"}],[\"name_select\",{\"id\":\"p1096\"}],[\"maxHeight\",200]]},\"code\":\"\\n const name_value = name_select.value;\\n const indices = source.data.names.map((name, i) => (name === name_value) ? i : -1).filter(i => i >= 0);\\n\\n if (indices.length > 0) {\\n const selected = indices[0];\\n const img_url = source.data.images[selected];\\n const x_value = source.data.x[selected];\\n const y_value = source.data.y[selected];\\n\\n if (img_url) {\\n div.text = `
X: ${x_value}
Y: ${y_value}
`;\\n } else {\\n div.text = `
No image available
X: ${x_value}
Y: ${y_value}
`;\\n }\\n\\n // Highlight the selected point on the scatter plot\\n source.selected.indices = [selected];\\n } else {\\n div.text = \\\"No matching point found.\\\";\\n source.selected.indices = []; // Clear selection if no match\\n }\\n \"}}]]]},\"title\":\"Select Data Point\",\"options\":[\"Select Data\",\"Point A\",\"Point B\",\"Point C\"],\"value\":\"Select Data\"}}],[\"maxHeight\",200]]},\"code\":\"\\n const selected = source.selected.indices[0];\\n if (selected != null) {\\n const name_value = source.data.names[selected];\\n const img_url = source.data.images[selected];\\n const x_value = source.data.x[selected];\\n const y_value = source.data.y[selected];\\n\\n // Update dropdown\\n name_select.value = name_value;\\n\\n if (img_url) {\\n // Display the image\\n div.text = `
X: ${x_value}
Y: ${y_value}
`;\\n } else {\\n // No image available\\n div.text = `
No image available
X: ${x_value}
Y: ${y_value}
`;\\n }\\n }\\n \"}}]]]},\"indices\":[],\"line_indices\":[]}},\"selection_policy\":{\"type\":\"object\",\"name\":\"UnionRenderers\",\"id\":\"p1050\"},\"data\":{\"type\":\"map\",\"entries\":[[\"x\",[1,2,3]],[\"y\",[6,7,2]],[\"names\",[\"Point A\",\"Point B\",\"Point C\"]],[\"images\",[\"images/image1.jpg\",null,\"images/image3.jpg\"]]]}}},\"view\":{\"type\":\"object\",\"name\":\"CDSView\",\"id\":\"p1092\",\"attributes\":{\"filter\":{\"type\":\"object\",\"name\":\"AllIndices\",\"id\":\"p1093\"}}},\"glyph\":{\"type\":\"object\",\"name\":\"Scatter\",\"id\":\"p1088\",\"attributes\":{\"x\":{\"type\":\"field\",\"field\":\"x\"},\"y\":{\"type\":\"field\",\"field\":\"y\"},\"size\":{\"type\":\"value\",\"value\":10},\"line_color\":{\"type\":\"value\",\"value\":\"#1f77b4\"},\"fill_color\":{\"type\":\"value\",\"value\":\"#1f77b4\"}}},\"nonselection_glyph\":{\"type\":\"object\",\"name\":\"Scatter\",\"id\":\"p1089\",\"attributes\":{\"x\":{\"type\":\"field\",\"field\":\"x\"},\"y\":{\"type\":\"field\",\"field\":\"y\"},\"size\":{\"type\":\"value\",\"value\":10},\"line_color\":{\"type\":\"value\",\"value\":\"#1f77b4\"},\"line_alpha\":{\"type\":\"value\",\"value\":0.1},\"fill_color\":{\"type\":\"value\",\"value\":\"#1f77b4\"},\"fill_alpha\":{\"type\":\"value\",\"value\":0.1},\"hatch_alpha\":{\"type\":\"value\",\"value\":0.1}}},\"muted_glyph\":{\"type\":\"object\",\"name\":\"Scatter\",\"id\":\"p1090\",\"attributes\":{\"x\":{\"type\":\"field\",\"field\":\"x\"},\"y\":{\"type\":\"field\",\"field\":\"y\"},\"size\":{\"type\":\"value\",\"value\":10},\"line_color\":{\"type\":\"value\",\"value\":\"#1f77b4\"},\"line_alpha\":{\"type\":\"value\",\"value\":0.2},\"fill_color\":{\"type\":\"value\",\"value\":\"#1f77b4\"},\"fill_alpha\":{\"type\":\"value\",\"value\":0.2},\"hatch_alpha\":{\"type\":\"value\",\"value\":0.2}}}}}],\"toolbar\":{\"type\":\"object\",\"name\":\"Toolbar\",\"id\":\"p1060\",\"attributes\":{\"tools\":[{\"type\":\"object\",\"name\":\"TapTool\",\"id\":\"p1073\",\"attributes\":{\"renderers\":\"auto\"}},{\"type\":\"object\",\"name\":\"PanTool\",\"id\":\"p1074\"},{\"type\":\"object\",\"name\":\"WheelZoomTool\",\"id\":\"p1075\",\"attributes\":{\"renderers\":\"auto\"}},{\"type\":\"object\",\"name\":\"BoxZoomTool\",\"id\":\"p1076\",\"attributes\":{\"overlay\":{\"type\":\"object\",\"name\":\"BoxAnnotation\",\"id\":\"p1077\",\"attributes\":{\"syncable\":false,\"line_color\":\"black\",\"line_alpha\":1.0,\"line_width\":2,\"line_dash\":[4,4],\"fill_color\":\"lightgrey\",\"fill_alpha\":0.5,\"level\":\"overlay\",\"visible\":false,\"left\":{\"type\":\"number\",\"value\":\"nan\"},\"right\":{\"type\":\"number\",\"value\":\"nan\"},\"top\":{\"type\":\"number\",\"value\":\"nan\"},\"bottom\":{\"type\":\"number\",\"value\":\"nan\"},\"left_units\":\"canvas\",\"right_units\":\"canvas\",\"top_units\":\"canvas\",\"bottom_units\":\"canvas\",\"handles\":{\"type\":\"object\",\"name\":\"BoxInteractionHandles\",\"id\":\"p1083\",\"attributes\":{\"all\":{\"type\":\"object\",\"name\":\"AreaVisuals\",\"id\":\"p1082\",\"attributes\":{\"fill_color\":\"white\",\"hover_fill_color\":\"lightgray\"}}}}}}}},{\"type\":\"object\",\"name\":\"ResetTool\",\"id\":\"p1084\"},{\"type\":\"object\",\"name\":\"HoverTool\",\"id\":\"p1094\",\"attributes\":{\"renderers\":[{\"id\":\"p1091\"}],\"tooltips\":\"\\n
\\n \\\"\\\"\\n
Name: @names
\\n
X: @x
\\n
Y: @y
\\n
\\n \"}}]}},\"left\":[{\"type\":\"object\",\"name\":\"LinearAxis\",\"id\":\"p1068\",\"attributes\":{\"ticker\":{\"type\":\"object\",\"name\":\"BasicTicker\",\"id\":\"p1069\",\"attributes\":{\"mantissas\":[1,2,5]}},\"formatter\":{\"type\":\"object\",\"name\":\"BasicTickFormatter\",\"id\":\"p1070\"},\"major_label_policy\":{\"type\":\"object\",\"name\":\"AllLabels\",\"id\":\"p1071\"}}}],\"below\":[{\"type\":\"object\",\"name\":\"LinearAxis\",\"id\":\"p1063\",\"attributes\":{\"ticker\":{\"type\":\"object\",\"name\":\"BasicTicker\",\"id\":\"p1064\",\"attributes\":{\"mantissas\":[1,2,5]}},\"formatter\":{\"type\":\"object\",\"name\":\"BasicTickFormatter\",\"id\":\"p1065\"},\"major_label_policy\":{\"type\":\"object\",\"name\":\"AllLabels\",\"id\":\"p1066\"}}}],\"center\":[{\"type\":\"object\",\"name\":\"Grid\",\"id\":\"p1067\",\"attributes\":{\"axis\":{\"id\":\"p1063\"}}},{\"type\":\"object\",\"name\":\"Grid\",\"id\":\"p1072\",\"attributes\":{\"dimension\":1,\"axis\":{\"id\":\"p1068\"}}}]}},{\"type\":\"object\",\"name\":\"Column\",\"id\":\"p1104\",\"attributes\":{\"children\":[{\"id\":\"p1096\"},{\"id\":\"p1095\"},{\"type\":\"object\",\"name\":\"Row\",\"id\":\"p1103\",\"attributes\":{\"children\":[{\"type\":\"object\",\"name\":\"Button\",\"id\":\"p1099\",\"attributes\":{\"js_event_callbacks\":{\"type\":\"map\",\"entries\":[[\"button_click\",[{\"type\":\"object\",\"name\":\"CustomJS\",\"id\":\"p1101\",\"attributes\":{\"args\":{\"type\":\"map\",\"entries\":[[\"source\",{\"id\":\"p1048\"}],[\"div\",{\"id\":\"p1095\"}],[\"name_select\",{\"id\":\"p1096\"}],[\"maxHeight\",200]]},\"code\":\"\\n let selected_index = source.selected.indices[0];\\n if (selected_index !== undefined) {\\n // Get the current name's index\\n const current_name = source.data.names[selected_index];\\n const current_index = source.data.names.indexOf(current_name);\\n\\n // Get the previous index\\n const prev_index = (current_index - 1 + source.data.names.length) % source.data.names.length;\\n const prev_name = source.data.names[prev_index];\\n const prev_img_url = source.data.images[prev_index];\\n const prev_x = source.data.x[prev_index];\\n const prev_y = source.data.y[prev_index];\\n\\n if (prev_img_url) {\\n // Update image and x, y values\\n div.text = `
X: ${prev_x}
Y: ${prev_y}
`;\\n } else {\\n div.text = `
No image available
X: ${prev_x}
Y: ${prev_y}
`;\\n }\\n name_select.value = prev_name;\\n\\n // Sync selection with plot\\n source.selected.indices = [prev_index];\\n }\\n \"}}]]]},\"width\":150,\"label\":\"Previous Image\"}},{\"type\":\"object\",\"name\":\"Button\",\"id\":\"p1100\",\"attributes\":{\"js_event_callbacks\":{\"type\":\"map\",\"entries\":[[\"button_click\",[{\"type\":\"object\",\"name\":\"CustomJS\",\"id\":\"p1102\",\"attributes\":{\"args\":{\"type\":\"map\",\"entries\":[[\"source\",{\"id\":\"p1048\"}],[\"div\",{\"id\":\"p1095\"}],[\"name_select\",{\"id\":\"p1096\"}],[\"maxHeight\",200]]},\"code\":\"\\n let selected_index = source.selected.indices[0];\\n if (selected_index !== undefined) {\\n // Get the current name's index\\n const current_name = source.data.names[selected_index];\\n const current_index = source.data.names.indexOf(current_name);\\n\\n // Get the next index\\n const next_index = (current_index + 1) % source.data.names.length;\\n const next_name = source.data.names[next_index];\\n const next_img_url = source.data.images[next_index];\\n const next_x = source.data.x[next_index];\\n const next_y = source.data.y[next_index];\\n\\n if (next_img_url) {\\n // Update image and x, y values\\n div.text = `
X: ${next_x}
Y: ${next_y}
`;\\n } else {\\n div.text = `
No image available
X: ${next_x}
Y: ${next_y}
`;\\n }\\n name_select.value = next_name;\\n\\n // Sync selection with plot\\n source.selected.indices = [next_index];\\n }\\n \"}}]]]},\"width\":150,\"label\":\"Next Image\"}}]}}]}}]}}]}};\n const render_items = [{\"docid\":\"e90cf54a-a422-45db-a109-91d30313a099\",\"roots\":{\"p1105\":\"bf862279-b2ad-4bd9-8099-bb6fd43d9e7e\"},\"root_ids\":[\"p1105\"]}];\n void root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n }\n if (root.Bokeh !== undefined) {\n embed_document(root);\n } else {\n let attempts = 0;\n const timer = setInterval(function(root) {\n if (root.Bokeh !== undefined) {\n clearInterval(timer);\n embed_document(root);\n } else {\n attempts++;\n if (attempts > 100) {\n clearInterval(timer);\n console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n }\n }\n }, 10, root)\n }\n})(window);", + "application/javascript": "(function(root) {\n function embed_document(root) {\n const docs_json = {\"97129386-3fb0-45d1-ab0a-c2d7d2d90168\":{\"version\":\"3.6.0\",\"title\":\"Bokeh Application\",\"roots\":[{\"type\":\"object\",\"name\":\"Row\",\"id\":\"p1105\",\"attributes\":{\"children\":[{\"type\":\"object\",\"name\":\"Figure\",\"id\":\"p1051\",\"attributes\":{\"height\":400,\"x_range\":{\"type\":\"object\",\"name\":\"DataRange1d\",\"id\":\"p1052\"},\"y_range\":{\"type\":\"object\",\"name\":\"DataRange1d\",\"id\":\"p1053\"},\"x_scale\":{\"type\":\"object\",\"name\":\"LinearScale\",\"id\":\"p1061\"},\"y_scale\":{\"type\":\"object\",\"name\":\"LinearScale\",\"id\":\"p1062\"},\"title\":{\"type\":\"object\",\"name\":\"Title\",\"id\":\"p1054\",\"attributes\":{\"text\":\"Interactive Scatter Plot\"}},\"renderers\":[{\"type\":\"object\",\"name\":\"GlyphRenderer\",\"id\":\"p1091\",\"attributes\":{\"data_source\":{\"type\":\"object\",\"name\":\"ColumnDataSource\",\"id\":\"p1048\",\"attributes\":{\"selected\":{\"type\":\"object\",\"name\":\"Selection\",\"id\":\"p1049\",\"attributes\":{\"js_property_callbacks\":{\"type\":\"map\",\"entries\":[[\"change:indices\",[{\"type\":\"object\",\"name\":\"CustomJS\",\"id\":\"p1100\",\"attributes\":{\"args\":{\"type\":\"map\",\"entries\":[[\"source\",{\"id\":\"p1048\"}],[\"div\",{\"type\":\"object\",\"name\":\"Div\",\"id\":\"p1095\",\"attributes\":{\"width\":600,\"height\":320,\"text\":\"Click on a point to display the image here.\"}}],[\"name_select\",{\"type\":\"object\",\"name\":\"Select\",\"id\":\"p1096\",\"attributes\":{\"js_property_callbacks\":{\"type\":\"map\",\"entries\":[[\"change:value\",[{\"type\":\"object\",\"name\":\"CustomJS\",\"id\":\"p1099\",\"attributes\":{\"args\":{\"type\":\"map\",\"entries\":[[\"source\",{\"id\":\"p1048\"}],[\"div\",{\"id\":\"p1095\"}],[\"name_select\",{\"id\":\"p1096\"}],[\"maxHeight\",280]]},\"code\":\"\\n const name_value = name_select.value;\\n const indices = source.data.names.map((name, i) => (name === name_value) ? i : -1).filter(i => i >= 0);\\n\\n if (indices.length > 0) {\\n const selected = indices[0];\\n const img_url = source.data.images[selected];\\n const x_value = source.data.x[selected];\\n const y_value = source.data.y[selected];\\n\\n if (img_url) {\\n div.text = `
X: ${x_value}
Y: ${y_value}
`;\\n } else {\\n div.text = `
No image available
X: ${x_value}
Y: ${y_value}
`;\\n }\\n\\n // Highlight the selected point on the scatter plot\\n source.selected.indices = [selected];\\n } else {\\n div.text = \\\"No matching point found.\\\";\\n source.selected.indices = []; // Clear selection if no match\\n }\\n \"}}]]]},\"title\":\"Select Data Point\",\"options\":[\"Select Data\",\"Point A\",\"Point B\",\"Point C\"],\"value\":\"Select Data\"}}],[\"maxHeight\",280]]},\"code\":\"\\n const selected = source.selected.indices[0];\\n if (selected != null) {\\n const name_value = source.data.names[selected];\\n const img_url = source.data.images[selected];\\n const x_value = source.data.x[selected];\\n const y_value = source.data.y[selected];\\n\\n // Update dropdown\\n name_select.value = name_value;\\n\\n if (img_url) {\\n // Display the image\\n div.text = `
X: ${x_value}
Y: ${y_value}
`;\\n } else {\\n // No image available\\n div.text = `
No image available
X: ${x_value}
Y: ${y_value}
`;\\n }\\n }\\n \"}}]]]},\"indices\":[],\"line_indices\":[]}},\"selection_policy\":{\"type\":\"object\",\"name\":\"UnionRenderers\",\"id\":\"p1050\"},\"data\":{\"type\":\"map\",\"entries\":[[\"x\",[1,2,3]],[\"y\",[6,7,2]],[\"names\",[\"Point A\",\"Point B\",\"Point C\"]],[\"images\",[\"images/image1.jpg\",null,\"images/image3.jpg\"]]]}}},\"view\":{\"type\":\"object\",\"name\":\"CDSView\",\"id\":\"p1092\",\"attributes\":{\"filter\":{\"type\":\"object\",\"name\":\"AllIndices\",\"id\":\"p1093\"}}},\"glyph\":{\"type\":\"object\",\"name\":\"Scatter\",\"id\":\"p1088\",\"attributes\":{\"x\":{\"type\":\"field\",\"field\":\"x\"},\"y\":{\"type\":\"field\",\"field\":\"y\"},\"size\":{\"type\":\"value\",\"value\":10},\"line_color\":{\"type\":\"value\",\"value\":\"#1f77b4\"},\"fill_color\":{\"type\":\"value\",\"value\":\"#1f77b4\"}}},\"nonselection_glyph\":{\"type\":\"object\",\"name\":\"Scatter\",\"id\":\"p1089\",\"attributes\":{\"x\":{\"type\":\"field\",\"field\":\"x\"},\"y\":{\"type\":\"field\",\"field\":\"y\"},\"size\":{\"type\":\"value\",\"value\":10},\"line_color\":{\"type\":\"value\",\"value\":\"#1f77b4\"},\"line_alpha\":{\"type\":\"value\",\"value\":0.1},\"fill_color\":{\"type\":\"value\",\"value\":\"#1f77b4\"},\"fill_alpha\":{\"type\":\"value\",\"value\":0.1},\"hatch_alpha\":{\"type\":\"value\",\"value\":0.1}}},\"muted_glyph\":{\"type\":\"object\",\"name\":\"Scatter\",\"id\":\"p1090\",\"attributes\":{\"x\":{\"type\":\"field\",\"field\":\"x\"},\"y\":{\"type\":\"field\",\"field\":\"y\"},\"size\":{\"type\":\"value\",\"value\":10},\"line_color\":{\"type\":\"value\",\"value\":\"#1f77b4\"},\"line_alpha\":{\"type\":\"value\",\"value\":0.2},\"fill_color\":{\"type\":\"value\",\"value\":\"#1f77b4\"},\"fill_alpha\":{\"type\":\"value\",\"value\":0.2},\"hatch_alpha\":{\"type\":\"value\",\"value\":0.2}}}}}],\"toolbar\":{\"type\":\"object\",\"name\":\"Toolbar\",\"id\":\"p1060\",\"attributes\":{\"tools\":[{\"type\":\"object\",\"name\":\"TapTool\",\"id\":\"p1073\",\"attributes\":{\"renderers\":\"auto\"}},{\"type\":\"object\",\"name\":\"PanTool\",\"id\":\"p1074\"},{\"type\":\"object\",\"name\":\"WheelZoomTool\",\"id\":\"p1075\",\"attributes\":{\"renderers\":\"auto\"}},{\"type\":\"object\",\"name\":\"BoxZoomTool\",\"id\":\"p1076\",\"attributes\":{\"overlay\":{\"type\":\"object\",\"name\":\"BoxAnnotation\",\"id\":\"p1077\",\"attributes\":{\"syncable\":false,\"line_color\":\"black\",\"line_alpha\":1.0,\"line_width\":2,\"line_dash\":[4,4],\"fill_color\":\"lightgrey\",\"fill_alpha\":0.5,\"level\":\"overlay\",\"visible\":false,\"left\":{\"type\":\"number\",\"value\":\"nan\"},\"right\":{\"type\":\"number\",\"value\":\"nan\"},\"top\":{\"type\":\"number\",\"value\":\"nan\"},\"bottom\":{\"type\":\"number\",\"value\":\"nan\"},\"left_units\":\"canvas\",\"right_units\":\"canvas\",\"top_units\":\"canvas\",\"bottom_units\":\"canvas\",\"handles\":{\"type\":\"object\",\"name\":\"BoxInteractionHandles\",\"id\":\"p1083\",\"attributes\":{\"all\":{\"type\":\"object\",\"name\":\"AreaVisuals\",\"id\":\"p1082\",\"attributes\":{\"fill_color\":\"white\",\"hover_fill_color\":\"lightgray\"}}}}}}}},{\"type\":\"object\",\"name\":\"ResetTool\",\"id\":\"p1084\"},{\"type\":\"object\",\"name\":\"HoverTool\",\"id\":\"p1094\",\"attributes\":{\"renderers\":[{\"id\":\"p1091\"}],\"tooltips\":\"\\n
\\n \\\"\\\"\\n
Name: @names
\\n
X: @x
\\n
Y: @y
\\n
\\n \"}}]}},\"left\":[{\"type\":\"object\",\"name\":\"LinearAxis\",\"id\":\"p1068\",\"attributes\":{\"ticker\":{\"type\":\"object\",\"name\":\"BasicTicker\",\"id\":\"p1069\",\"attributes\":{\"mantissas\":[1,2,5]}},\"formatter\":{\"type\":\"object\",\"name\":\"BasicTickFormatter\",\"id\":\"p1070\"},\"major_label_policy\":{\"type\":\"object\",\"name\":\"AllLabels\",\"id\":\"p1071\"}}}],\"below\":[{\"type\":\"object\",\"name\":\"LinearAxis\",\"id\":\"p1063\",\"attributes\":{\"ticker\":{\"type\":\"object\",\"name\":\"BasicTicker\",\"id\":\"p1064\",\"attributes\":{\"mantissas\":[1,2,5]}},\"formatter\":{\"type\":\"object\",\"name\":\"BasicTickFormatter\",\"id\":\"p1065\"},\"major_label_policy\":{\"type\":\"object\",\"name\":\"AllLabels\",\"id\":\"p1066\"}}}],\"center\":[{\"type\":\"object\",\"name\":\"Grid\",\"id\":\"p1067\",\"attributes\":{\"axis\":{\"id\":\"p1063\"}}},{\"type\":\"object\",\"name\":\"Grid\",\"id\":\"p1072\",\"attributes\":{\"dimension\":1,\"axis\":{\"id\":\"p1068\"}}}]}},{\"type\":\"object\",\"name\":\"Column\",\"id\":\"p1104\",\"attributes\":{\"children\":[{\"id\":\"p1096\"},{\"id\":\"p1095\"},{\"type\":\"object\",\"name\":\"Row\",\"id\":\"p1103\",\"attributes\":{\"children\":[{\"type\":\"object\",\"name\":\"Button\",\"id\":\"p1097\",\"attributes\":{\"js_event_callbacks\":{\"type\":\"map\",\"entries\":[[\"button_click\",[{\"type\":\"object\",\"name\":\"CustomJS\",\"id\":\"p1101\",\"attributes\":{\"args\":{\"type\":\"map\",\"entries\":[[\"source\",{\"id\":\"p1048\"}],[\"div\",{\"id\":\"p1095\"}],[\"name_select\",{\"id\":\"p1096\"}],[\"maxHeight\",280]]},\"code\":\"\\n let selected_index = source.selected.indices[0];\\n if (selected_index !== undefined) {\\n // Get the current name's index\\n const current_name = source.data.names[selected_index];\\n const current_index = source.data.names.indexOf(current_name);\\n\\n // Get the previous index\\n const prev_index = (current_index - 1 + source.data.names.length) % source.data.names.length;\\n const prev_name = source.data.names[prev_index];\\n const prev_img_url = source.data.images[prev_index];\\n const prev_x = source.data.x[prev_index];\\n const prev_y = source.data.y[prev_index];\\n\\n if (prev_img_url) {\\n // Update image and x, y values\\n div.text = `
X: ${prev_x}
Y: ${prev_y}
`;\\n } else {\\n div.text = `
No image available
X: ${prev_x}
Y: ${prev_y}
`;\\n }\\n name_select.value = prev_name;\\n\\n // Sync selection with plot\\n source.selected.indices = [prev_index];\\n }\\n \"}}]]]},\"width\":150,\"label\":\"Previous Image\"}},{\"type\":\"object\",\"name\":\"Button\",\"id\":\"p1098\",\"attributes\":{\"js_event_callbacks\":{\"type\":\"map\",\"entries\":[[\"button_click\",[{\"type\":\"object\",\"name\":\"CustomJS\",\"id\":\"p1102\",\"attributes\":{\"args\":{\"type\":\"map\",\"entries\":[[\"source\",{\"id\":\"p1048\"}],[\"div\",{\"id\":\"p1095\"}],[\"name_select\",{\"id\":\"p1096\"}],[\"maxHeight\",280]]},\"code\":\"\\n let selected_index = source.selected.indices[0];\\n if (selected_index !== undefined) {\\n // Get the current name's index\\n const current_name = source.data.names[selected_index];\\n const current_index = source.data.names.indexOf(current_name);\\n\\n // Get the next index\\n const next_index = (current_index + 1) % source.data.names.length;\\n const next_name = source.data.names[next_index];\\n const next_img_url = source.data.images[next_index];\\n const next_x = source.data.x[next_index];\\n const next_y = source.data.y[next_index];\\n\\n if (next_img_url) {\\n // Update image and x, y values\\n div.text = `
X: ${next_x}
Y: ${next_y}
`;\\n } else {\\n div.text = `
No image available
X: ${next_x}
Y: ${next_y}
`;\\n }\\n name_select.value = next_name;\\n\\n // Sync selection with plot\\n source.selected.indices = [next_index];\\n }\\n \"}}]]]},\"width\":150,\"label\":\"Next Image\"}}]}}]}}]}}]}};\n const render_items = [{\"docid\":\"97129386-3fb0-45d1-ab0a-c2d7d2d90168\",\"roots\":{\"p1105\":\"ef690741-1246-411e-9e80-ed95878bf57b\"},\"root_ids\":[\"p1105\"]}];\n void root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n }\n if (root.Bokeh !== undefined) {\n embed_document(root);\n } else {\n let attempts = 0;\n const timer = setInterval(function(root) {\n if (root.Bokeh !== undefined) {\n clearInterval(timer);\n embed_document(root);\n } else {\n attempts++;\n if (attempts > 100) {\n clearInterval(timer);\n console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n }\n }\n }, 10, root)\n }\n})(window);", "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { From 278deb8b3e4a53f60632b3ac7ccab694d2bb7939 Mon Sep 17 00:00:00 2001 From: Jiwoo Lee Date: Tue, 19 Nov 2024 17:18:31 -0800 Subject: [PATCH 2/2] initial commit --- tests/test_core_scatter_plot.py | 58 +++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 tests/test_core_scatter_plot.py diff --git a/tests/test_core_scatter_plot.py b/tests/test_core_scatter_plot.py new file mode 100644 index 0000000..31ef8ae --- /dev/null +++ b/tests/test_core_scatter_plot.py @@ -0,0 +1,58 @@ +import unittest + +from bokeh.models import ColumnDataSource +from bokeh.plotting import figure + +from ESMBenchmarkViz.core_scatter_plot import scatter_plot + + +class TestScatterPlot(unittest.TestCase): + def setUp(self): + self.x = [1, 2, 3] + self.y = [6, 7, 2] + self.names = ["Point A", "Point B", "Point C"] + self.images = [ + "images/image1.jpg", + None, + "images/image3.jpg", + ] + + def test_scatter_plot_no_images(self): + plot = scatter_plot(self.x, self.y, self.names, images=None, show_plot=False) + self.assertIsInstance(plot, figure) + self.assertEqual(len(plot.renderers), 1) + self.assertEqual(plot.title.text, "Interactive Scatter Plot") + + def test_scatter_plot_with_images(self): + layout = scatter_plot( + self.x, self.y, self.names, images=self.images, show_plot=False + ) + self.assertEqual(len(layout.children), 2) + plot = layout.children[0] + controls = layout.children[1] + self.assertIsInstance(plot, figure) + self.assertEqual(len(plot.renderers), 1) + self.assertEqual(plot.title.text, "Interactive Scatter Plot") + self.assertEqual(len(controls.children), 3) + + def test_data_source(self): + plot = scatter_plot(self.x, self.y, self.names, images=None, show_plot=False) + source = plot.renderers[0].data_source + self.assertIsInstance(source, ColumnDataSource) + self.assertEqual(len(source.data["x"]), 3) + self.assertEqual(len(source.data["y"]), 3) + self.assertEqual(len(source.data["names"]), 3) + + def test_invalid_input_length(self): + with self.assertRaises(ValueError): + scatter_plot(self.x, self.y, self.names[:2], images=None, show_plot=False) + + def test_invalid_image_length(self): + with self.assertRaises(ValueError): + scatter_plot( + self.x, self.y, self.names, images=self.images[:2], show_plot=False + ) + + +if __name__ == "__main__": + unittest.main()