I can’t seem to attach a custom js_on_event callback to a BoxAnnotation model. Is that not possible in principle? The docs describe it as if callbacks can be attached to any model and js_event_callbacks is listed among BoxAnnotation class properties.
A minimal example would be something like:
from bokeh.io import show
from bokeh.models import CustomJS, BoxAnnotation
from bokeh.plotting import figure
p = figure(plot_width=400, plot_height=250)
callback = CustomJS(code="""
console.log(cb_obj);
""")
box = BoxAnnotation(top_units="screen", bottom_units="screen", left_units="screen", right_units="screen",
top=80, bottom=100, left=10, right=30, fill_alpha=1, fill_color='red')
box.js_on_event("tap", callback)
p.add_layout(box)
show(p)


