Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] RangesUpdate not emitted when using xwheel_pan #11633

Closed
alexbjorling opened this issue Sep 17, 2021 · 3 comments · Fixed by #11634
Closed

[BUG] RangesUpdate not emitted when using xwheel_pan #11633

alexbjorling opened this issue Sep 17, 2021 · 3 comments · Fixed by #11634

Comments

@alexbjorling
Copy link
Contributor

The following code triggers the RangesUpdate event when using all the pan/zoom/reset tools, except for the xwheel_pan and ywheel_pan ones. I suspect this is not the intended behavior.

from bokeh.plotting import figure, curdoc
from bokeh.events import RangesUpdate

p = figure(tools=('xwheel_zoom', 'ywheel_zoom', 'xwheel_pan', 'ywheel_pan',
                  'box_zoom', 'pan', 'reset'))
p.line([1,2], [4,3])
p.on_event(RangesUpdate, lambda evt: print(evt))
curdoc().add_root(p)

This is bokeh 2.4.0, Python 3.9.7, Ubuntu 21.04.

@bryevdv
Copy link
Member

bryevdv commented Sep 17, 2021

I'm sure it needs a call to

this.plot_view.trigger_ranges_update_event()

added. Quite honestly forget these tools exist, I still don't quite understand the point of a wheel pan. Triaging to land on branch-3.0 since there's already several backports to 2.4.1 this can just be included in one batch.

@bryevdv
Copy link
Member

bryevdv commented Sep 17, 2021

@alexbjorling if you are interested to make a stab at a PR, you can see how other tools trigger the update:

https://github.com/bokeh/bokeh/search?q=trigger_ranges_update_event

Things should be very similar inside https://github.com/bokeh/bokeh/blob/branch-3.0/bokehjs/src/lib/models/tools/gestures/wheel_pan_tool.ts

@alexbjorling
Copy link
Contributor Author

Oh, for what I'm writing now the wheel pan is perfect. I have a waterfall 2d plot showing vibrational spectra over time. You pan the time axis, and this event causes data from the new time range to be read from the database and shown.

Put in PR #11634, hope it's OK!

@bryevdv bryevdv modified the milestones: 3.0, 2.4.1 Sep 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants