@@ -2730,17 +2730,13 @@ plots.doCalcdata = function(gd, traces) {
27302730 ) ;
27312731 }
27322732
2733- setupAxisCategories ( axList , fullData ) ;
2734-
27352733 var hasCalcTransform = false ;
27362734
2737- // transform loop
2738- for ( i = 0 ; i < fullData . length ; i ++ ) {
2735+ function transformCalci ( i ) {
27392736 trace = fullData [ i ] ;
2737+ _module = trace . _module ;
27402738
27412739 if ( trace . visible === true && trace . transforms ) {
2742- _module = trace . _module ;
2743-
27442740 // we need one round of trace module calc before
27452741 // the calc transform to 'fill in' the categories list
27462742 // used for example in the data-to-coordinate method
@@ -2767,9 +2763,6 @@ plots.doCalcdata = function(gd, traces) {
27672763 }
27682764 }
27692765
2770- // clear stuff that should recomputed in 'regular' loop
2771- if ( hasCalcTransform ) setupAxisCategories ( axList , fullData ) ;
2772-
27732766 function calci ( i , isContainer ) {
27742767 trace = fullData [ i ] ;
27752768 _module = trace . _module ;
@@ -2814,6 +2807,16 @@ plots.doCalcdata = function(gd, traces) {
28142807 calcdata [ i ] = cd ;
28152808 }
28162809
2810+ setupAxisCategories ( axList , fullData ) ;
2811+
2812+ // 'transform' loop - must calc container traces first
2813+ // so that if their dependent traces can get transform properly
2814+ for ( i = 0 ; i < fullData . length ; i ++ ) calci ( i , true ) ;
2815+ for ( i = 0 ; i < fullData . length ; i ++ ) transformCalci ( i ) ;
2816+
2817+ // clear stuff that should recomputed in 'regular' loop
2818+ if ( hasCalcTransform ) setupAxisCategories ( axList , fullData ) ;
2819+
28172820 // 'regular' loop - make sure container traces (eg carpet) calc before
28182821 // contained traces (eg contourcarpet)
28192822 for ( i = 0 ; i < fullData . length ; i ++ ) calci ( i , true ) ;
0 commit comments