@@ -219,7 +219,7 @@ function drawColorBar(g, opts, gd) {
219
219
220
220
// x positioning: do it initially just for left anchor,
221
221
// then fix at the end (since we don't know the width yet)
222
- var u = Math . round ( optsX * gs . w + xpad ) ;
222
+ var uPx = Math . round ( optsX * gs . w + xpad ) ;
223
223
// for dragging... this is getting a little muddled...
224
224
var uFrac = optsX - thickFrac * ( { center : 0.5 , right : 1 } [ xanchor ] || 0 ) ;
225
225
@@ -431,7 +431,7 @@ function drawColorBar(g, opts, gd) {
431
431
// Colorbar cannot currently support opacities so we
432
432
// use an opaque fill even when alpha channels present
433
433
var fillEl = d3 . select ( this ) . attr ( {
434
- x : u ,
434
+ x : uPx ,
435
435
width : Math . max ( thickPx , 2 ) ,
436
436
y : d3 . min ( z ) ,
437
437
height : Math . max ( d3 . max ( z ) - d3 . min ( z ) , 2 ) ,
@@ -455,15 +455,15 @@ function drawColorBar(g, opts, gd) {
455
455
lines . exit ( ) . remove ( ) ;
456
456
lines . each ( function ( d ) {
457
457
d3 . select ( this )
458
- . attr ( 'd' , 'M' + u + ',' +
458
+ . attr ( 'd' , 'M' + uPx + ',' +
459
459
( Math . round ( ax . c2p ( d ) ) + ( line . width / 2 ) % 1 ) + 'h' + thickPx )
460
460
. call ( Drawing . lineGroupStyle , line . width , lineColormap ( d ) , line . dash ) ;
461
461
} ) ;
462
462
463
463
// force full redraw of labels and ticks
464
464
axLayer . selectAll ( 'g.' + ax . _id + 'tick,path' ) . remove ( ) ;
465
465
466
- var shift = u + thickPx +
466
+ var shift = uPx + thickPx +
467
467
( outlinewidth || 0 ) / 2 - ( opts . ticks === 'outside' ? 1 : 0 ) ;
468
468
469
469
var vals = Axes . calcTicks ( ax ) ;
@@ -506,7 +506,7 @@ function drawColorBar(g, opts, gd) {
506
506
// (except for top/bottom mathjax, above)
507
507
// but the weird gs.l is because the titleunshift
508
508
// transform gets removed by Drawing.bBox
509
- titleWidth = Drawing . bBox ( titleCont . node ( ) ) . right - u - gs . l ;
509
+ titleWidth = Drawing . bBox ( titleCont . node ( ) ) . right - uPx - gs . l ;
510
510
}
511
511
innerWidth = Math . max ( innerWidth , titleWidth ) ;
512
512
}
@@ -515,7 +515,7 @@ function drawColorBar(g, opts, gd) {
515
515
var outerheight = vPx - yTopPx ;
516
516
517
517
g . select ( '.' + cn . cbbg ) . attr ( {
518
- x : u - xpad - ( borderwidth + outlinewidth ) / 2 ,
518
+ x : uPx - xpad - ( borderwidth + outlinewidth ) / 2 ,
519
519
y : yTopPx - yExtraPx ,
520
520
width : Math . max ( outerwidth , 2 ) ,
521
521
height : Math . max ( outerheight + 2 * yExtraPx , 2 )
@@ -525,7 +525,7 @@ function drawColorBar(g, opts, gd) {
525
525
. style ( 'stroke-width' , borderwidth ) ;
526
526
527
527
g . selectAll ( '.' + cn . cboutline ) . attr ( {
528
- x : u ,
528
+ x : uPx ,
529
529
y : yTopPx + ypad + ( titleSide === 'top' ? titleHeight : 0 ) ,
530
530
width : Math . max ( thickPx , 2 ) ,
531
531
height : Math . max ( outerheight - 2 * ypad - titleHeight , 2 )
0 commit comments