Make resetZoom consistent between x- and y-axes #812
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This makes
resetZoom
behave in the same way for x- and y-axes. If you callresetZoom
or double-click the chart, it will zoom all the way out to show the full range of the data, on both axes.Previously, it would do this for the x-axis but only for a y-axis that had been zoomed by the user. A y-axis set with
g.updateOptions({ valueRange })
would not be reset by a double-click, whereas an x-axis set withg.updateOptions({ dateWindow })
would.This didn't make much sense and led to confusion/bugs. So this makes a breaking change to clean things up.
The source of this difference was
valueWindow
. This tracked user-driven y-axis zooms, as distinct from programmatic ones (valueRange
). There was no corresponding notion for the x-axis, hence the behavior mismatch.In the process I removed the
isZoomedIgnoreProgrammaticZoom
option. If you want theisZoomed
method to do something different than it does, dygraphs provides plenty of API for you to work with.This also adds a
yAxisExtremes
method to correspond toxAxisExtremes
. This gets used when you zoom out with animated zooms and in some tests.Fixes #524
Fixes #326