HoverToolTip persist bokeh

Considering the following example from bokeh, how can I make the hover toolbox persist after double clicking on the corresponding circle? I want to be able to visualize hovertool tips over multiple circles at same time. Also double-clicking again should make the persisting hovertool box vanish.

from bokeh.plotting import ColumnDataSource, figure, output_file, show


source = ColumnDataSource(data=dict(
    x=[1, 2, 3, 4, 5],
    y=[2, 5, 8, 2, 7],
    desc=['A', 'b', 'C', 'd', 'E'],

                src="@imgs" height="42" alt="@imgs" width="42"
                style="float: left; margin: 0px 15px 15px 0px;"
            <span style="font-size: 17px; font-weight: bold;">@desc</span>
            <span style="font-size: 15px; color: #966;">[$index]</span>
            <span style="font-size: 15px;">Location</span>
            <span style="font-size: 10px; color: #696;">($x, $y)</span>

p = figure(plot_width=400, plot_height=400, tooltips=TOOLTIPS,
           title="Mouse over the dots")

p.circle('x', 'y', size=20, source=source)


“Sticky” tooltips have not yet been implemented:

Feature Request: HoverTool tooltips stick to a point on click. · Issue #5724 · bokeh/bokeh · GitHub

1 Like