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

Make resetZoom consistent between x- and y-axes #812

Merged
merged 8 commits into from
Dec 27, 2016
Merged

Make resetZoom consistent between x- and y-axes #812

merged 8 commits into from
Dec 27, 2016

Conversation

danvk
Copy link
Owner

@danvk danvk commented Dec 27, 2016

This makes resetZoom behave in the same way for x- and y-axes. If you call resetZoom 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 with g.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 the isZoomed 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 to xAxisExtremes. This gets used when you zoom out with animated zooms and in some tests.

Fixes #524
Fixes #326

@coveralls
Copy link

Coverage Status

Coverage increased (+0.06%) to 90.117% when pulling c5c8d14 on fix-524 into 623dd1d on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.07%) to 90.134% when pulling 3ba4d1d on fix-524 into 623dd1d on master.

@danvk danvk merged commit 87f78fb into master Dec 27, 2016
@mirabilos mirabilos deleted the fix-524 branch January 13, 2023 20:19
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.

2 participants