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

Don't unscale bar layer points on drag #1370

Merged
merged 2 commits into from
Feb 10, 2017
Merged

Conversation

etpinard
Copy link
Contributor

fixes #1251

as mentioned in #1251 (comment) the fix was pretty easy, writing a test for it was a little harder though.

assertScale(this, 1, 1);
});

mouseEvent('mouseup', pos[0] + 50, pos[1]);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fun fact. This test case doesn't need a mouseup event to test what is desired. But, we need to trigger one to not affect other tests downstream (namely in config_test.js).

@@ -712,7 +712,7 @@ module.exports = function dragBox(gd, plotinfo, x, y, w, h, ns, ew) {
// This is specifically directed at scatter traces, applying an inverse
// scale to individual points to counteract the scale of the trace
// as a whole:
.selectAll('.points').selectAll('.point')
.select('.scatterlayer').selectAll('.points').selectAll('.point')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rreusser would you mind reviewing the line?

Copy link
Contributor

@rreusser rreusser Feb 10, 2017

Choose a reason for hiding this comment

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

That makes sense to me. It's certainly better, though I can't say from direct knowledge that nothing puts stray items in the scatterlayer .

@etpinard etpinard merged commit 7c5a22d into master Feb 10, 2017
@etpinard etpinard deleted the barlayer-no-scale-on-drag branch February 10, 2017 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bar / histogram traces break on single-ended (zoom) axis drag
2 participants