@@ -250,11 +250,12 @@ Plotly.plot = function(gd, data, layout, config) {
250
250
251
251
// Now plot the data
252
252
function drawData ( ) {
253
- var calcdata = gd . calcdata ;
253
+ var calcdata = gd . calcdata ,
254
+ i ;
254
255
255
256
// in case of traces that were heatmaps or contour maps
256
257
// previously, remove them and their colorbars explicitly
257
- for ( var i = 0 ; i < calcdata . length ; i ++ ) {
258
+ for ( i = 0 ; i < calcdata . length ; i ++ ) {
258
259
var trace = calcdata [ i ] [ 0 ] . trace ,
259
260
isVisible = ( trace . visible === true ) ,
260
261
uid = trace . uid ;
@@ -272,17 +273,11 @@ Plotly.plot = function(gd, data, layout, config) {
272
273
}
273
274
}
274
275
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
+ }
286
281
287
282
// styling separate from drawing
288
283
Plots . style ( gd ) ;
0 commit comments