@@ -47,7 +47,7 @@ module.exports = function handleAxisDefaults(containerIn, containerOut, coerce,
47
47
return Lib . coerce2 ( containerIn , containerOut , layoutAttributes , attr , dflt ) ;
48
48
}
49
49
50
- coerce ( 'visible' , ! options . cheateronly ) ;
50
+ var visible = coerce ( 'visible' , ! options . cheateronly ) ;
51
51
52
52
var axType = containerOut . type ;
53
53
@@ -58,6 +58,20 @@ module.exports = function handleAxisDefaults(containerIn, containerOut, coerce,
58
58
59
59
setConvert ( containerOut , layoutOut ) ;
60
60
61
+ var autoRange = coerce ( 'autorange' , ! containerOut . isValidRange ( containerIn . range ) ) ;
62
+
63
+ if ( autoRange ) coerce ( 'rangemode' ) ;
64
+
65
+ coerce ( 'range' ) ;
66
+ containerOut . cleanRange ( ) ;
67
+
68
+ handleCategoryOrderDefaults ( containerIn , containerOut , coerce ) ;
69
+ containerOut . _initialCategories = axType === 'category' ?
70
+ orderedCategories ( letter , containerOut . categoryorder , containerOut . categoryarray , options . data ) :
71
+ [ ] ;
72
+
73
+ if ( ! visible ) return containerOut ;
74
+
61
75
var dfltColor = coerce ( 'color' ) ;
62
76
// if axis.color was provided, use it for fonts too; otherwise,
63
77
// inherit from global font color in case that was provided.
@@ -70,17 +84,9 @@ module.exports = function handleAxisDefaults(containerIn, containerOut, coerce,
70
84
color : dfltFontColor
71
85
} ) ;
72
86
73
- var autoRange = coerce ( 'autorange' , ! containerOut . isValidRange ( containerIn . range ) ) ;
74
-
75
- if ( autoRange ) coerce ( 'rangemode' ) ;
76
-
77
- coerce ( 'range' ) ;
78
- containerOut . cleanRange ( ) ;
79
-
80
87
handleTickValueDefaults ( containerIn , containerOut , coerce , axType ) ;
81
88
handleTickLabelDefaults ( containerIn , containerOut , coerce , axType , options ) ;
82
89
handleTickMarkDefaults ( containerIn , containerOut , coerce , options ) ;
83
- handleCategoryOrderDefaults ( containerIn , containerOut , coerce ) ;
84
90
85
91
var lineColor = coerce2 ( 'linecolor' , dfltColor ) ,
86
92
lineWidth = coerce2 ( 'linewidth' ) ,
@@ -111,10 +117,5 @@ module.exports = function handleAxisDefaults(containerIn, containerOut, coerce,
111
117
delete containerOut . zerolinewidth ;
112
118
}
113
119
114
- // fill in categories
115
- containerOut . _initialCategories = axType === 'category' ?
116
- orderedCategories ( letter , containerOut . categoryorder , containerOut . categoryarray , options . data ) :
117
- [ ] ;
118
-
119
120
return containerOut ;
120
121
} ;
0 commit comments