File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,41 @@ function runTests(transitionDuration) {
6565 } ) . catch ( fail ) . then ( done ) ;
6666 } ) ;
6767
68+ it ( 'transitions a transform' , function ( done ) {
69+ Plotly . restyle ( gd , {
70+ 'transforms[0]' : {
71+ enabled : true ,
72+ type : 'filter' ,
73+ operation : '<' ,
74+ filtersrc : 'x' ,
75+ value : 10
76+ }
77+ } , [ 0 ] ) . then ( function ( ) {
78+ expect ( gd . _fullData [ 0 ] . transforms ) . toEqual ( [ {
79+ enabled : true ,
80+ type : 'filter' ,
81+ operation : '<' ,
82+ filtersrc : 'x' ,
83+ value : 10
84+ } ] ) ;
85+
86+ return Plots . transition ( gd , [ {
87+ 'transforms[0].operation' : '>'
88+ } ] , null , [ 0 ] ,
89+ { redraw : true , duration : transitionDuration } ,
90+ { duration : transitionDuration , easing : 'cubic-in-out' }
91+ ) ;
92+ } ) . then ( function ( ) {
93+ expect ( gd . _fullData [ 0 ] . transforms ) . toEqual ( [ {
94+ enabled : true ,
95+ type : 'filter' ,
96+ operation : '>' ,
97+ filtersrc : 'x' ,
98+ value : 10
99+ } ] ) ;
100+ } ) . catch ( fail ) . then ( done ) ;
101+ } ) ;
102+
68103 // This doesn't really test anything that the above tests don't cover, but it combines
69104 // the behavior and attempts to ensure chaining and events happen in the correct order.
70105 it ( 'transitions may be chained' , function ( done ) {
You can’t perform that action at this time.
0 commit comments