Client-side interactivity.
Callback
Bases: bokeh.model.Model
bokeh.model.Model
Base class for interactive callback.
Note
This is an abstract base class used to help organize the hierarchy of Bokeh model types. It is not useful to instantiate on its own.
{ "id": "9781", "js_event_callbacks": {}, "js_property_callbacks": {}, "name": null, "subscribed_events": [], "tags": [] }
OpenURL
Bases: bokeh.models.callbacks.Callback
bokeh.models.callbacks.Callback
Open a URL in a new or current tab or window.
same_tab
property type: Bool
Bool
Open URL in a new (False, default) or current (True) tab or window. For same_tab=False, whether tab or window will be opened is browser dependent.
url
property type: String
String
The URL to direct the web browser to. This can be a template string, which will be formatted with data from the data source.
{ "id": "9782", "js_event_callbacks": {}, "js_property_callbacks": {}, "name": null, "same_tab": false, "subscribed_events": [], "tags": [], "url": "http://" }
CustomJS
Execute a JavaScript function.
Warning
The explicit purpose of this Bokeh Model is to embed raw JavaScript code for a browser to execute. If any part of the code is derived from untrusted user inputs, then you must take appropriate care to sanitize the user input prior to passing to Bokeh.
args
property type: Dict ( String , AnyRef )
Dict
AnyRef
A mapping of names to Python objects. In particular those can be bokeh’s models. These objects are made available to the callback’s code snippet as the values of named parameters to the callback.
code
A snippet of JavaScript code to execute in the browser. The code is made into the body of a function, and all of of the named objects in args are available as parameters that the code can use. Additionally, a cb_obj parameter contains the object that triggered the callback and an optional cb_data parameter that contains any tool-specific data (i.e. mouse coordinates and hovered glyph indices for the HoverTool).
cb_obj
cb_data
HoverTool
Use CustomJS.from_coffeescript() for CoffeeScript source code.
CustomJS.from_coffeescript()
use_strict
Enables or disables automatic insertion of "use strict"; into code.
"use strict";
from_coffeescript
Create a CustomJS instance from CoffeeScript code.
from_py_func
Create a CustomJS instance from a Python function. The function is translated to JavaScript using PScript.
{ "args": {}, "code": "", "id": "9785", "js_event_callbacks": {}, "js_property_callbacks": {}, "name": null, "subscribed_events": [], "tags": [], "use_strict": false }