@@ -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' ,
@@ -198,6 +197,7 @@ module.exports = function draw(gd, id) {
198197 letter : 'y' ,
199198 font : fullLayout . font ,
200199 noHover : true ,
200+ noTickson : true ,
201201 calendar : fullLayout . calendar // not really necessary (yet?)
202202 } ;
203203
@@ -218,11 +218,11 @@ module.exports = function draw(gd, id) {
218218 // save for other callers to access this axis
219219 component . axis = cbAxisOut ;
220220
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 ;
223223 cbAxisOut . titlex = opts . x + xpadFrac ;
224224 cbAxisOut . titley = yBottomFrac +
225- ( opts . titleside === 'top' ? lenFrac - ypadFrac : ypadFrac ) ;
225+ ( opts . title . side === 'top' ? lenFrac - ypadFrac : ypadFrac ) ;
226226 }
227227
228228 if ( opts . line . color && opts . tickmode === 'auto' ) {
@@ -285,15 +285,15 @@ module.exports = function draw(gd, id) {
285285 var axisLayer = container . select ( '.cbaxis' ) ;
286286
287287 var titleHeight = 0 ;
288- if ( [ 'top' , 'bottom' ] . indexOf ( opts . titleside ) !== - 1 ) {
288+ if ( [ 'top' , 'bottom' ] . indexOf ( opts . title . side ) !== - 1 ) {
289289 // draw the title so we know how much room it needs
290290 // when we squish the axis. This one only applies to
291291 // top or bottom titles, not right side.
292292 var x = gs . l + ( opts . x + xpadFrac ) * gs . w ,
293- fontSize = cbAxisOut . titlefont . size ,
293+ fontSize = cbAxisOut . title . font . size ,
294294 y ;
295295
296- if ( opts . titleside === 'top' ) {
296+ if ( opts . title . side === 'top' ) {
297297 y = ( 1 - ( yBottomFrac + lenFrac - ypadFrac ) ) * gs . h +
298298 gs . t + 3 + fontSize * 0.75 ;
299299 }
@@ -307,7 +307,7 @@ module.exports = function draw(gd, id) {
307307 }
308308
309309 function drawAxis ( ) {
310- if ( [ 'top' , 'bottom' ] . indexOf ( opts . titleside ) !== - 1 ) {
310+ if ( [ 'top' , 'bottom' ] . indexOf ( opts . title . side ) !== - 1 ) {
311311 // squish the axis top to make room for the title
312312 var titleGroup = container . select ( '.cbtitle' ) ,
313313 titleText = titleGroup . select ( 'text' ) ,
@@ -338,7 +338,7 @@ module.exports = function draw(gd, id) {
338338 // TODO: configurable
339339 titleHeight += 5 ;
340340
341- if ( opts . titleside === 'top' ) {
341+ if ( opts . title . side === 'top' ) {
342342 cbAxisOut . domain [ 1 ] -= titleHeight / gs . h ;
343343 titleTrans [ 1 ] *= - 1 ;
344344 }
@@ -459,8 +459,8 @@ module.exports = function draw(gd, id) {
459459 } ) ;
460460 } ,
461461 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 ,
464464 y = cbAxisOut . _offset + cbAxisOut . _length / 2 ,
465465 x = gs . l + ( cbAxisOut . position || 0 ) * gs . w + ( ( cbAxisOut . side === 'right' ) ?
466466 10 + fontSize * ( ( cbAxisOut . showticklabels ? 1 : 0.5 ) ) :
@@ -472,7 +472,7 @@ module.exports = function draw(gd, id) {
472472 drawTitle ( 'h' + cbAxisOut . _id + 'title' , {
473473 avoid : {
474474 selection : d3 . select ( gd ) . selectAll ( 'g.' + cbAxisOut . _id + 'tick' ) ,
475- side : opts . titleside ,
475+ side : opts . title . side ,
476476 offsetLeft : gs . l ,
477477 offsetTop : 0 ,
478478 maxShift : fullLayout . width
@@ -520,11 +520,11 @@ module.exports = function draw(gd, id) {
520520 . node ( ) ,
521521 titleWidth ;
522522 if ( mathJaxNode &&
523- [ 'top' , 'bottom' ] . indexOf ( opts . titleside ) !== - 1 ) {
523+ [ 'top' , 'bottom' ] . indexOf ( opts . title . side ) !== - 1 ) {
524524 titleWidth = Drawing . bBox ( mathJaxNode ) . width ;
525525 }
526526 else {
527- // note: the formula below works for all titlesides ,
527+ // note: the formula below works for all title sides ,
528528 // (except for top/bottom mathjax, above)
529529 // but the weird gs.l is because the titleunshift
530530 // transform gets removed by Drawing.bBox
@@ -553,7 +553,7 @@ module.exports = function draw(gd, id) {
553553 container . selectAll ( '.cboutline' ) . attr ( {
554554 x : xLeft ,
555555 y : yTopPx + opts . ypad +
556- ( opts . titleside === 'top' ? titleHeight : 0 ) ,
556+ ( opts . title . side === 'top' ? titleHeight : 0 ) ,
557557 width : Math . max ( thickPx , 2 ) ,
558558 height : Math . max ( outerheight - 2 * opts . ypad - titleHeight , 2 )
559559 } )
0 commit comments