Is the "Reset" event supposed to work?

OS: WSL
Python: 3.7
Bokeh: 2.3.2

I’m trying to attach a callback to a ResetTool.
This is what I’ve tried to do:

from bokeh.events import Reset
from bokeh.io.doc import curdoc
from bokeh.models.callbacks import CustomJS
from bokeh.models.tools import ResetTool
from bokeh.plotting.figure import figure


def on_reset(event):
    print("clicked")


rt = ResetTool()
rt.on_event(Reset, on_reset)
rt.js_on_event(Reset, CustomJS(code="console.log('clicked')"))
plot = figure(tools=[rt])
plot.line(x=[1, 2, 3], y=[2, 4, 6])

curdoc().add_root(plot)

Am I missing something?

The event is on the plot, not the tool:

rt = ResetTool()
plot = figure(tools=[rt])
plot.js_on_event(Reset, CustomJS(code="console.log('clicked')"))
plot.on_event(Reset, on_reset)
plot.line(x=[1, 2, 3], y=[2, 4, 6])
1 Like

@Bryan Awesome…Thanks!