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

Add zoom button that allows zoom by steps #916

Closed
tswicegood opened this issue Jul 28, 2014 · 1 comment · Fixed by #4841
Closed

Add zoom button that allows zoom by steps #916

tswicegood opened this issue Jul 28, 2014 · 1 comment · Fixed by #4841

Comments

@tswicegood
Copy link
Contributor

This would add a plus and minus button to the tools that zooms in and out at the current center of the plot.

Examples to consider: Google Maps, Leaflet, Mapbox, basically any slippy map. :-)

@damianavila damianavila added this to the long-term milestone Oct 10, 2014
@bryevdv bryevdv modified the milestones: 0.8, long-term Jan 9, 2015
@bryevdv
Copy link
Member

bryevdv commented Jan 9, 2015

This should be quite simple to add on the toolbar, so plan to do that. Perhaps we can get more fancy later with some sort of over-plot thing.

@bryevdv bryevdv modified the milestones: short-term, 0.8 Jan 28, 2015
timsnyder added a commit to timsnyder/bokeh that referenced this issue Jul 20, 2016
Refactors models/tools/gestures/wheel_zoom_tool into
a scale_range() helper provided by models/tools/zoom_util.

scale_range() is then used to add zoom_in_tool and zoom_out_tool
to models/tools/actions, implementing toolbar buttons that will
zoom

Remaining work on bokeh#916 includes:
* actual design done for icons/Zoom{In,Out}.png.  I slapped something
  together for initial concept from the wheel-zoom icon.

* ensure zoom-in and zoom-out are "bundled".  It doesn't make sense
  to have one and not the other.

  Can this be done in helpers.py and plotting.coffee helpers
  or should the object hierarchy have a zoom-buttons layer?

* add 'factor' as a parameter on the zoom buttons.  Currently, it
  is hardcoded to 10%

* review user-guide for documentation needs

* testing. scale_range() should probably have some unit tests and
  I've thought through how to do view testing of the zoom buttons

* possibly rebase this into multiple commits so that git (and github?)
  correctly display the history via praise:
  1. code movement from wheel_zoom_tool to zoom_utils
  2. code reorg and usage of locals to enable sharing with zoom buttons
  3. implement zoom buttons

  I'm not sure how picky you guys are about having clean, easy
  to follow history but I don't mind rebasing this into smaller commits.

Possible work for future (or already existing) tickets:
* Does it make sense to expose zoom-only mode on wheel-zoom? I
  personally find it awkward to use wheel-zoom when it pans and zooms
  at the same time.  This could be implemented easily now by
  programmatically eliding the 'center' parameter to scale_range().
  Perhaps it could be implemented as wheel-zoom button having a dropdown
  radio-button list like tap tool that lets the user
timsnyder added a commit to timsnyder/bokeh that referenced this issue Jul 21, 2016
timsnyder added a commit to timsnyder/bokeh that referenced this issue Aug 13, 2016
The zoom button tools will now take a Percent property named factor to control
how much they zoom in or out per button click
timsnyder added a commit to timsnyder/bokeh that referenced this issue Aug 18, 2016
The zoom button tools will now take a Percent property named factor to control
how much they zoom in or out per button click
timsnyder added a commit to timsnyder/bokeh that referenced this issue Aug 18, 2016
…offee

As a part of bokeh#916 based on feedback from @bryevdv, move scale_range into
toplevel src/coffee/util/zoom.coffee

Also added missing require for wheel_zoom_tool.coffee. I didn't test
wheel zoom for breakage, and/or there isn't a test that caught it.
timsnyder added a commit to timsnyder/bokeh that referenced this issue Aug 18, 2016
bryevdv pushed a commit that referenced this issue Sep 22, 2016
* Refactor wheel_zoom_tool. Add zoom button tools #916

Refactors models/tools/gestures/wheel_zoom_tool into
a scale_range() helper provided by models/tools/zoom_util.

scale_range() is then used to add zoom_in_tool and zoom_out_tool
to models/tools/actions, implementing toolbar buttons that will
zoom

Remaining work on #916 includes:
* actual design done for icons/Zoom{In,Out}.png.  I slapped something
  together for initial concept from the wheel-zoom icon.

* ensure zoom-in and zoom-out are "bundled".  It doesn't make sense
  to have one and not the other.

  Can this be done in helpers.py and plotting.coffee helpers
  or should the object hierarchy have a zoom-buttons layer?

* add 'factor' as a parameter on the zoom buttons.  Currently, it
  is hardcoded to 10%

* review user-guide for documentation needs

* testing. scale_range() should probably have some unit tests and
  I've thought through how to do view testing of the zoom buttons

* possibly rebase this into multiple commits so that git (and github?)
  correctly display the history via praise:
  1. code movement from wheel_zoom_tool to zoom_utils
  2. code reorg and usage of locals to enable sharing with zoom buttons
  3. implement zoom buttons

  I'm not sure how picky you guys are about having clean, easy
  to follow history but I don't mind rebasing this into smaller commits.

Possible work for future (or already existing) tickets:
* Does it make sense to expose zoom-only mode on wheel-zoom? I
  personally find it awkward to use wheel-zoom when it pans and zooms
  at the same time.  This could be implemented easily now by
  programmatically eliding the 'center' parameter to scale_range().
  Perhaps it could be implemented as wheel-zoom button having a dropdown
  radio-button list like tap tool that lets the user

* add zoom buttons to user_guide/tools.rst #916

* add factor property to new zoom buttons #916

The zoom button tools will now take a Percent property named factor to control
how much they zoom in or out per button click

* mv src/coffee/models/tools/zoom_util.coffee -> src/coffee/util/zoom.coffee

As a part of #916 based on feedback from @bryevdv, move scale_range into
toplevel src/coffee/util/zoom.coffee

Also added missing require for wheel_zoom_tool.coffee. I didn't test
wheel zoom for breakage, and/or there isn't a test that caught it.

* use coffee named params in util/zoom::scale_range #916

* util/zoom::scale_range allows v_axis_only && h_axis_only

remove a TODO about possibly checking for v_axis_only && h_axis_only in util/zoom::scale_range.
The logic inside scale_range() will work (doing nothing) if both are true.  There is already
a use-case where the value of center can cause both to be true (if it is outside of the frame
boundary).  Seems like making that a hard error is unnecessary.

* add typings for new zoom buttons #925

* rm superfluous get() and mget() per bev in #4841

Removing uses of get() and mget() that aren't needed now
that @define properties can be accessed via '.'

* ignore c9.io IDE files

* use getter and not computed property to calculate tooltip

* Add unit tests for ZoomInTool and ZoomOutTool

* Add single dimension tests

* Add wheel_zoom_tool tests and remove rogue debugger statement

* Remove debugger and add zoom in/out to color_scatter example
@bryevdv bryevdv modified the milestones: 0.12.3, short-term Oct 6, 2016
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.

3 participants