-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add support for click-style pan tools #14033
Conversation
e87ed00
to
a6dc34a
Compare
cc @bokeh/dev thoughts on the arrow sense? I understand why they are why they are but it was contrary to my expectations. I.e. in order to "pan left" you have to "drag right" and I expected the buttons to indicate the "drag" direction, not "pan" direction. |
Yes, it was a bit counter-intuitive to me. |
This behavior is consistent with arrow key function in google maps, leaflet and other. Left arrow reveals more of what's on the left of the plot. Pan gesture that achieves the same function is drag to the right. Perhaps it would have been more clear if I used a map based example, e.g.: Screencast.from.21.08.2024.21.55.04.webm |
a6dc34a
to
5242ed1
Compare
Well that's actually interesting, I would expect the behavior exactly as shown WASD or arrow keys. I think the difference for me comes down to mouse vs. keyboard, where using the mouse to click the arrows just really suggests the operation is analogous to a drag, also with the mouse. i.e. click a right arrow with a mouse ~ move to the right with a mouse (i.e. "pan left") I won't hold up the PR but I would like to know if the eventual plan is that keyboard navigation will work without having the toolbar icons present at all? Frankly, adding four icons to the toolbar is "alot", especially if there are even a few other usual tools present. I can't actually imagine that users will truly want these cluttering the toolbar in most cases. |
The next step will be to add keyboard support, but that's quite a bit of work because we have to add focus management for plots (so that arrow keys only work when plots are in focus) and coordinate key handling with other tools. I don't expect users to add all four buttons a toolbar like in the examples. I would expect they would use buttons like that when their plots pan only in one direction (equivalent to e.g. |
This PR adds rudimentary support for left, right, up and down pan tools (also with NSWE aliases), implemented as a single
ClickPanTool
. For now no keyboard support was added, because we don't have any implementation for action tools. It would be convenient to arrange respective tool buttons in a group, but that will have to wait for PR #13571. I'm tentatively marking this as a part of CZI R6, but this will be more relevant when we will start working on keyboard support.Screencast.from.20.08.2024.16.02.45.webm
Code