@@ -1921,8 +1921,9 @@ plots.transition = function(gd, data, layout, traces, frameOpts, transitionOpts)
1921
1921
plots . doCalcdata = function ( gd , traces ) {
1922
1922
var axList = Plotly . Axes . list ( gd ) ,
1923
1923
fullData = gd . _fullData ,
1924
- fullLayout = gd . _fullLayout ,
1925
- i , j ;
1924
+ fullLayout = gd . _fullLayout ;
1925
+
1926
+ var trace , _module , i , j ;
1926
1927
1927
1928
// XXX: Is this correct? Needs a closer look so that *some* traces can be recomputed without
1928
1929
// *all* needing doCalcdata:
@@ -1951,46 +1952,45 @@ plots.doCalcdata = function(gd, traces) {
1951
1952
axList [ i ] . _categories = axList [ i ] . _initialCategories . slice ( ) ;
1952
1953
}
1953
1954
1955
+ // If traces were specified and this trace was not included,
1956
+ // then transfer it over from the old calcdata:
1954
1957
for ( i = 0 ; i < fullData . length ; i ++ ) {
1955
- // If traces were specified and this trace was not included, then transfer it over from
1956
- // the old calcdata:
1957
- if ( Array . isArray ( traces ) && traces . indexOf ( i ) === - 1 ) {
1958
- calcdata [ i ] = oldCalcdata [ i ] ;
1959
- continue ;
1960
- }
1961
-
1962
- var trace = fullData [ i ] ,
1963
- cd = [ ] ;
1964
-
1965
- // If traces were specified and this trace was not included, then transfer it over from
1966
- // the old calcdata:
1967
1958
if ( Array . isArray ( traces ) && traces . indexOf ( i ) === - 1 ) {
1968
1959
calcdata [ i ] = oldCalcdata [ i ] ;
1969
1960
continue ;
1970
1961
}
1962
+ }
1971
1963
1972
- var _module ;
1973
- if ( trace . visible === true ) {
1964
+ // transform loop
1965
+ for ( i = 0 ; i < fullData . length ; i ++ ) {
1966
+ trace = fullData [ i ] ;
1974
1967
1975
- // call calcTransform method if any
1976
- if ( trace . transforms ) {
1968
+ if ( trace . visible === true && trace . transforms ) {
1969
+ _module = trace . _module ;
1977
1970
1978
- // we need one round of trace module calc before
1979
- // the calc transform to 'fill in' the categories list
1980
- // used for example in the data-to-coordinate method
1981
- _module = trace . _module ;
1982
- if ( _module && _module . calc ) _module . calc ( gd , trace ) ;
1971
+ // we need one round of trace module calc before
1972
+ // the calc transform to 'fill in' the categories list
1973
+ // used for example in the data-to-coordinate method
1974
+ if ( _module && _module . calc ) _module . calc ( gd , trace ) ;
1983
1975
1984
- for ( j = 0 ; j < trace . transforms . length ; j ++ ) {
1985
- var transform = trace . transforms [ j ] ;
1976
+ for ( j = 0 ; j < trace . transforms . length ; j ++ ) {
1977
+ var transform = trace . transforms [ j ] ;
1986
1978
1987
- _module = transformsRegistry [ transform . type ] ;
1988
- if ( _module && _module . calcTransform ) {
1989
- _module . calcTransform ( gd , trace , transform ) ;
1990
- }
1979
+ _module = transformsRegistry [ transform . type ] ;
1980
+ if ( _module && _module . calcTransform ) {
1981
+ _module . calcTransform ( gd , trace , transform ) ;
1991
1982
}
1992
1983
}
1984
+ }
1985
+ }
1993
1986
1987
+ // 'regular' loop
1988
+ for ( i = 0 ; i < fullData . length ; i ++ ) {
1989
+ var cd = [ ] ;
1990
+
1991
+ trace = fullData [ i ] ;
1992
+
1993
+ if ( trace . visible === true ) {
1994
1994
_module = trace . _module ;
1995
1995
if ( _module && _module . calc ) cd = _module . calc ( gd , trace ) ;
1996
1996
}
0 commit comments