@@ -369,7 +369,7 @@ plots.supplyDefaults = function(gd) {
369369
370370 // then do the data
371371 newFullLayout . _globalTransforms = ( gd . _context || { } ) . globalTransforms ;
372- plots . supplyDataDefaults ( newData , newFullData , newFullLayout ) ;
372+ plots . supplyDataDefaults ( newData , newFullData , newLayout , newFullLayout ) ;
373373
374374 // attach helper method to check whether a plot type is present on graph
375375 newFullLayout . _has = plots . _hasPlotType . bind ( newFullLayout ) ;
@@ -530,7 +530,7 @@ function relinkPrivateKeys(toContainer, fromContainer) {
530530 var isPlainObject = Lib . isPlainObject ,
531531 isArray = Array . isArray ;
532532
533- var keys = Object . keys ( fromContainer ) ;
533+ var keys = Object . keys ( fromContainer || { } ) ;
534534
535535 for ( var i = 0 ; i < keys . length ; i ++ ) {
536536 var k = keys [ i ] ,
@@ -593,9 +593,9 @@ plots.linkSubplots = function(newFullData, newFullLayout, oldFullData, oldFullLa
593593 }
594594} ;
595595
596- plots . supplyDataDefaults = function ( dataIn , dataOut , layout ) {
597- var modules = layout . _modules = [ ] ,
598- basePlotModules = layout . _basePlotModules = [ ] ,
596+ plots . supplyDataDefaults = function ( dataIn , dataOut , layout , fullLayout ) {
597+ var modules = fullLayout . _modules = [ ] ,
598+ basePlotModules = fullLayout . _basePlotModules = [ ] ,
599599 cnt = 0 ;
600600
601601 function pushModule ( fullTrace ) {
@@ -612,18 +612,18 @@ plots.supplyDataDefaults = function(dataIn, dataOut, layout) {
612612
613613 for ( var i = 0 ; i < dataIn . length ; i ++ ) {
614614 var trace = dataIn [ i ] ,
615- fullTrace = plots . supplyTraceDefaults ( trace , cnt , layout ) ;
615+ fullTrace = plots . supplyTraceDefaults ( trace , cnt , fullLayout ) ;
616616
617617 fullTrace . index = i ;
618618 fullTrace . _input = trace ;
619619 fullTrace . _expandedIndex = cnt ;
620620
621621 if ( fullTrace . transforms && fullTrace . transforms . length ) {
622- var expandedTraces = applyTransforms ( fullTrace , dataOut , layout ) ;
622+ var expandedTraces = applyTransforms ( fullTrace , dataOut , layout , fullLayout ) ;
623623
624624 for ( var j = 0 ; j < expandedTraces . length ; j ++ ) {
625625 var expandedTrace = expandedTraces [ j ] ,
626- fullExpandedTrace = plots . supplyTraceDefaults ( expandedTrace , cnt , layout ) ;
626+ fullExpandedTrace = plots . supplyTraceDefaults ( expandedTrace , cnt , fullLayout ) ;
627627
628628 // mutate uid here using parent uid and expanded index
629629 // to promote consistency between update calls
@@ -805,7 +805,7 @@ function supplyTransformDefaults(traceIn, traceOut, layout) {
805805 if ( ! _module ) Lib . warn ( 'Unrecognized transform type ' + type + '.' ) ;
806806
807807 if ( _module && _module . supplyDefaults ) {
808- transformOut = _module . supplyDefaults ( transformIn , traceOut , layout ) ;
808+ transformOut = _module . supplyDefaults ( transformIn , traceOut , layout , traceIn ) ;
809809 transformOut . type = type ;
810810 }
811811 else {
@@ -816,7 +816,7 @@ function supplyTransformDefaults(traceIn, traceOut, layout) {
816816 }
817817}
818818
819- function applyTransforms ( fullTrace , fullData , layout ) {
819+ function applyTransforms ( fullTrace , fullData , layout , fullLayout ) {
820820 var container = fullTrace . transforms ,
821821 dataOut = [ fullTrace ] ;
822822
@@ -830,6 +830,7 @@ function applyTransforms(fullTrace, fullData, layout) {
830830 fullTrace : fullTrace ,
831831 fullData : fullData ,
832832 layout : layout ,
833+ fullLayout : fullLayout ,
833834 transformIndex : i
834835 } ) ;
835836 }
0 commit comments