@@ -17,6 +17,7 @@ var rgb = color.rgb;
1717var customAssertions = require ( '../assets/custom_assertions' ) ;
1818var assertHoverLabelContent = customAssertions . assertHoverLabelContent ;
1919var checkTextTemplate = require ( '../assets/check_texttemplate' ) ;
20+ var checkTransition = require ( '../assets/check_transitions' ) ;
2021var Fx = require ( '@src/components/fx' ) ;
2122
2223var d3 = require ( 'd3' ) ;
@@ -977,6 +978,54 @@ describe('A waterfall plot', function() {
977978 . then ( done ) ;
978979 } ) ;
979980
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+
9801029 it ( 'should be able to deal with transform that empty out the data coordinate arrays' , function ( done ) {
9811030 Plotly . plot ( gd , {
9821031 data : [ {
0 commit comments