Hello,
I am using a Bokeh 3.4.3 server and I am running into an issue where the active_scroll property is not updated when the WheelZoom tool is toggled. Is this a known issue? If so, are there any workarounds? In my real application, I have multiple figures and I am trying to determine from Python whether a WheelZoom tool is active by checking the active_scroll property, but it is not returning accurate results.
Thanks in advance,
Alex
from bokeh.plotting import figure, curdoc
from bokeh.layouts import column
from bokeh.models import Button
import numpy as np
x = np.linspace(0, 4*np.pi, 100)
y = np.sin(x)
p = figure(
width=600,
height=400,
active_scroll=None
)
p.line(x, y, line_width=2)
p.scatter(x[::5], y[::5], size=8, color=‘red’, alpha=0.6)
def on_active_scroll_change(attr, old, new):
print(f"Active scroll changed!“)
print(f” Old value: {old}“)
print(f” New value: {new}")
p.toolbar.on_change(‘active_scroll’, on_active_scroll_change)
def check_state():
print(f"Active scroll: {p.toolbar.active_scroll}")
current_scroll = p.toolbar.active_scroll
check_button = Button(label=“Check Current Active Scroll”, width=200)
check_button.on_click(check_state)
layout = column(
p,
check_button
)
curdoc().add_root(layout)

