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

Splom zoom perf #2527

Merged
merged 14 commits into from
Apr 11, 2018
2 changes: 1 addition & 1 deletion src/plots/cartesian/dragbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,7 @@ function calcLinks(gd, xaHash, yaHash) {
var yaHashLinked = {};
var yaxesLinked = [];
for(yLinkID in yLinks) {
var ya = getFromId(gd, xLinkID);
var ya = getFromId(gd, yLinkID);
Copy link
Collaborator

Choose a reason for hiding this comment

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

yikes, good catch!

yaxesLinked.push(ya);
yaHashLinked[ya._id] = ya;
}
Expand Down
24 changes: 24 additions & 0 deletions test/jasmine/tests/cartesian_interact_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,30 @@ describe('axis zoom/pan and main plot zoom', function() {
.catch(failTest)
.then(done);
});

it('updates linked axes when there are constraints (axes_scaleanchor mock)', function(done) {
var fig = Lib.extendDeep({}, require('@mocks/axes_scaleanchor.json'));

function _assert(y3rng, y4rng) {
expect(gd._fullLayout.yaxis3.range).toBeCloseToArray(y3rng, 2, 'y3 rng');
expect(gd._fullLayout.yaxis4.range).toBeCloseToArray(y4rng, 2, 'y3 rng');
}

Plotly.plot(gd, fig)
.then(function() {
_assert([-0.36, 4.36], [-0.36, 4.36]);
})
.then(doDrag('x2y3', 'nsew', 0, 100))
.then(function() {
_assert([-0.36, 2], [0.82, 3.18]);
})
.then(doDrag('x2y4', 'nsew', 0, 50))
.then(function() {
_assert([0.41, 1.23], [1.18, 2]);
})
.catch(failTest)
.then(done);
});
});

describe('Event data:', function() {
Expand Down