Skip to content

Fix Axes.getAutoRange edge cases #813

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

Merged
merged 2 commits into from
Aug 8, 2016
Merged

Conversation

mboorstin
Copy link
Contributor

Overview: Fixes autorange issues described in #798

Details: As suggested in #798 (comment), in the first commit here I've added a bunch of unit tests for Axes.getAutoRange and Axes.expand, with what I think is reasonable behavior. Three of the new Axes.getAutoRange tests fail because of the behavior described in #798 (I've tagged them with TODOs in the first commit) . In the second commit I fix Axes.getAutoRange itself, and I've also confirmed that the repro cases I gave in #798 are indeed fixed.

@mboorstin mboorstin changed the title Boorstin axes ranges Fix Axes.getAutoRange edge cases Aug 3, 2016
@etpinard
Copy link
Contributor

etpinard commented Aug 4, 2016

@mboorstin Thanks very much for this PR!

I won't have time to review today though. I'll do my best to review it tomorrow. 🍻

@etpinard etpinard added bug something broken type: maintenance labels Aug 4, 2016
newRange = minmin < 0 ? [lower, 0] : [0, upper];
}
else if(ax.rangemode === 'nonnegative') {
newRange = [Math.max(0, lower), Math.max(0, upper)];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice fix 🎉

@etpinard
Copy link
Contributor

etpinard commented Aug 8, 2016

@mboorstin Amazing PR. Thanks very much 🍻

@etpinard etpinard merged commit efe7e12 into plotly:master Aug 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants