-
-
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 box zoom out tool #3126
Comments
Hi @liuyxpp, I don't think I've ever seen a box zoom out tool. What would you select (with the box) to zoom out? Do you actually just mean zoom in and out buttons? e.g. http://leafletjs.com/examples/quick-start.html |
I've just seen @bryevdv's comment on the mailing list
I actually don't get this - can someone point me to an example? |
@birdsarah You can think of the box zoom in & out tool as a generalization of the zoom in & out button in the example you given. That is, the box zoom in & out tool allows user to select the zooming center while the zoom in & out button uses the view center as the default zooming center. For box zoom in tool, it is natural to have a zooming range (which is the box) as Bokeh currently provides. For box zoom out tool, there mainly have two choices. We can fix the zoom out ratio to some certain comfortable value (maybe 5/4?). In this way, the box zoom out tool will mimic the behavior of the zoom out button but with a user designated zooming center. Therefore, we can differentiate the zoom out tool from the zoom in tool by not drawing the dash line box. The user will select the zoom out tool and click one point in the plot and the plot will zoom out with a new view center which is the user clicked point. Or we can further utilize the box range and set the zooming ratio to be the current view range over the user selected range. But I don't think this way is natural for everyone. I think implementation of the first choice should be good enough. |
Can you point me to an example? |
@birdsarah it was used extensively in a place I used to work but there is nothing public I can point to. It's actually eminently reasonable, though. It lets you use a box in a way that permits both zoom out, and also lets you specify the center (which is probably what you care about anyway). |
I still don't understand exactly the mechanics. And I can't be against something that I can't imagine. I would like to argue that +/- buttons would be a superb feature addition that, to my understanding, achieves the same result (the center of your zoom out is the center of your plot) I say superb because they are very familiar interaction, as @liuyxpp said standard in image previews, maps, pdf reader, the list goes on. |
In the current tool the drag start/end define two opposite corners of a box. In this other mode the drag start end define the center and a corner of a box. So the maximum box size if you drag form one corner to the opposite corner of the plot, is four times bigger than the plot region.
|
I'm not against +/- buttons too but the centered ® box can certainly be used more efficiently and precisely than panning the thing you want to the center of the plot are and clicking a bunch of times. You just click the thing to want to zoom on and drag away from it, and then you zoom right on the spot you clicked.
|
This is the way that matplotlib works, at least when using the qt toolbar. The smaller the selected region the larger the zoom out, they use a right drag, but I think it makes sense to implement it as Shift+box_zoom. Matplotlib also give a way to scales axis which could be added as Shift+pan. http://matplotlib.org/2.0.0rc1/users/navigation_toolbar.html?highlight=navigation The way the math works is that it zooms out to the point that the old axis bound fit within the selection rectangle. |
I still want to make a box-centered mode for the zoom tool. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
It is a common practice to have both zoom in and zoom out tools in various visualization applications, such as image preview, map, and PDF readers. However, current Bokeh (0.10.0) does not provide a box zoom out tool, which is sometimes inconvenient to users. It would be better to have this tool available.
The text was updated successfully, but these errors were encountered: