Back to Browse

Bokeh: Tool Customization

1.7K views
May 16, 2021
9:27

Customizing available tools You can customize which tools Bokeh displays in the toolbar. To customize which tools to use, you first need to import the relevant tools. Next, define which tools to use when creating a new figure by passing the tools attribute to the figure() function. The tools attribute accepts a list of tools. Tooltips are little windows that appear when you hover your mouse over a data point or when you tap on a data point. Tooltips are based on the HoverTool. The hover tool is part of Bokeh’s toolbar. There are several ways to enable tooltips in Bokeh. This is the quickest: Import the HoverTool class from bokeh.models.tools. Include HoverTool() in the list passed to the tools argument when calling the figure() function. Include the tooltips argument when calling the figure() function. The tooltips argument accepts a string with a special syntax. Use the “@” symbol to include the name of the source for the data you want Bokeh to display. This example includes @x and @y. When the browser displays a tooltip, Bokeh replaces both those fields with the actual data from the lists x and y .

Download

0 formats

No download links available.

Bokeh: Tool Customization | NatokHD