File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -948,6 +948,36 @@ describe('A waterfall plot', function() {
948948 . then ( done ) ;
949949 } ) ;
950950
951+ it ( 'should be able to deal with blank bars on transform' , function ( done ) {
952+ Plotly . plot ( gd , {
953+ data : [ {
954+ type : 'waterfall' ,
955+ x : [ 1 , 2 , 3 ] ,
956+ xsrc : 'ints' ,
957+ transforms : [ {
958+ type : 'filter' ,
959+ target : [ 1 , 2 , 3 ] ,
960+ targetsrc : 'ints' ,
961+ operation : '<' ,
962+ value : 0
963+ } ]
964+ } ]
965+ } )
966+ . then ( function ( ) {
967+ var traceNodes = getAllTraceNodes ( gd ) ;
968+ var waterfallNodes = getAllWaterfallNodes ( traceNodes [ 0 ] ) ;
969+ var pathNode = waterfallNodes [ 0 ] . querySelector ( 'path' ) ;
970+
971+ expect ( gd . calcdata [ 0 ] [ 0 ] . x ) . toEqual ( NaN ) ;
972+ expect ( gd . calcdata [ 0 ] [ 0 ] . y ) . toEqual ( NaN ) ;
973+ expect ( gd . calcdata [ 0 ] [ 0 ] . isBlank ) . toBe ( true ) ;
974+
975+ expect ( pathNode . outerHTML ) . toEqual ( '<path d="M0,0Z" style="vector-effect: non-scaling-stroke;"></path>' ) ;
976+ } )
977+ . catch ( failTest )
978+ . then ( done ) ;
979+ } ) ;
980+
951981 it ( 'should coerce text-related attributes' , function ( done ) {
952982 var data = [ {
953983 y : [ 10 , 20 , 30 , 40 ] ,
You can’t perform that action at this time.
0 commit comments