Feature request: Axis boundaries
See original GitHub issueHi, I just recently started using your plotting library (which is awesome by the way) to do some heatmap plots. One of the main complaints I’ve received have been the ability to pan outside the plot’s boundaries (just click and drag the plot outside the viewport and suddenly the axis range point to some non-data containing area). While this can be mitigated with the fixedrange
attribute, you end up losing the pan and zoom features for that axis.
So, I was thinking that maybe adding axis boundaries could be a thing? Maybe two more properties could be added to the axes: bounds
and boundsmode
. bounds
gets checked in the panning and zooming logic and, if set, it constrains the range to the specified bounds. boundsmode
allows the bounds to be computed automatically from the plot (like autorange
). That way users can zoom and pan al around the plot, but cannot get outside the plot bounds.
As proof of concept I have created this pull request g-i-o-/plotly.js#1 on my fork and was thinking maybe you guys could check it out comment on how to improve and, if you like it, add it or something like that.
- Here we have a nice little heatmap:
- But then some user starts using with the panning tool a bit too much:
Issue Analytics
- State:
- Created 7 years ago
- Reactions:14
- Comments:16 (6 by maintainers)
Top GitHub Comments
PING! Would LOVE the ability to limit zoom-out and pan so the user can’t move beyond available data.
I’ve made some work towards implementing this feature here: https://github.com/MrQubo/plotly.js/pull/3 Any help will be appreciated.