@@ -360,7 +360,7 @@ describe('parcoords edge cases', function() {
360360
361361 it ( '@gl Works fine with one panel only' , function ( done ) {
362362 var mockCopy = Lib . extendDeep ( { } , mock2 ) ;
363- Plotly . plot ( gd , mockCopy . data , mockCopy . layout ) . then ( function ( ) {
363+ Plotly . plot ( gd , mockCopy ) . then ( function ( ) {
364364 expect ( gd . data . length ) . toEqual ( 1 ) ;
365365 expect ( gd . data [ 0 ] . dimensions . length ) . toEqual ( 2 ) ;
366366 expect ( document . querySelectorAll ( '.axis' ) . length ) . toEqual ( 2 ) ;
@@ -378,7 +378,7 @@ describe('parcoords edge cases', function() {
378378
379379 it ( '@gl Do something sensible if there is no panel i.e. dimension count is less than 2' , function ( done ) {
380380 var mockCopy = Lib . extendDeep ( { } , mock1 ) ;
381- Plotly . plot ( gd , mockCopy . data , mockCopy . layout ) . then ( function ( ) {
381+ Plotly . plot ( gd , mockCopy ) . then ( function ( ) {
382382 expect ( gd . data . length ) . toEqual ( 1 ) ;
383383 expect ( gd . data [ 0 ] . dimensions . length ) . toEqual ( 1 ) ;
384384 expect ( document . querySelectorAll ( '.axis' ) . length ) . toEqual ( 1 ) ; // sole axis still shows up
@@ -395,7 +395,7 @@ describe('parcoords edge cases', function() {
395395 it ( '@gl Does not error with zero dimensions' , function ( done ) {
396396 var mockCopy = Lib . extendDeep ( { } , mock0 ) ;
397397
398- Plotly . plot ( gd , mockCopy . data , mockCopy . layout ) . then ( function ( ) {
398+ Plotly . plot ( gd , mockCopy ) . then ( function ( ) {
399399 expect ( gd . data . length ) . toEqual ( 1 ) ;
400400 expect ( gd . data [ 0 ] . dimensions . length ) . toEqual ( 0 ) ;
401401 expect ( document . querySelectorAll ( '.axis' ) . length ) . toEqual ( 0 ) ;
@@ -404,13 +404,32 @@ describe('parcoords edge cases', function() {
404404 . then ( done ) ;
405405 } ) ;
406406
407+ it ( '@gl Does not error with dimensions including only 0' , function ( done ) {
408+ Plotly . plot ( gd , {
409+ data : [ {
410+ type : 'parcoords' ,
411+ dimensions : [ {
412+ label : 'all zero' ,
413+ values : [ 0 , 0 ]
414+ } ]
415+ } ] ,
416+ layout : { }
417+ } ) . then ( function ( ) {
418+ expect ( gd . data . length ) . toEqual ( 1 ) ;
419+ expect ( gd . data [ 0 ] . dimensions . length ) . toEqual ( 1 ) ;
420+ expect ( document . querySelectorAll ( '.axis' ) . length ) . toEqual ( 1 ) ;
421+ } )
422+ . catch ( failTest )
423+ . then ( done ) ;
424+ } ) ;
425+
407426 it ( '@gl Works with duplicate dimension labels' , function ( done ) {
408427 var mockCopy = Lib . extendDeep ( { } , mock2 ) ;
409428
410429 mockCopy . layout . width = 320 ;
411430 mockCopy . data [ 0 ] . dimensions [ 1 ] . label = mockCopy . data [ 0 ] . dimensions [ 0 ] . label ;
412431
413- Plotly . plot ( gd , mockCopy . data , mockCopy . layout ) . then ( function ( ) {
432+ Plotly . plot ( gd , mockCopy ) . then ( function ( ) {
414433 expect ( gd . data . length ) . toEqual ( 1 ) ;
415434 expect ( gd . data [ 0 ] . dimensions . length ) . toEqual ( 2 ) ;
416435 expect ( document . querySelectorAll ( '.axis' ) . length ) . toEqual ( 2 ) ;
@@ -434,7 +453,7 @@ describe('parcoords edge cases', function() {
434453 }
435454 }
436455
437- Plotly . plot ( gd , mockCopy . data , mockCopy . layout ) . then ( function ( ) {
456+ Plotly . plot ( gd , mockCopy ) . then ( function ( ) {
438457 expect ( gd . data . length ) . toEqual ( 1 ) ;
439458 expect ( gd . data [ 0 ] . dimensions . length ) . toEqual ( 2 ) ;
440459 expect ( document . querySelectorAll ( '.axis' ) . length ) . toEqual ( 2 ) ;
@@ -456,7 +475,7 @@ describe('parcoords edge cases', function() {
456475 dim . values = [ ] ;
457476 }
458477
459- Plotly . plot ( gd , mockCopy . data , mockCopy . layout ) . then ( function ( ) {
478+ Plotly . plot ( gd , mockCopy ) . then ( function ( ) {
460479 expect ( gd . data . length ) . toEqual ( 1 ) ;
461480 expect ( gd . data [ 0 ] . dimensions . length ) . toEqual ( 2 ) ;
462481 expect ( document . querySelectorAll ( '.axis' ) . length ) . toEqual ( 0 ) ;
@@ -482,7 +501,7 @@ describe('parcoords edge cases', function() {
482501 }
483502 }
484503
485- Plotly . plot ( gd , mockCopy . data , mockCopy . layout ) . then ( function ( ) {
504+ Plotly . plot ( gd , mockCopy ) . then ( function ( ) {
486505 expect ( gd . data . length ) . toEqual ( 1 ) ;
487506 expect ( gd . data [ 0 ] . dimensions . length ) . toEqual ( 2 ) ;
488507 expect ( document . querySelectorAll ( '.axis' ) . length ) . toEqual ( 2 ) ;
@@ -511,7 +530,7 @@ describe('parcoords edge cases', function() {
511530 mockCopy . data [ 0 ] . dimensions [ i ] = newDimension ;
512531 }
513532
514- Plotly . plot ( gd , mockCopy . data , mockCopy . layout ) . then ( function ( ) {
533+ Plotly . plot ( gd , mockCopy ) . then ( function ( ) {
515534 expect ( gd . data . length ) . toEqual ( 1 ) ;
516535 expect ( gd . data [ 0 ] . dimensions . length ) . toEqual ( 60 ) ;
517536 expect ( document . querySelectorAll ( '.axis' ) . length ) . toEqual ( 60 ) ;
@@ -537,7 +556,7 @@ describe('parcoords edge cases', function() {
537556 mockCopy . data [ 0 ] . dimensions [ i ] = newDimension ;
538557 }
539558
540- Plotly . plot ( gd , mockCopy . data , mockCopy . layout ) . then ( function ( ) {
559+ Plotly . plot ( gd , mockCopy ) . then ( function ( ) {
541560 expect ( gd . data . length ) . toEqual ( 1 ) ;
542561 expect ( gd . data [ 0 ] . dimensions . length ) . toEqual ( 60 ) ;
543562 expect ( document . querySelectorAll ( '.axis' ) . length ) . toEqual ( 60 ) ;
@@ -564,7 +583,7 @@ describe('parcoords edge cases', function() {
564583 mockCopy . data [ 0 ] . dimensions [ i ] = newDimension ;
565584 }
566585
567- Plotly . plot ( gd , mockCopy . data , mockCopy . layout ) . then ( function ( ) {
586+ Plotly . plot ( gd , mockCopy ) . then ( function ( ) {
568587 expect ( gd . data . length ) . toEqual ( 1 ) ;
569588 expect ( gd . data [ 0 ] . dimensions . length ) . toEqual ( 60 ) ;
570589 expect ( document . querySelectorAll ( '.axis' ) . length ) . toEqual ( 60 ) ;
@@ -595,7 +614,7 @@ describe('parcoords edge cases', function() {
595614 mockCopy . data [ 0 ] . dimensions [ 0 ] = 'This is not a plain object' ;
596615 mockCopy . data [ 0 ] . dimensions [ 1 ] . values = 'This is not an array' ;
597616
598- Plotly . plot ( gd , mockCopy . data , mockCopy . layout ) . then ( function ( ) {
617+ Plotly . plot ( gd , mockCopy ) . then ( function ( ) {
599618 expect ( gd . data . length ) . toEqual ( 1 ) ;
600619 expect ( gd . data [ 0 ] . dimensions . length ) . toEqual ( 5 ) ; // it's still five, but ...
601620 expect ( document . querySelectorAll ( '.axis' ) . length ) . toEqual ( 3 ) ; // only 3 axes shown
@@ -921,7 +940,7 @@ describe('parcoords basic use', function() {
921940 reversedMockCopy . data [ 0 ] . dimensions . forEach ( function ( d ) { d . id = 'R_' + d . id ; } ) ;
922941 reversedMockCopy . data [ 0 ] . dimensions . forEach ( function ( d ) { d . label = 'R_' + d . label ; } ) ;
923942
924- Plotly . plot ( gd , reversedMockCopy . data , reversedMockCopy . layout ) . then ( function ( ) {
943+ Plotly . plot ( gd , reversedMockCopy ) . then ( function ( ) {
925944 expect ( gd . data . length ) . toEqual ( 2 ) ;
926945
927946 expect ( gd . data [ 0 ] . dimensions . length ) . toEqual ( 11 ) ;
0 commit comments