@@ -184,7 +184,6 @@ module.exports = function draw(gd, id) {
184184 showticksuffix : opts . showticksuffix ,
185185 ticksuffix : opts . ticksuffix ,
186186 title : opts . title ,
187- titlefont : opts . titlefont ,
188187 showline : true ,
189188 anchor : 'free' ,
190189 side : 'right' ,
@@ -219,11 +218,11 @@ module.exports = function draw(gd, id) {
219218 // save for other callers to access this axis
220219 component . axis = cbAxisOut ;
221220
222- if ( [ 'top' , 'bottom' ] . indexOf ( opts . titleside ) !== - 1 ) {
223- cbAxisOut . titleside = opts . titleside ;
221+ if ( [ 'top' , 'bottom' ] . indexOf ( opts . title . side ) !== - 1 ) {
222+ cbAxisOut . title . side = opts . title . side ;
224223 cbAxisOut . titlex = opts . x + xpadFrac ;
225224 cbAxisOut . titley = yBottomFrac +
226- ( opts . titleside === 'top' ? lenFrac - ypadFrac : ypadFrac ) ;
225+ ( opts . title . side === 'top' ? lenFrac - ypadFrac : ypadFrac ) ;
227226 }
228227
229228 if ( opts . line . color && opts . tickmode === 'auto' ) {
@@ -286,15 +285,15 @@ module.exports = function draw(gd, id) {
286285 var axisLayer = container . select ( '.cbaxis' ) ;
287286
288287 var titleHeight = 0 ;
289- if ( [ 'top' , 'bottom' ] . indexOf ( opts . titleside ) !== - 1 ) {
288+ if ( [ 'top' , 'bottom' ] . indexOf ( opts . title . side ) !== - 1 ) {
290289 // draw the title so we know how much room it needs
291290 // when we squish the axis. This one only applies to
292291 // top or bottom titles, not right side.
293292 var x = gs . l + ( opts . x + xpadFrac ) * gs . w ,
294- fontSize = cbAxisOut . titlefont . size ,
293+ fontSize = cbAxisOut . title . font . size ,
295294 y ;
296295
297- if ( opts . titleside === 'top' ) {
296+ if ( opts . title . side === 'top' ) {
298297 y = ( 1 - ( yBottomFrac + lenFrac - ypadFrac ) ) * gs . h +
299298 gs . t + 3 + fontSize * 0.75 ;
300299 }
@@ -308,7 +307,7 @@ module.exports = function draw(gd, id) {
308307 }
309308
310309 function drawAxis ( ) {
311- if ( [ 'top' , 'bottom' ] . indexOf ( opts . titleside ) !== - 1 ) {
310+ if ( [ 'top' , 'bottom' ] . indexOf ( opts . title . side ) !== - 1 ) {
312311 // squish the axis top to make room for the title
313312 var titleGroup = container . select ( '.cbtitle' ) ,
314313 titleText = titleGroup . select ( 'text' ) ,
@@ -339,7 +338,7 @@ module.exports = function draw(gd, id) {
339338 // TODO: configurable
340339 titleHeight += 5 ;
341340
342- if ( opts . titleside === 'top' ) {
341+ if ( opts . title . side === 'top' ) {
343342 cbAxisOut . domain [ 1 ] -= titleHeight / gs . h ;
344343 titleTrans [ 1 ] *= - 1 ;
345344 }
@@ -460,8 +459,8 @@ module.exports = function draw(gd, id) {
460459 } ) ;
461460 } ,
462461 function ( ) {
463- if ( [ 'top' , 'bottom' ] . indexOf ( opts . titleside ) === - 1 ) {
464- var fontSize = cbAxisOut . titlefont . size ,
462+ if ( [ 'top' , 'bottom' ] . indexOf ( opts . title . side ) === - 1 ) {
463+ var fontSize = cbAxisOut . title . font . size ,
465464 y = cbAxisOut . _offset + cbAxisOut . _length / 2 ,
466465 x = gs . l + ( cbAxisOut . position || 0 ) * gs . w + ( ( cbAxisOut . side === 'right' ) ?
467466 10 + fontSize * ( ( cbAxisOut . showticklabels ? 1 : 0.5 ) ) :
@@ -473,7 +472,7 @@ module.exports = function draw(gd, id) {
473472 drawTitle ( 'h' + cbAxisOut . _id + 'title' , {
474473 avoid : {
475474 selection : d3 . select ( gd ) . selectAll ( 'g.' + cbAxisOut . _id + 'tick' ) ,
476- side : opts . titleside ,
475+ side : opts . title . side ,
477476 offsetLeft : gs . l ,
478477 offsetTop : 0 ,
479478 maxShift : fullLayout . width
@@ -526,11 +525,11 @@ module.exports = function draw(gd, id) {
526525 . node ( ) ,
527526 titleWidth ;
528527 if ( mathJaxNode &&
529- [ 'top' , 'bottom' ] . indexOf ( opts . titleside ) !== - 1 ) {
528+ [ 'top' , 'bottom' ] . indexOf ( opts . title . side ) !== - 1 ) {
530529 titleWidth = Drawing . bBox ( mathJaxNode ) . width ;
531530 }
532531 else {
533- // note: the formula below works for all titlesides ,
532+ // note: the formula below works for all title sides ,
534533 // (except for top/bottom mathjax, above)
535534 // but the weird gs.l is because the titleunshift
536535 // transform gets removed by Drawing.bBox
@@ -559,7 +558,7 @@ module.exports = function draw(gd, id) {
559558 container . selectAll ( '.cboutline' ) . attr ( {
560559 x : xLeft ,
561560 y : yTopPx + opts . ypad +
562- ( opts . titleside === 'top' ? titleHeight : 0 ) ,
561+ ( opts . title . side === 'top' ? titleHeight : 0 ) ,
563562 width : Math . max ( thickPx , 2 ) ,
564563 height : Math . max ( outerheight - 2 * opts . ypad - titleHeight , 2 )
565564 } )
0 commit comments