Skip to content

Commit e85a6c7

Browse files
committed
keep ref to subplot image/shape layers in main drawData
- so that these ref on fullLayout exist even for non-cartesian trace types.
1 parent 652b905 commit e85a6c7

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/plot_api/plot_api.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,11 @@ Plotly.plot = function(gd, data, layout, config) {
258258
basePlotModules[i].plot(gd);
259259
}
260260

261+
// keep reference to shape layers in subplots
262+
var layerSubplot = fullLayout._paper.selectAll('.layer-subplot');
263+
fullLayout._imageSubplotLayer = layerSubplot.selectAll('.imagelayer');
264+
fullLayout._shapeSubplotLayer = layerSubplot.selectAll('.shapelayer');
265+
261266
// styling separate from drawing
262267
Plots.style(gd);
263268

src/plots/cartesian/index.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,6 @@ function updateSubplots(gd) {
178178
// so they end up on top of the rest
179179
plotinfo.draglayer = joinLayer(fullLayout._draggers, 'g', subplot);
180180
});
181-
182-
// keep reference to shape layers in subplots
183-
var layerSubplot = fullLayout._paper.selectAll('.layer-subplot');
184-
fullLayout._imageSubplotLayer = layerSubplot.selectAll('.imagelayer');
185-
fullLayout._shapeSubplotLayer = layerSubplot.selectAll('.shapelayer');
186181
}
187182

188183
function makeSubplotData(gd) {

0 commit comments

Comments
 (0)