biocircuits.interactive_xy_plot

biocircuits.interactive_xy_plot(base_plot, callback, slider_params=(), toggle_params=(), extra_args=())

Create an interactive x-y plot in Bokeh. DEPRECATED.

Parameters
  • base_plot (function) –

    A function to generate the initial plot that will be interactive. It must have call signature base_plot(callback, sliders, toggles, extra_args)), with the following arguments.

    callback: A function to update the data source of the plot,

    described as the callback argument below.

    sliders: A tuple of bokeh.models.Slider objects.

    Alternatively, can be any object reference-able like sliders[0].start, sliders[0].value, etc.

    toggles: A tuple of bokeh.models.Toggle objects.

    Alternatively, can be any object reference-able like toggles[0].active.

    extra_args: Tuple of any extra arguments that are passed to

    the callback function.

    The base_plot function must return a Bokeh Figure instance and a Bokeh ColumnDataSource.

  • callback (function) –

    A function that is executed to update the ColumnDataSource of the interactive plot whenever a slider or toggle are updated. It must have a call signature `callback(source, x_range, y_range, sliders, toggles,

    *extra_args)`.

    Here, source is a ColumnDataSource, x_range is the x_range of the plot, and y_range is the y_range for the plot. sliders, toggles, and extra_args are as defined above.

  • slider_params (tuple of objects, default empty tuple) –

    Each object in the tuple is an instance of a class that has the following attributes.

    title : The name of the slider. start : The smallest value of the slider. end : The largest value of the slider. value : The starting value of the slider. step : The step size of the slider as it is moved.

  • toggle_params (tuple of objects, default empty tuple) –

    Each object in the tuple is an instance of a class that has the following attributes.

    title : The name of the toggle. active : A Boolean saying whether the toggle is active.

  • extra_args (tuple, default empty tuple) – Tuple of any extra arguments that are passed to the callback function.

Returns

output – A Bokeh application with sliders, toggles, and a plot.

Return type

Bokeh application