@@ -219,7 +219,7 @@ function drawColorBar(g, opts, gd) {
219219
220220 // x positioning: do it initially just for left anchor,
221221 // 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 ) ;
223223 // for dragging... this is getting a little muddled...
224224 var uFrac = optsX - thickFrac * ( { center : 0.5 , right : 1 } [ xanchor ] || 0 ) ;
225225
@@ -431,7 +431,7 @@ function drawColorBar(g, opts, gd) {
431431 // Colorbar cannot currently support opacities so we
432432 // use an opaque fill even when alpha channels present
433433 var fillEl = d3 . select ( this ) . attr ( {
434- x : u ,
434+ x : uPx ,
435435 width : Math . max ( thickPx , 2 ) ,
436436 y : d3 . min ( z ) ,
437437 height : Math . max ( d3 . max ( z ) - d3 . min ( z ) , 2 ) ,
@@ -455,15 +455,15 @@ function drawColorBar(g, opts, gd) {
455455 lines . exit ( ) . remove ( ) ;
456456 lines . each ( function ( d ) {
457457 d3 . select ( this )
458- . attr ( 'd' , 'M' + u + ',' +
458+ . attr ( 'd' , 'M' + uPx + ',' +
459459 ( Math . round ( ax . c2p ( d ) ) + ( line . width / 2 ) % 1 ) + 'h' + thickPx )
460460 . call ( Drawing . lineGroupStyle , line . width , lineColormap ( d ) , line . dash ) ;
461461 } ) ;
462462
463463 // force full redraw of labels and ticks
464464 axLayer . selectAll ( 'g.' + ax . _id + 'tick,path' ) . remove ( ) ;
465465
466- var shift = u + thickPx +
466+ var shift = uPx + thickPx +
467467 ( outlinewidth || 0 ) / 2 - ( opts . ticks === 'outside' ? 1 : 0 ) ;
468468
469469 var vals = Axes . calcTicks ( ax ) ;
@@ -506,7 +506,7 @@ function drawColorBar(g, opts, gd) {
506506 // (except for top/bottom mathjax, above)
507507 // but the weird gs.l is because the titleunshift
508508 // 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 ;
510510 }
511511 innerWidth = Math . max ( innerWidth , titleWidth ) ;
512512 }
@@ -515,7 +515,7 @@ function drawColorBar(g, opts, gd) {
515515 var outerheight = vPx - yTopPx ;
516516
517517 g . select ( '.' + cn . cbbg ) . attr ( {
518- x : u - xpad - ( borderwidth + outlinewidth ) / 2 ,
518+ x : uPx - xpad - ( borderwidth + outlinewidth ) / 2 ,
519519 y : yTopPx - yExtraPx ,
520520 width : Math . max ( outerwidth , 2 ) ,
521521 height : Math . max ( outerheight + 2 * yExtraPx , 2 )
@@ -525,7 +525,7 @@ function drawColorBar(g, opts, gd) {
525525 . style ( 'stroke-width' , borderwidth ) ;
526526
527527 g . selectAll ( '.' + cn . cboutline ) . attr ( {
528- x : u ,
528+ x : uPx ,
529529 y : yTopPx + ypad + ( titleSide === 'top' ? titleHeight : 0 ) ,
530530 width : Math . max ( thickPx , 2 ) ,
531531 height : Math . max ( outerheight - 2 * ypad - titleHeight , 2 )
0 commit comments