Skip to content

Commit 9aea0ba

Browse files
committed
fixup scattergl+splom style() on select
1 parent 651901d commit 9aea0ba

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

src/traces/scattergl/index.js

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -809,21 +809,16 @@ function selectPoints(searchInfo, polygon) {
809809
function style(gd, cds) {
810810
if(!cds) return;
811811

812-
var fullLayout = gd._fullLayout;
812+
var stash = cds[0][0].t;
813+
var scene = stash.scene;
813814

814-
if(fullLayout._has('splom')) {
815-
// splom clear the whole canvas,
816-
// must redraw every subplot
817-
for(var k in fullLayout._plots) {
818-
var sp = fullLayout._plots[k];
819-
if(sp._scene) sp._scene.draw();
820-
}
821-
} else {
822-
var stash = cds[0][0].t;
823-
var scene = stash.scene;
815+
// don't clear the subplot if there are splom traces
816+
// on the graph
817+
if(!gd._fullLayout._has('splom')) {
824818
scene.clear();
825-
scene.draw();
826819
}
820+
821+
scene.draw();
827822
}
828823

829824
module.exports = {

src/traces/splom/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,15 @@ function style(gd, cds) {
429429
var scene = cds[i][0].t._scene;
430430
scene.draw();
431431
}
432+
433+
// redraw all subplot with scattergl traces,
434+
// all we cleared the whole canvas above
435+
if(fullLayout._has('cartesian')) {
436+
for(var k in fullLayout._plots) {
437+
var sp = fullLayout._plots[k];
438+
if(sp._scene) sp._scene.draw();
439+
}
440+
}
432441
}
433442

434443
function getDimIndex(trace, ax) {

0 commit comments

Comments
 (0)