Skip to content

Commit d3fe40d

Browse files
committed
replace selectAll with for(k in _plots) loop
1 parent a0b2574 commit d3fe40d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/components/shapes/draw.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ function draw(gd) {
4242
// Remove previous shapes before drawing new in shapes in fullLayout.shapes
4343
fullLayout._shapeUpperLayer.selectAll('path').remove();
4444
fullLayout._shapeLowerLayer.selectAll('path').remove();
45-
fullLayout._shapeSubplotLayers.selectAll('path').remove();
45+
46+
for(var k in fullLayout._plots) {
47+
var shapelayer = fullLayout._plots[k].shapelayer;
48+
if(shapelayer) shapelayer.selectAll('path').remove();
49+
}
4650

4751
for(var i = 0; i < fullLayout.shapes.length; i++) {
4852
if(fullLayout.shapes[i].visible) {

src/plot_api/subroutines.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -529,10 +529,6 @@ exports.drawData = function(gd) {
529529
basePlotModules[i].plot(gd);
530530
}
531531

532-
// keep reference to shape layers in subplots
533-
var layerSubplot = fullLayout._paper.selectAll('.layer-subplot');
534-
fullLayout._shapeSubplotLayers = layerSubplot.selectAll('.shapelayer');
535-
536532
// styling separate from drawing
537533
Plots.style(gd);
538534

0 commit comments

Comments
 (0)