@@ -17,6 +17,7 @@ var rgb = color.rgb;
17
17
var customAssertions = require ( '../assets/custom_assertions' ) ;
18
18
var assertHoverLabelContent = customAssertions . assertHoverLabelContent ;
19
19
var checkTextTemplate = require ( '../assets/check_texttemplate' ) ;
20
+ var checkTransition = require ( '../assets/check_transitions' ) ;
20
21
var Fx = require ( '@src/components/fx' ) ;
21
22
22
23
var d3 = require ( 'd3' ) ;
@@ -977,6 +978,54 @@ describe('A waterfall plot', function() {
977
978
. then ( done ) ;
978
979
} ) ;
979
980
981
+ it ( 'handle BADNUM positions' , function ( done ) {
982
+ var y1 = [ 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ] ;
983
+ var y2 = y1 ; // no transition now
984
+ var mockCopy = {
985
+ data : [
986
+ {
987
+ type : 'waterfall' ,
988
+ x : [
989
+ 0 ,
990
+ 1 ,
991
+ '' ,
992
+ 'NaN' ,
993
+ NaN ,
994
+ Infinity ,
995
+ - Infinity ,
996
+ undefined ,
997
+ null ,
998
+ 9 ,
999
+ 10
1000
+ ] ,
1001
+ y : y1
1002
+ }
1003
+ ] ,
1004
+ layout : {
1005
+ width : 400 ,
1006
+ height : 300
1007
+ }
1008
+ } ;
1009
+
1010
+ var barTests = [
1011
+ [ 0 , '.point path' , 'attr' , 'd' , [ 'M2,121V109H20V121Z' , 'M24,111V98H41V111Z' , 'M0,0Z' , 'M0,0Z' , 'M0,0Z' , 'M0,0Z' , 'M0,0Z' , 'M0,0Z' , 'M0,0Z' , 'M199,28V15H216V28Z' , 'M220,17V5H238V17Z' ] ]
1012
+ ] ;
1013
+
1014
+ var connectorTests = [
1015
+ [ 0 , '.line path' , 'attr' , 'd' , [ 'M20,110H24' , 'M0,0Z' , 'M0,0Z' , 'M0,0Z' , 'M0,0Z' , 'M0,0Z' , 'M0,0Z' , 'M0,0Z' , 'M0,0Z' , 'M216,16H220' , 'M0,0Z' ] ]
1016
+ ] ;
1017
+
1018
+ var animateOpts = { data : [ { y : y2 } ] } ;
1019
+ var transitionOpts = false ; // use default
1020
+
1021
+ checkTransition ( gd , mockCopy , animateOpts , transitionOpts , barTests )
1022
+ . then ( function ( ) {
1023
+ return checkTransition ( gd , mockCopy , animateOpts , transitionOpts , connectorTests ) ;
1024
+ } )
1025
+ . catch ( failTest )
1026
+ . then ( done ) ;
1027
+ } ) ;
1028
+
980
1029
it ( 'should be able to deal with transform that empty out the data coordinate arrays' , function ( done ) {
981
1030
Plotly . plot ( gd , {
982
1031
data : [ {
0 commit comments