Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bc76e40

Browse files
committed
try loop over base plot modules
1 parent b018b8a commit bc76e40

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

src/plot_api/plot_api.js

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,12 @@ Plotly.plot = function(gd, data, layout, config) {
250250

251251
// Now plot the data
252252
function drawData() {
253-
var calcdata = gd.calcdata;
253+
var calcdata = gd.calcdata,
254+
i;
254255

255256
// in case of traces that were heatmaps or contour maps
256257
// previously, remove them and their colorbars explicitly
257-
for(var i = 0; i < calcdata.length; i++) {
258+
for(i = 0; i < calcdata.length; i++) {
258259
var trace = calcdata[i][0].trace,
259260
isVisible = (trace.visible === true),
260261
uid = trace.uid;
@@ -272,17 +273,11 @@ Plotly.plot = function(gd, data, layout, config) {
272273
}
273274
}
274275

275-
var plotRegistry = Plots.subplotsRegistry;
276-
277-
if(fullLayout._hasGL3D) plotRegistry.gl3d.plot(gd);
278-
if(fullLayout._hasGeo) plotRegistry.geo.plot(gd);
279-
if(fullLayout._hasGL2D) plotRegistry.gl2d.plot(gd);
280-
if(fullLayout._hasCartesian) plotRegistry.cartesian.plot(gd);
281-
if(fullLayout._hasPie) plotRegistry.pie.plot(gd);
282-
if(fullLayout._hasTernary) plotRegistry.ternary.plot(gd);
283-
284-
// clean up old scenes that no longer have associated data
285-
// will this be a performance hit?
276+
// loop over the base plot modules present on graph
277+
var basePlotModules = fullLayout._basePlotModules;
278+
for(i = 0; i < basePlotModules.length; i++) {
279+
basePlotModules[i].plot(gd);
280+
}
286281

287282
// styling separate from drawing
288283
Plots.style(gd);

0 commit comments

Comments
 (0)