@@ -2730,17 +2730,13 @@ plots.doCalcdata = function(gd, traces) {
2730
2730
) ;
2731
2731
}
2732
2732
2733
- setupAxisCategories ( axList , fullData ) ;
2734
-
2735
2733
var hasCalcTransform = false ;
2736
2734
2737
- // transform loop
2738
- for ( i = 0 ; i < fullData . length ; i ++ ) {
2735
+ function transformCalci ( i ) {
2739
2736
trace = fullData [ i ] ;
2737
+ _module = trace . _module ;
2740
2738
2741
2739
if ( trace . visible === true && trace . transforms ) {
2742
- _module = trace . _module ;
2743
-
2744
2740
// we need one round of trace module calc before
2745
2741
// the calc transform to 'fill in' the categories list
2746
2742
// used for example in the data-to-coordinate method
@@ -2767,9 +2763,6 @@ plots.doCalcdata = function(gd, traces) {
2767
2763
}
2768
2764
}
2769
2765
2770
- // clear stuff that should recomputed in 'regular' loop
2771
- if ( hasCalcTransform ) setupAxisCategories ( axList , fullData ) ;
2772
-
2773
2766
function calci ( i , isContainer ) {
2774
2767
trace = fullData [ i ] ;
2775
2768
_module = trace . _module ;
@@ -2814,6 +2807,16 @@ plots.doCalcdata = function(gd, traces) {
2814
2807
calcdata [ i ] = cd ;
2815
2808
}
2816
2809
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
+
2817
2820
// 'regular' loop - make sure container traces (eg carpet) calc before
2818
2821
// contained traces (eg contourcarpet)
2819
2822
for ( i = 0 ; i < fullData . length ; i ++ ) calci ( i , true ) ;
0 commit comments