@@ -2309,7 +2309,7 @@ plots.extendLayout = function(destLayout, srcLayout) {
2309
2309
*/
2310
2310
plots . transition = function ( gd , data , layout , traces , frameOpts , transitionOpts ) {
2311
2311
var opts = { redraw : frameOpts . redraw } ;
2312
- var transitionedTraces = [ ] ;
2312
+ var transitionedTraces = { } ;
2313
2313
var axEdits = [ ] ;
2314
2314
2315
2315
opts . prepareFn = function ( ) {
@@ -2319,16 +2319,18 @@ plots.transition = function(gd, data, layout, traces, frameOpts, transitionOpts)
2319
2319
for ( var i = 0 ; i < traceIndices . length ; i ++ ) {
2320
2320
var traceIdx = traceIndices [ i ] ;
2321
2321
var trace = gd . _fullData [ traceIdx ] ;
2322
- var module = trace . _module ;
2322
+ var _module = trace . _module ;
2323
2323
2324
2324
// There's nothing to do if this module is not defined:
2325
- if ( ! module ) continue ;
2325
+ if ( ! _module ) continue ;
2326
2326
2327
2327
// Don't register the trace as transitioned if it doesn't know what to do.
2328
2328
// If it *is* registered, it will receive a callback that it's responsible
2329
2329
// for calling in order to register the transition as having completed.
2330
- if ( module . animatable ) {
2331
- transitionedTraces . push ( traceIdx ) ;
2330
+ if ( _module . animatable ) {
2331
+ var n = _module . basePlotModule . name ;
2332
+ if ( ! transitionedTraces [ n ] ) transitionedTraces [ n ] = [ ] ;
2333
+ transitionedTraces [ n ] . push ( traceIdx ) ;
2332
2334
}
2333
2335
2334
2336
gd . data [ traceIndices [ i ] ] = plots . extendTrace ( gd . data [ traceIndices [ i ] ] , data [ i ] ) ;
@@ -2427,19 +2429,21 @@ plots.transition = function(gd, data, layout, traces, frameOpts, transitionOpts)
2427
2429
if ( hasAxisTransition ) {
2428
2430
traceTransitionOpts = Lib . extendFlat ( { } , transitionOpts ) ;
2429
2431
traceTransitionOpts . duration = 0 ;
2430
- // This means do not transition traces,
2432
+ // This means do not transition cartesian traces,
2431
2433
// this happens on layout-only (e.g. axis range) animations
2432
- transitionedTraces = null ;
2434
+ delete transitionedTraces . cartesian ;
2433
2435
} else {
2434
2436
traceTransitionOpts = transitionOpts ;
2435
2437
}
2436
2438
2437
- for ( i = 0 ; i < basePlotModules . length ; i ++ ) {
2438
- // Note that we pass a callback to *create* the callback that must be invoked on completion.
2439
- // This is since not all traces know about transitions, so it greatly simplifies matters if
2440
- // the trace is responsible for creating a callback, if needed, and then executing it when
2441
- // the time is right.
2442
- basePlotModules [ i ] . plot ( gd , transitionedTraces , traceTransitionOpts , makeCallback ) ;
2439
+ // Note that we pass a callback to *create* the callback that must be invoked on completion.
2440
+ // This is since not all traces know about transitions, so it greatly simplifies matters if
2441
+ // the trace is responsible for creating a callback, if needed, and then executing it when
2442
+ // the time is right.
2443
+ for ( var n in transitionedTraces ) {
2444
+ var traceIndices = transitionedTraces [ n ] ;
2445
+ var _module = gd . _fullData [ traceIndices [ 0 ] ] . _module ;
2446
+ _module . basePlotModule . plot ( gd , traceIndices , traceTransitionOpts , makeCallback ) ;
2443
2447
}
2444
2448
} ;
2445
2449
0 commit comments