holoviews.plotting.bokeh.callbacks module#

class holoviews.plotting.bokeh.callbacks.BoundsCallback(plot, streams, source, **params)[source]#

Bases: PopupMixin, Callback

Returns the bounds of a box_select tool.

class holoviews.plotting.bokeh.callbacks.BoundsXCallback(plot, streams, source, **params)[source]#

Bases: Callback

Returns the bounds of a xbox_select tool.

class holoviews.plotting.bokeh.callbacks.BoundsYCallback(plot, streams, source, **params)[source]#

Bases: Callback

Returns the bounds of a ybox_select tool.

class holoviews.plotting.bokeh.callbacks.BoxEditCallback(plot, streams, source, **params)[source]#

Bases: GlyphDrawCallback

class holoviews.plotting.bokeh.callbacks.CDSCallback(plot, streams, source, **params)[source]#

Bases: Callback

A Stream callback that syncs the data on a bokeh ColumnDataSource model with Python.

class holoviews.plotting.bokeh.callbacks.Callback(plot, streams, source, **params)[source]#

Bases: object

Provides a baseclass to define callbacks, which return data from bokeh model callbacks, events and attribute changes. The callback then makes this data available to any streams attached to it.

The definition of a callback consists of a number of components:

  • modelsDefines which bokeh models the callback will be

    attached on referencing the model by its key in the plots handles, e.g. this could be the x_range, y_range, plot, a plotting tool or any other bokeh mode.

  • attributesThe attributes define which attributes to send

    back to Python. They are defined as a dictionary mapping between the name under which the variable is made available to Python and the specification of the attribute. The specification should start with the variable name that is to be accessed and the location of the attribute separated by periods. All models defined by the models and can be addressed in this way, e.g. to get the start of the x_range as ‘x’ you can supply {‘x’: ‘x_range.attributes.start’}. Additionally certain handles additionally make the cb_obj variables available containing additional information about the event.

  • on_eventsIf the Callback should listen to bokeh events this

    should declare the types of event as a list (optional)

  • on_changesIf the Callback should listen to model attribute

    changes on the defined models (optional)

If either on_events or on_changes are declared the Callback will be registered using the on_event or on_change machinery, otherwise it will be treated as a regular callback on the model. The callback can also define a _process_msg method, which can modify the data sent by the callback before it is passed to the streams.

A callback supports three different throttling modes:

  • adaptive (default): The callback adapts the throttling timeout depending on the rolling mean of the time taken to process each message. The rolling window is controlled by the adaptive_window value.

  • throttle: Uses the fixed throttle_timeout as the minimum amount of time between events.

  • debounce: Processes the message only when no new event has been received within the throttle_timeout duration.

async on_change(attr, old, new)[source]#

Process change events adding timeout to process multiple concerted value change at once rather than firing off multiple plot updates.

async on_event(event)[source]#

Process bokeh UIEvents adding timeout to process multiple concerted value change at once rather than firing off multiple plot updates.

async process_on_event(timeout=None)[source]#

Trigger callback change event and triggering corresponding streams.

classmethod resolve_attr_spec(spec, cb_obj, model=None)[source]#

Resolves a Callback attribute specification looking the corresponding attribute up on the cb_obj, which should be a bokeh model. If not model is supplied cb_obj is assumed to be the same as the model.

set_callback(handle)[source]#

Set up on_change events for bokeh server interactions.

class holoviews.plotting.bokeh.callbacks.CurveEditCallback(plot, streams, source, **params)[source]#

Bases: GlyphDrawCallback

class holoviews.plotting.bokeh.callbacks.DoubleTapCallback(plot, streams, source, **params)[source]#

Bases: TapCallback

Returns the mouse x/y-position on doubletap event.

class holoviews.plotting.bokeh.callbacks.DrawCallback(*args, **kwargs)[source]#

Bases: PointerXYCallback

class holoviews.plotting.bokeh.callbacks.FreehandDrawCallback(plot, streams, source, **params)[source]#

Bases: PolyDrawCallback

class holoviews.plotting.bokeh.callbacks.GlyphDrawCallback(plot, streams, source, **params)[source]#

Bases: CDSCallback

class holoviews.plotting.bokeh.callbacks.LassoCallback(plot, streams, source, **params)[source]#

Bases: PopupMixin, Callback

class holoviews.plotting.bokeh.callbacks.MouseEnterCallback(plot, streams, source, **params)[source]#

Bases: PointerXYCallback

Returns the mouse x/y-position on mouseenter event, i.e. when mouse enters the plot canvas.

class holoviews.plotting.bokeh.callbacks.MouseLeaveCallback(plot, streams, source, **params)[source]#

Bases: PointerXYCallback

Returns the mouse x/y-position on mouseleave event, i.e. when mouse leaves the plot canvas.

class holoviews.plotting.bokeh.callbacks.MultiAxisTapCallback(plot, streams, source, **params)[source]#

Bases: TapCallback

Returns the mouse x/y-positions on tap event.

class holoviews.plotting.bokeh.callbacks.PanEndCallback(plot, streams, source, **params)[source]#

Bases: TapCallback

Returns the mouse x/y-position of a pan end event.

class holoviews.plotting.bokeh.callbacks.PlotSizeCallback(plot, streams, source, **params)[source]#

Bases: Callback

Returns the actual width and height of a plot once the layout solver has executed.

class holoviews.plotting.bokeh.callbacks.PointDrawCallback(plot, streams, source, **params)[source]#

Bases: GlyphDrawCallback

class holoviews.plotting.bokeh.callbacks.PointerXCallback(plot, streams, source, **params)[source]#

Bases: PointerXYCallback

Returns the mouse x-position on mousemove event.

class holoviews.plotting.bokeh.callbacks.PointerXYCallback(plot, streams, source, **params)[source]#

Bases: Callback

Returns the mouse x/y-position on mousemove event.

class holoviews.plotting.bokeh.callbacks.PointerYCallback(plot, streams, source, **params)[source]#

Bases: PointerXYCallback

Returns the mouse x/y-position on mousemove event.

class holoviews.plotting.bokeh.callbacks.PolyDrawCallback(plot, streams, source, **params)[source]#

Bases: GlyphDrawCallback

class holoviews.plotting.bokeh.callbacks.PolyEditCallback(plot, streams, source, **params)[source]#

Bases: PolyDrawCallback

class holoviews.plotting.bokeh.callbacks.PressUpCallback(plot, streams, source, **params)[source]#

Bases: TapCallback

Returns the mouse x/y-position of a pressup mouse event.

class holoviews.plotting.bokeh.callbacks.RangeXCallback(plot, streams, source, **params)[source]#

Bases: RangeXYCallback

Returns the x-axis range of a plot.

class holoviews.plotting.bokeh.callbacks.RangeXYCallback(plot, streams, source, **params)[source]#

Bases: Callback

Returns the x/y-axis ranges of a plot.

class holoviews.plotting.bokeh.callbacks.RangeYCallback(plot, streams, source, **params)[source]#

Bases: RangeXYCallback

Returns the y-axis range of a plot.

class holoviews.plotting.bokeh.callbacks.ResetCallback(plot, streams, source, **params)[source]#

Bases: Callback

Signals the Reset stream if an event has been triggered.

class holoviews.plotting.bokeh.callbacks.SelectModeCallback(plot, streams, source, **params)[source]#

Bases: Callback

class holoviews.plotting.bokeh.callbacks.Selection1DCallback(plot, streams, source, **params)[source]#

Bases: PopupMixin, Callback

Returns the current selection on a ColumnDataSource.

class holoviews.plotting.bokeh.callbacks.SelectionXYCallback(plot, streams, source, **params)[source]#

Bases: BoundsCallback

Converts a bounds selection to numeric or categorical x-range and y-range selections.

class holoviews.plotting.bokeh.callbacks.SingleTapCallback(plot, streams, source, **params)[source]#

Bases: TapCallback

Returns the mouse x/y-position on tap event.

class holoviews.plotting.bokeh.callbacks.TapCallback(plot, streams, source, **params)[source]#

Bases: PopupMixin, PointerXYCallback

Returns the mouse x/y-position on tap event.