@@ -462,20 +462,19 @@ function drawColorBar(g, opts, gd) {
462462 ( opts . outlinewidth || 0 ) / 2 - ( opts . ticks === 'outside' ? 1 : 0 ) ;
463463
464464 var vals = Axes . calcTicks ( ax ) ;
465- var transFn = Axes . makeTransTickFn ( ax ) ;
466465 var tickSign = Axes . getTickSigns ( ax ) [ 2 ] ;
467466
468467 Axes . drawTicks ( gd , ax , {
469468 vals : ax . ticks === 'inside' ? Axes . clipEnds ( ax , vals ) : vals ,
470469 layer : axLayer ,
471470 path : Axes . makeTickPath ( ax , shift , tickSign ) ,
472- transFn : transFn
471+ transFn : Axes . makeTransTickFn ( ax )
473472 } ) ;
474473
475474 return Axes . drawLabels ( gd , ax , {
476475 vals : vals ,
477476 layer : axLayer ,
478- transFn : transFn ,
477+ transFn : Axes . makeTransTickLabelFn ( ax ) ,
479478 labelFns : Axes . makeLabelFns ( ax , shift )
480479 } ) ;
481480 }
@@ -485,7 +484,11 @@ function drawColorBar(g, opts, gd) {
485484 // TODO: why are we redrawing multiple times now with this?
486485 // I guess autoMargin doesn't like being post-promise?
487486 function positionCB ( ) {
488- var innerWidth = thickPx + opts . outlinewidth / 2 + Drawing . bBox ( axLayer . node ( ) ) . width ;
487+ var innerWidth = thickPx + opts . outlinewidth / 2 ;
488+ if ( ax . ticklabelposition . indexOf ( 'inside' ) === - 1 ) {
489+ innerWidth += Drawing . bBox ( axLayer . node ( ) ) . width ;
490+ }
491+
489492 titleEl = titleCont . select ( 'text' ) ;
490493
491494 if ( titleEl . node ( ) && ! titleEl . classed ( cn . jsPlaceholder ) ) {
@@ -681,6 +684,7 @@ function mockColorBarAxis(gd, opts, zrange) {
681684 tickwidth : opts . tickwidth ,
682685 tickcolor : opts . tickcolor ,
683686 showticklabels : opts . showticklabels ,
687+ ticklabelposition : opts . ticklabelposition ,
684688 tickfont : opts . tickfont ,
685689 tickangle : opts . tickangle ,
686690 tickformat : opts . tickformat ,
@@ -710,7 +714,6 @@ function mockColorBarAxis(gd, opts, zrange) {
710714 noHover : true ,
711715 noTickson : true ,
712716 noTicklabelmode : true ,
713- noTicklabelposition : true ,
714717 calendar : fullLayout . calendar // not really necessary (yet?)
715718 } ;
716719
0 commit comments