Interactions
Bokeh provides a variety of mechanisms to enable you to interact with plots and data visualization environments in different ways. We briefly summarize some of those here, and demonstrate additional examples throughout the rest of this roadmap.
Plot tools
Tools enable you to interact with plots in various ways, such as zooming and selecting subsets of data, clicking and tapping on a plot to generate information, and hovering over data glyphs to see additional information. Tools are generally grouped into sets of related functionality or interaction modality — some examples are included here:
- Pan / Drag Tools : Pan, BoxSelect, BoxZoom, LassoSelect
- Click / Tip Tools : Tap (and DoubleTap), PolySelect
- Scroll / Pinch Tools : WheelZoom, Wheel Pan
- Actions : Save, Reset, Undo, Redo, etc.
- Inspectors : Crosshair, Hover
- Edit Tools : BoxEdit, FreehandDraw, PointDraw, PolyDraw, etc.
Linked behavior
In situations where you have mutliple plots, it is possible to add linked interactions between plots, such as linked x- and y-ranges, or linked highlighting when selecting data using one of the plot tools.
Widgets
Bokeh comes with a large set of widgets — such as buttons, sliders, checkboxes, data tables, text input boxes, etc. — that can support a variety of interactions with data, to accomplish tasks such as updating plots, loading new data, and changing parameter values. Widgets are typically tied to callback functions that are triggered when the widget is interacted with.
Callbacks in Python and JavaScript
In Bokeh Server applications, callback functions written in Python can be used to modify a plot or trigger specific computations in response to some user interaction or input. Bokeh also enables CustomJS callbacks written in JavaScript, which can support certain types of user interaction in non-server based applications, or to provide low-level control that might not be possible within a Python callback.
Interactive legends
Legends on plots can be configured to enable you to hide or mute particular elements of a plot.
Tooltips
Bokeh lets you use tooltips to add additional information to user interface elements in your data visualization.