@@ -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' ) ;
@@ -1033,6 +1034,54 @@ describe('A funnel plot', function() {
1033
1034
. then ( done ) ;
1034
1035
} ) ;
1035
1036
1037
+ it ( 'handle BADNUM positions' , function ( done ) {
1038
+ var x1 = [ 11 , 10 , 9 , 8 , 7 , 6 , 5 , 4 , 3 , 2 , 1 ] ;
1039
+ var x2 = x1 ; // no transition now
1040
+ var mockCopy = {
1041
+ data : [
1042
+ {
1043
+ type : 'funnel' ,
1044
+ y : [
1045
+ 0 ,
1046
+ 1 ,
1047
+ '' ,
1048
+ 'NaN' ,
1049
+ NaN ,
1050
+ Infinity ,
1051
+ - Infinity ,
1052
+ undefined ,
1053
+ null ,
1054
+ 9 ,
1055
+ 10
1056
+ ] ,
1057
+ x : x1
1058
+ }
1059
+ ] ,
1060
+ layout : {
1061
+ width : 800 ,
1062
+ height : 600
1063
+ }
1064
+ } ;
1065
+
1066
+ var barTests = [
1067
+ [ 0 , '.point path' , 'attr' , 'd' , [ 'M245,4V34H395V4Z' , 'M251,42V73H389V42Z' , 'M0,0Z' , 'M0,0Z' , 'M0,0Z' , 'M0,0Z' , 'M0,0Z' , 'M0,0Z' , 'M0,0Z' , 'M306,347V378H334V347Z' , 'M313,386V416H327V386Z' ] ]
1068
+ ] ;
1069
+
1070
+ var connectorTests = [
1071
+ [ 0 , '.regions path' , 'attr' , 'd' , [ 'M245,34L251,42H389L395,34Z' , 'M0,0Z' , 'M0,0Z' , 'M0,0Z' , 'M0,0Z' , 'M0,0Z' , 'M0,0Z' , 'M0,0Z' , 'M0,0Z' , 'M306,378L313,386H327L334,378Z' , 'M0,0Z' ] ]
1072
+ ] ;
1073
+
1074
+ var animateOpts = { data : [ { x : x2 } ] } ;
1075
+ var transitionOpts = false ; // use default
1076
+
1077
+ checkTransition ( gd , mockCopy , animateOpts , transitionOpts , barTests )
1078
+ . then ( function ( ) {
1079
+ return checkTransition ( gd , mockCopy , animateOpts , transitionOpts , connectorTests ) ;
1080
+ } )
1081
+ . catch ( failTest )
1082
+ . then ( done ) ;
1083
+ } ) ;
1084
+
1036
1085
it ( 'should be able to deal with transform that empty out the data coordinate arrays' , function ( done ) {
1037
1086
Plotly . plot ( gd , {
1038
1087
data : [ {
0 commit comments