@@ -462,20 +462,19 @@ function drawColorBar(g, opts, gd) {
462
462
( opts . outlinewidth || 0 ) / 2 - ( opts . ticks === 'outside' ? 1 : 0 ) ;
463
463
464
464
var vals = Axes . calcTicks ( ax ) ;
465
- var transFn = Axes . makeTransTickFn ( ax ) ;
466
465
var tickSign = Axes . getTickSigns ( ax ) [ 2 ] ;
467
466
468
467
Axes . drawTicks ( gd , ax , {
469
468
vals : ax . ticks === 'inside' ? Axes . clipEnds ( ax , vals ) : vals ,
470
469
layer : axLayer ,
471
470
path : Axes . makeTickPath ( ax , shift , tickSign ) ,
472
- transFn : transFn
471
+ transFn : Axes . makeTransTickFn ( ax )
473
472
} ) ;
474
473
475
474
return Axes . drawLabels ( gd , ax , {
476
475
vals : vals ,
477
476
layer : axLayer ,
478
- transFn : transFn ,
477
+ transFn : Axes . makeTransTickLabelFn ( ax ) ,
479
478
labelFns : Axes . makeLabelFns ( ax , shift )
480
479
} ) ;
481
480
}
@@ -485,7 +484,11 @@ function drawColorBar(g, opts, gd) {
485
484
// TODO: why are we redrawing multiple times now with this?
486
485
// I guess autoMargin doesn't like being post-promise?
487
486
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
+
489
492
titleEl = titleCont . select ( 'text' ) ;
490
493
491
494
if ( titleEl . node ( ) && ! titleEl . classed ( cn . jsPlaceholder ) ) {
@@ -681,6 +684,7 @@ function mockColorBarAxis(gd, opts, zrange) {
681
684
tickwidth : opts . tickwidth ,
682
685
tickcolor : opts . tickcolor ,
683
686
showticklabels : opts . showticklabels ,
687
+ ticklabelposition : opts . ticklabelposition ,
684
688
tickfont : opts . tickfont ,
685
689
tickangle : opts . tickangle ,
686
690
tickformat : opts . tickformat ,
@@ -710,7 +714,6 @@ function mockColorBarAxis(gd, opts, zrange) {
710
714
noHover : true ,
711
715
noTickson : true ,
712
716
noTicklabelmode : true ,
713
- noTicklabelposition : true ,
714
717
calendar : fullLayout . calendar // not really necessary (yet?)
715
718
} ;
716
719
0 commit comments