File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -15,15 +15,19 @@ var Lib = require('../../lib');
15
15
var BADNUM = require ( '../../constants/numerical' ) . BADNUM ;
16
16
17
17
module . exports = function autoType ( array , calendar , opts ) {
18
- if ( Lib . isArrayOrTypedArray ( array ) && ! array . length ) return '-' ;
19
- if ( ! opts . noMultiCategory && multiCategory ( array ) ) return 'multicategory' ;
18
+ var a = array ;
20
19
21
- if ( Lib . isArrayOrTypedArray ( array [ 0 ] ) ) return '-' ;
22
- if ( moreDates ( array , calendar ) ) return 'date' ;
20
+ if ( Lib . isArrayOrTypedArray ( a ) && ! a . length ) return '-' ;
21
+ if ( ! opts . noMultiCategory && multiCategory ( a ) ) return 'multicategory' ;
22
+ if ( opts . noMultiCategory && Lib . isArrayOrTypedArray ( a [ 0 ] ) ) {
23
+ a = a . flat ( ) ; // TODO: add support for IE
24
+ }
25
+
26
+ if ( moreDates ( a , calendar ) ) return 'date' ;
23
27
24
28
var convertNumeric = opts . autotypenumbers !== 'strict' ; // compare against strict, just in case autotypenumbers was not provided in opts
25
- if ( category ( array , convertNumeric ) ) return 'category' ;
26
- if ( linearOK ( array , convertNumeric ) ) return 'linear' ;
29
+ if ( category ( a , convertNumeric ) ) return 'category' ;
30
+ if ( linearOK ( a , convertNumeric ) ) return 'linear' ;
27
31
28
32
return '-' ;
29
33
} ;
Original file line number Diff line number Diff line change @@ -332,7 +332,7 @@ describe('Test axes', function() {
332
332
[ 'd' , 'e' , 'f' ]
333
333
]
334
334
} ) ;
335
- checkTypes ( 'linear' , 'linear ' ) ;
335
+ checkTypes ( 'linear' , 'category ' ) ;
336
336
} ) ;
337
337
} ) ;
338
338
You can’t perform that action at this time.
0 commit comments