@@ -357,6 +357,42 @@ describe('Test splom trace defaults:', function() {
357357 expect ( fullLayout . xaxis2 . type ) . toBe ( 'date' ) ;
358358 expect ( fullLayout . yaxis2 . type ) . toBe ( 'date' ) ;
359359 } ) ;
360+
361+ it ( 'axis type in layout takes precedence over dimensions setting' , function ( ) {
362+ _supply ( {
363+ dimensions : [
364+ { values : [ 1 , 2 , 1 ] , axis : { type : 'category' } } ,
365+ { values : [ 2 , 1 , 3 ] }
366+ ]
367+ } , {
368+ xaxis : { type : 'linear' } ,
369+ yaxis : { type : 'linear' } ,
370+ xaxis2 : { type : 'category' } ,
371+ yaxis2 : { type : 'category' }
372+ } ) ;
373+
374+ var fullLayout = gd . _fullLayout ;
375+ expect ( fullLayout . xaxis . type ) . toBe ( 'linear' ) ;
376+ expect ( fullLayout . yaxis . type ) . toBe ( 'linear' ) ;
377+ expect ( fullLayout . xaxis2 . type ) . toBe ( 'category' ) ;
378+ expect ( fullLayout . yaxis2 . type ) . toBe ( 'category' ) ;
379+ } ) ;
380+
381+ it ( 'axis type setting should be skipped when dimension is not visible' , function ( ) {
382+ _supply ( {
383+ dimensions : [
384+ { visible : false , values : [ 1 , 2 , 1 ] , axis : { type : 'category' } } ,
385+ { values : [ - 1 , 2 , 3 ] , axis : { type : 'category' } } ,
386+ ]
387+ } , {
388+ } ) ;
389+
390+ var fullLayout = gd . _fullLayout ;
391+ expect ( fullLayout . xaxis . type ) . toBe ( 'linear' ) ;
392+ expect ( fullLayout . yaxis . type ) . toBe ( 'linear' ) ;
393+ expect ( fullLayout . xaxis2 . type ) . toBe ( 'category' ) ;
394+ expect ( fullLayout . yaxis2 . type ) . toBe ( 'category' ) ;
395+ } ) ;
360396} ) ;
361397
362398describe ( 'Test splom trace calc step:' , function ( ) {
0 commit comments