Skip to content

F/plot bounds - #1

Open
g-i-o- wants to merge 9 commits into
masterfrom
f/plot-bounds
Open

g-i-o- wants to merge 9 commits into
masterfrom
f/plot-bounds

Conversation

@g-i-o-

@g-i-o- g-i-o- commented Aug 26, 2016

Copy link
Copy Markdown
Owner

This pull request is for constraining the plot ranges so that they are interactive, but don't allow the user to scroll past some specified bounds.

To do this, two new layout properties are added to the axes:
- bounds - for specifying that the axis should be contrained to always be within that range
- boundsmode - for specifying wether bounds is computed manually or automatically.
To implement the functionality, a new file is added in src/lib/clamp_range_to_bounds.js with the function clampRangeToBounds that contains the bounds restricting logic. The panning and zooming logic in src/plots/cartesian/dragbox.js and src/components/modebar/buttons.js is then altered to restrict the modified ranges to bounds using clampRangeToBounds, optionally computing the bounds on the spot if boundsmode is 'auto'.

A mock is added in test/image/mocks/axis_bounds.json to test the functionality of these two attributes.

g-i-o- added 9 commits August 24, 2016 11:10
Adding bounds and boundsmode axis attributes
linting
adding computeAxisBounds and clampRangeToBounds and using them in plotDrag to clamp the axis  if bounds is given or boundsmode is auto
dx and dy are now updated with the actual pixel displacement
adding axis_bounds mock file to test in the test dashboard
moving clampRangeToBounds to its own file
bounds are also applied when zooming
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant