Skip to content

Commit 73acd7e

Browse files
committed
merge options before matrix.update call
- matrix.update() can be expansive (something we should look into), so try to call it the least number of times possible.
1 parent 8282d91 commit 73acd7e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/traces/splom/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ function plotOne(gd, cd0) {
200200

201201
var visibleDims = trace._visibleDims;
202202
var visibleLength = cdata.length;
203-
var viewOpts = {};
203+
var viewOpts = scene.viewOpts = {};
204204
viewOpts.ranges = new Array(visibleLength);
205205
viewOpts.domains = new Array(visibleLength);
206206

@@ -298,8 +298,8 @@ function plotOne(gd, cd0) {
298298
}
299299
}
300300
else {
301-
scene.matrix.update(matrixOpts, null);
302-
scene.matrix.update(viewOpts, null);
301+
var opts = Lib.extendFlat({}, matrixOpts, viewOpts);
302+
scene.matrix.update(opts, null);
303303
stash.xpx = stash.ypx = null;
304304
}
305305

test/jasmine/tests/splom_test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -921,10 +921,10 @@ describe('Test splom drag:', function() {
921921
var scene = gd._fullLayout._splomScenes[uid];
922922
// N.B. _drag triggers two updateSubplots call
923923
// - 1 update and 1 draw call per updateSubplot
924-
// - 2 update calls (1 for data, 1 for view opts)
924+
// - 1 update calls for data+view opts
925925
// during splom plot on mouseup
926926
// - 1 draw call during splom plot on mouseup
927-
expect(scene.matrix.update).toHaveBeenCalledTimes(4);
927+
expect(scene.matrix.update).toHaveBeenCalledTimes(3);
928928
expect(scene.matrix.draw).toHaveBeenCalledTimes(3);
929929

930930
_assertRanges('after drag', [

0 commit comments

Comments
 (0)