@@ -364,6 +364,9 @@ plots.sendDataToCloud = function(gd) {
364
364
// gd._fullLayout._basePlotModules
365
365
// is a list of all the plot modules required to draw the plot.
366
366
//
367
+ // gd._fullLayout._transformModules
368
+ // is a list of all the transform modules invoked.
369
+ //
367
370
plots . supplyDefaults = function ( gd ) {
368
371
var oldFullLayout = gd . _fullLayout || { } ,
369
372
newFullLayout = gd . _fullLayout = { } ,
@@ -375,6 +378,9 @@ plots.supplyDefaults = function(gd) {
375
378
376
379
var i ;
377
380
381
+ // Create all the storage space for frames, but only if doesn't already exist
382
+ if ( ! gd . _transitionData ) plots . createTransitionData ( gd ) ;
383
+
378
384
// first fill in what we can of layout without looking at data
379
385
// because fullData needs a few things from layout
380
386
@@ -435,7 +441,7 @@ plots.supplyDefaults = function(gd) {
435
441
}
436
442
437
443
// finally, fill in the pieces of layout that may need to look at data
438
- plots . supplyLayoutModuleDefaults ( newLayout , newFullLayout , newFullData ) ;
444
+ plots . supplyLayoutModuleDefaults ( newLayout , newFullLayout , newFullData , gd . _transitionData ) ;
439
445
440
446
// TODO remove in v2.0.0
441
447
// add has-plot-type refs to fullLayout for backward compatibility
@@ -474,12 +480,6 @@ plots.supplyDefaults = function(gd) {
474
480
( gd . calcdata [ i ] [ 0 ] || { } ) . trace = trace ;
475
481
}
476
482
}
477
-
478
- // Create all the storage space for frames, but only if doesn't already
479
- // exist:
480
- if ( ! gd . _transitionData ) {
481
- plots . createTransitionData ( gd ) ;
482
- }
483
483
} ;
484
484
485
485
// Create storage for all of the data related to frames and transitions:
@@ -646,6 +646,8 @@ plots.supplyDataDefaults = function(dataIn, dataOut, layout, fullLayout) {
646
646
basePlotModules = fullLayout . _basePlotModules = [ ] ,
647
647
cnt = 0 ;
648
648
649
+ fullLayout . _transformModules = [ ] ;
650
+
649
651
function pushModule ( fullTrace ) {
650
652
dataOut . push ( fullTrace ) ;
651
653
@@ -863,6 +865,8 @@ function supplyTransformDefaults(traceIn, traceOut, layout) {
863
865
transformOut = _module . supplyDefaults ( transformIn , traceOut , layout , traceIn ) ;
864
866
transformOut . type = type ;
865
867
transformOut . _module = _module ;
868
+
869
+ Lib . pushUnique ( layout . _transformModules , _module ) ;
866
870
}
867
871
else {
868
872
transformOut = Lib . extendFlat ( { } , transformIn ) ;
@@ -1032,7 +1036,7 @@ function calculateReservedMargins(margins) {
1032
1036
return resultingMargin ;
1033
1037
}
1034
1038
1035
- plots . supplyLayoutModuleDefaults = function ( layoutIn , layoutOut , fullData ) {
1039
+ plots . supplyLayoutModuleDefaults = function ( layoutIn , layoutOut , fullData , transitionData ) {
1036
1040
var i , _module ;
1037
1041
1038
1042
// can't be be part of basePlotModules loop
@@ -1063,6 +1067,16 @@ plots.supplyLayoutModuleDefaults = function(layoutIn, layoutOut, fullData) {
1063
1067
}
1064
1068
}
1065
1069
1070
+ // transform module layout defaults
1071
+ var transformModules = layoutOut . _transformModules ;
1072
+ for ( i = 0 ; i < transformModules . length ; i ++ ) {
1073
+ _module = transformModules [ i ] ;
1074
+
1075
+ if ( _module . supplyLayoutDefaults ) {
1076
+ _module . supplyLayoutDefaults ( layoutIn , layoutOut , fullData , transitionData ) ;
1077
+ }
1078
+ }
1079
+
1066
1080
// should FX be a component?
1067
1081
Plotly . Fx . supplyLayoutDefaults ( layoutIn , layoutOut , fullData ) ;
1068
1082
0 commit comments