I would like to change the visible range of the y-axis each time when the x-axis range changes. But something does not seem to work, panning and changing the x-axis range does not seem to invoke the callback or something is wrong with the callback?
x = list(range(100))
y = list(np.random.randint(-10, 10, 100))
y = np.cumsum(y)
p1 = figure(title="Random", width=600, height=600)
p1.line(x, y, color="red")
callback = CustomJS(args=dict(yrange=p1.y_range), code="""
yrange.start=-10;
yrange.end=10;""")
p1.x_range.js_on_change("end", callback)
show(p1)