How to change images shown with hovertool, with the addition of a slider

Hello there,

I was wondering if it is possible to modify the following example, so as to add a slider providing us with the potential to change the images shown when hovering

over the circles. I can use a callback to read the slider’s values but the html part of the hover is not adjusted to the changes.

Any ideas?


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

from bokeh.models import HoverTool


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

hover = HoverTool( tooltips="""
                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, tools=[hover],
           title="Mouse over the dots")'x', 'y', size=20, source=source)