11var Plotly = require ( '@lib/index' ) ;
22var Lib = require ( '@src/lib' ) ;
33var Plots = Plotly . Plots ;
4+ var plotApiHelpers = require ( '@src/plot_api/helpers' ) ;
45
56var createGraphDiv = require ( '../assets/create_graph_div' ) ;
67var destroyGraphDiv = require ( '../assets/destroy_graph_div' ) ;
@@ -29,8 +30,9 @@ function runTests(transitionDuration) {
2930
3031 it ( 'resolves only once the transition has completed' , function ( done ) {
3132 var t1 = Date . now ( ) ;
33+ var traces = plotApiHelpers . coerceTraceIndices ( gd , null ) ;
3234
33- Plots . transition ( gd , null , { 'xaxis.range' : [ 0.2 , 0.3 ] } , null , { redraw : true } , { duration : transitionDuration , easing : 'cubic-in-out' } )
35+ Plots . transition ( gd , null , { 'xaxis.range' : [ 0.2 , 0.3 ] } , traces , { redraw : true } , { duration : transitionDuration , easing : 'cubic-in-out' } )
3436 . then ( delay ( 20 ) )
3537 . then ( function ( ) {
3638 expect ( Date . now ( ) - t1 ) . toBeGreaterThan ( transitionDuration ) ;
@@ -39,9 +41,11 @@ function runTests(transitionDuration) {
3941
4042 it ( 'emits plotly_transitioning on transition start' , function ( done ) {
4143 var beginTransitionCnt = 0 ;
44+ var traces = plotApiHelpers . coerceTraceIndices ( gd , null ) ;
45+
4246 gd . on ( 'plotly_transitioning' , function ( ) { beginTransitionCnt ++ ; } ) ;
4347
44- Plots . transition ( gd , null , { 'xaxis.range' : [ 0.2 , 0.3 ] } , null , { redraw : true } , { duration : transitionDuration , easing : 'cubic-in-out' } )
48+ Plots . transition ( gd , null , { 'xaxis.range' : [ 0.2 , 0.3 ] } , traces , { redraw : true } , { duration : transitionDuration , easing : 'cubic-in-out' } )
4549 . then ( delay ( 20 ) )
4650 . then ( function ( ) {
4751 expect ( beginTransitionCnt ) . toBe ( 1 ) ;
@@ -50,9 +54,11 @@ function runTests(transitionDuration) {
5054
5155 it ( 'emits plotly_transitioned on transition end' , function ( done ) {
5256 var trEndCnt = 0 ;
57+ var traces = plotApiHelpers . coerceTraceIndices ( gd , null ) ;
58+
5359 gd . on ( 'plotly_transitioned' , function ( ) { trEndCnt ++ ; } ) ;
5460
55- Plots . transition ( gd , null , { 'xaxis.range' : [ 0.2 , 0.3 ] } , null , { redraw : true } , { duration : transitionDuration , easing : 'cubic-in-out' } )
61+ Plots . transition ( gd , null , { 'xaxis.range' : [ 0.2 , 0.3 ] } , traces , { redraw : true } , { duration : transitionDuration , easing : 'cubic-in-out' } )
5662 . then ( delay ( 20 ) )
5763 . then ( function ( ) {
5864 expect ( trEndCnt ) . toEqual ( 1 ) ;
@@ -70,7 +76,8 @@ function runTests(transitionDuration) {
7076 gd . on ( 'plotly_transitioned' , function ( ) { currentlyRunning -- ; endCnt ++ ; } ) ;
7177
7278 function doTransition ( ) {
73- return Plots . transition ( gd , [ { x : [ 1 , 2 ] } ] , null , null , { redraw : true } , { duration : transitionDuration , easing : 'cubic-in-out' } ) ;
79+ var traces = plotApiHelpers . coerceTraceIndices ( gd , null ) ;
80+ return Plots . transition ( gd , [ { x : [ 1 , 2 ] } ] , null , traces , { redraw : true } , { duration : transitionDuration , easing : 'cubic-in-out' } ) ;
7481 }
7582
7683 function checkNoneRunning ( ) {
0 commit comments