@@ -31,13 +31,18 @@ var setConvert = require('./set_convert');
3131 * noTickson: boolean, this axis doesn't support 'tickson'
3232 * data: the plot data, used to manage categories
3333 * bgColor: the plot background color, to calculate default gridline colors
34+ * calendar:
35+ * splomStash:
36+ * visibleDflt: boolean
37+ * reverseDflt: boolean
38+ * automargin: boolean
3439 */
3540module . exports = function handleAxisDefaults ( containerIn , containerOut , coerce , options , layoutOut ) {
3641 var letter = options . letter ;
3742 var font = options . font || { } ;
3843 var splomStash = options . splomStash || { } ;
3944
40- var visible = coerce ( 'visible' , ! options . cheateronly ) ;
45+ var visible = coerce ( 'visible' , ! options . visibleDflt ) ;
4146
4247 var axType = containerOut . type ;
4348
@@ -48,7 +53,9 @@ module.exports = function handleAxisDefaults(containerIn, containerOut, coerce,
4853
4954 setConvert ( containerOut , layoutOut ) ;
5055
51- var autoRange = coerce ( 'autorange' , ! containerOut . isValidRange ( containerIn . range ) ) ;
56+ var autorangeDflt = ! containerOut . isValidRange ( containerIn . range ) ;
57+ if ( autorangeDflt && options . reverseDflt ) autorangeDflt = 'reversed' ;
58+ var autoRange = coerce ( 'autorange' , autorangeDflt ) ;
5259 if ( autoRange && ( axType === 'linear' || axType === '-' ) ) coerce ( 'rangemode' ) ;
5360
5461 coerce ( 'range' ) ;
@@ -58,8 +65,6 @@ module.exports = function handleAxisDefaults(containerIn, containerOut, coerce,
5865
5966 if ( axType !== 'category' && ! options . noHover ) coerce ( 'hoverformat' ) ;
6067
61- if ( ! visible ) return containerOut ;
62-
6368 var dfltColor = coerce ( 'color' ) ;
6469 // if axis.color was provided, use it for fonts too; otherwise,
6570 // inherit from global font color in case that was provided.
@@ -69,6 +74,9 @@ module.exports = function handleAxisDefaults(containerIn, containerOut, coerce,
6974 // try to get default title from splom trace, fallback to graph-wide value
7075 var dfltTitle = splomStash . label || layoutOut . _dfltTitle [ letter ] ;
7176
77+ handleTickLabelDefaults ( containerIn , containerOut , coerce , axType , options , { pass : 1 } ) ;
78+ if ( ! visible ) return containerOut ;
79+
7280 coerce ( 'title.text' , dfltTitle ) ;
7381 Lib . coerceFont ( coerce , 'title.font' , {
7482 family : font . family ,
@@ -77,7 +85,7 @@ module.exports = function handleAxisDefaults(containerIn, containerOut, coerce,
7785 } ) ;
7886
7987 handleTickValueDefaults ( containerIn , containerOut , coerce , axType ) ;
80- handleTickLabelDefaults ( containerIn , containerOut , coerce , axType , options ) ;
88+ handleTickLabelDefaults ( containerIn , containerOut , coerce , axType , options , { pass : 2 } ) ;
8189 handleTickMarkDefaults ( containerIn , containerOut , coerce , options ) ;
8290 handleLineGridDefaults ( containerIn , containerOut , coerce , {
8391 dfltColor : dfltColor ,
0 commit comments