@@ -184,7 +184,6 @@ module.exports = function draw(gd, id) {
184
184
showticksuffix : opts . showticksuffix ,
185
185
ticksuffix : opts . ticksuffix ,
186
186
title : opts . title ,
187
- titlefont : opts . titlefont ,
188
187
showline : true ,
189
188
anchor : 'free' ,
190
189
side : 'right' ,
@@ -198,6 +197,7 @@ module.exports = function draw(gd, id) {
198
197
letter : 'y' ,
199
198
font : fullLayout . font ,
200
199
noHover : true ,
200
+ noTickson : true ,
201
201
calendar : fullLayout . calendar // not really necessary (yet?)
202
202
} ;
203
203
@@ -218,11 +218,11 @@ module.exports = function draw(gd, id) {
218
218
// save for other callers to access this axis
219
219
component . axis = cbAxisOut ;
220
220
221
- if ( [ 'top' , 'bottom' ] . indexOf ( opts . titleside ) !== - 1 ) {
222
- cbAxisOut . titleside = opts . titleside ;
221
+ if ( [ 'top' , 'bottom' ] . indexOf ( opts . title . side ) !== - 1 ) {
222
+ cbAxisOut . title . side = opts . title . side ;
223
223
cbAxisOut . titlex = opts . x + xpadFrac ;
224
224
cbAxisOut . titley = yBottomFrac +
225
- ( opts . titleside === 'top' ? lenFrac - ypadFrac : ypadFrac ) ;
225
+ ( opts . title . side === 'top' ? lenFrac - ypadFrac : ypadFrac ) ;
226
226
}
227
227
228
228
if ( opts . line . color && opts . tickmode === 'auto' ) {
@@ -285,15 +285,15 @@ module.exports = function draw(gd, id) {
285
285
var axisLayer = container . select ( '.cbaxis' ) ;
286
286
287
287
var titleHeight = 0 ;
288
- if ( [ 'top' , 'bottom' ] . indexOf ( opts . titleside ) !== - 1 ) {
288
+ if ( [ 'top' , 'bottom' ] . indexOf ( opts . title . side ) !== - 1 ) {
289
289
// draw the title so we know how much room it needs
290
290
// when we squish the axis. This one only applies to
291
291
// top or bottom titles, not right side.
292
292
var x = gs . l + ( opts . x + xpadFrac ) * gs . w ,
293
- fontSize = cbAxisOut . titlefont . size ,
293
+ fontSize = cbAxisOut . title . font . size ,
294
294
y ;
295
295
296
- if ( opts . titleside === 'top' ) {
296
+ if ( opts . title . side === 'top' ) {
297
297
y = ( 1 - ( yBottomFrac + lenFrac - ypadFrac ) ) * gs . h +
298
298
gs . t + 3 + fontSize * 0.75 ;
299
299
}
@@ -307,7 +307,7 @@ module.exports = function draw(gd, id) {
307
307
}
308
308
309
309
function drawAxis ( ) {
310
- if ( [ 'top' , 'bottom' ] . indexOf ( opts . titleside ) !== - 1 ) {
310
+ if ( [ 'top' , 'bottom' ] . indexOf ( opts . title . side ) !== - 1 ) {
311
311
// squish the axis top to make room for the title
312
312
var titleGroup = container . select ( '.cbtitle' ) ,
313
313
titleText = titleGroup . select ( 'text' ) ,
@@ -338,7 +338,7 @@ module.exports = function draw(gd, id) {
338
338
// TODO: configurable
339
339
titleHeight += 5 ;
340
340
341
- if ( opts . titleside === 'top' ) {
341
+ if ( opts . title . side === 'top' ) {
342
342
cbAxisOut . domain [ 1 ] -= titleHeight / gs . h ;
343
343
titleTrans [ 1 ] *= - 1 ;
344
344
}
@@ -459,8 +459,8 @@ module.exports = function draw(gd, id) {
459
459
} ) ;
460
460
} ,
461
461
function ( ) {
462
- if ( [ 'top' , 'bottom' ] . indexOf ( opts . titleside ) === - 1 ) {
463
- var fontSize = cbAxisOut . titlefont . size ,
462
+ if ( [ 'top' , 'bottom' ] . indexOf ( opts . title . side ) === - 1 ) {
463
+ var fontSize = cbAxisOut . title . font . size ,
464
464
y = cbAxisOut . _offset + cbAxisOut . _length / 2 ,
465
465
x = gs . l + ( cbAxisOut . position || 0 ) * gs . w + ( ( cbAxisOut . side === 'right' ) ?
466
466
10 + fontSize * ( ( cbAxisOut . showticklabels ? 1 : 0.5 ) ) :
@@ -472,7 +472,7 @@ module.exports = function draw(gd, id) {
472
472
drawTitle ( 'h' + cbAxisOut . _id + 'title' , {
473
473
avoid : {
474
474
selection : d3 . select ( gd ) . selectAll ( 'g.' + cbAxisOut . _id + 'tick' ) ,
475
- side : opts . titleside ,
475
+ side : opts . title . side ,
476
476
offsetLeft : gs . l ,
477
477
offsetTop : 0 ,
478
478
maxShift : fullLayout . width
@@ -520,11 +520,11 @@ module.exports = function draw(gd, id) {
520
520
. node ( ) ,
521
521
titleWidth ;
522
522
if ( mathJaxNode &&
523
- [ 'top' , 'bottom' ] . indexOf ( opts . titleside ) !== - 1 ) {
523
+ [ 'top' , 'bottom' ] . indexOf ( opts . title . side ) !== - 1 ) {
524
524
titleWidth = Drawing . bBox ( mathJaxNode ) . width ;
525
525
}
526
526
else {
527
- // note: the formula below works for all titlesides ,
527
+ // note: the formula below works for all title sides ,
528
528
// (except for top/bottom mathjax, above)
529
529
// but the weird gs.l is because the titleunshift
530
530
// transform gets removed by Drawing.bBox
@@ -553,7 +553,7 @@ module.exports = function draw(gd, id) {
553
553
container . selectAll ( '.cboutline' ) . attr ( {
554
554
x : xLeft ,
555
555
y : yTopPx + opts . ypad +
556
- ( opts . titleside === 'top' ? titleHeight : 0 ) ,
556
+ ( opts . title . side === 'top' ? titleHeight : 0 ) ,
557
557
width : Math . max ( thickPx , 2 ) ,
558
558
height : Math . max ( outerheight - 2 * opts . ypad - titleHeight , 2 )
559
559
} )
0 commit comments