@@ -224,15 +224,15 @@ function drawColorBar(g, opts, gd) {
224
224
var uFrac = optsX - thickFrac * ( { center : 0.5 , right : 1 } [ xanchor ] || 0 ) ;
225
225
226
226
// y positioning we can do correctly from the start
227
- var yBottomFrac = optsY + lenFrac * ( ( { top : - 0.5 , bottom : 0.5 } [ yanchor ] || 0 ) - 0.5 ) ;
228
- var yBottomPx = Math . round ( gs . h * ( 1 - yBottomFrac ) ) ;
229
- var yTopPx = yBottomPx - lenPx ;
227
+ var vFrac = optsY + lenFrac * ( ( { top : - 0.5 , bottom : 0.5 } [ yanchor ] || 0 ) - 0.5 ) ;
228
+ var vPx = Math . round ( gs . h * ( 1 - vFrac ) ) ;
229
+ var yTopPx = vPx - lenPx ;
230
230
231
231
// stash a few things for makeEditable
232
232
opts . _lenFrac = lenFrac ;
233
233
opts . _thickFrac = thickFrac ;
234
234
opts . _uFrac = uFrac ;
235
- opts . _yBottomFrac = yBottomFrac ;
235
+ opts . _vFrac = vFrac ;
236
236
237
237
// stash mocked axis for contour label formatting
238
238
var ax = opts . _axis = mockColorBarAxis ( gd , opts , zrange ) ;
@@ -244,15 +244,15 @@ function drawColorBar(g, opts, gd) {
244
244
if ( [ 'top' , 'bottom' ] . indexOf ( titleSide ) !== - 1 ) {
245
245
ax . title . side = titleSide ;
246
246
ax . titlex = optsX + xpadFrac ;
247
- ax . titley = yBottomFrac + ( title . side === 'top' ? lenFrac - ypadFrac : ypadFrac ) ;
247
+ ax . titley = vFrac + ( title . side === 'top' ? lenFrac - ypadFrac : ypadFrac ) ;
248
248
}
249
249
250
250
if ( line . color && opts . tickmode === 'auto' ) {
251
251
ax . tickmode = 'linear' ;
252
252
ax . tick0 = levelsIn . start ;
253
253
var dtick = levelsIn . size ;
254
254
// expand if too many contours, so we don't get too many ticks
255
- var autoNtick = Lib . constrain ( ( yBottomPx - yTopPx ) / 50 , 4 , 15 ) + 1 ;
255
+ var autoNtick = Lib . constrain ( ( vPx - yTopPx ) / 50 , 4 , 15 ) + 1 ;
256
256
var dtFactor = ( zrange [ 1 ] - zrange [ 0 ] ) / ( ( opts . nticks || autoNtick ) * dtick ) ;
257
257
if ( dtFactor > 1 ) {
258
258
var dtexp = Math . pow ( 10 , Math . floor ( Math . log ( dtFactor ) / Math . LN10 ) ) ;
@@ -270,8 +270,8 @@ function drawColorBar(g, opts, gd) {
270
270
// set domain after init, because we may want to
271
271
// allow it outside [0,1]
272
272
ax . domain = [
273
- yBottomFrac + ypadFrac ,
274
- yBottomFrac + lenFrac - ypadFrac
273
+ vFrac + ypadFrac ,
274
+ vFrac + lenFrac - ypadFrac
275
275
] ;
276
276
277
277
ax . setScale ( ) ;
@@ -317,10 +317,10 @@ function drawColorBar(g, opts, gd) {
317
317
var y ;
318
318
319
319
if ( titleSide === 'top' ) {
320
- y = ( 1 - ( yBottomFrac + lenFrac - ypadFrac ) ) * gs . h +
320
+ y = ( 1 - ( vFrac + lenFrac - ypadFrac ) ) * gs . h +
321
321
gs . t + 3 + fontSize * 0.75 ;
322
322
} else {
323
- y = ( 1 - ( yBottomFrac + ypadFrac ) ) * gs . h +
323
+ y = ( 1 - ( vFrac + ypadFrac ) ) * gs . h +
324
324
gs . t - 3 - fontSize * 0.25 ;
325
325
}
326
326
drawTitle ( ax . _id + 'title' , {
@@ -512,7 +512,7 @@ function drawColorBar(g, opts, gd) {
512
512
}
513
513
514
514
var outerwidth = 2 * xpad + innerWidth + borderwidth + outlinewidth / 2 ;
515
- var outerheight = yBottomPx - yTopPx ;
515
+ var outerheight = vPx - yTopPx ;
516
516
517
517
g . select ( '.' + cn . cbbg ) . attr ( {
518
518
x : u - xpad - ( borderwidth + outlinewidth ) / 2 ,
@@ -598,7 +598,7 @@ function makeEditable(g, opts, gd) {
598
598
599
599
xf = dragElement . align ( opts . _uFrac + ( dx / gs . w ) , opts . _thickFrac ,
600
600
0 , 1 , opts . xanchor ) ;
601
- yf = dragElement . align ( opts . _yBottomFrac - ( dy / gs . h ) , opts . _lenFrac ,
601
+ yf = dragElement . align ( opts . _vFrac - ( dy / gs . h ) , opts . _lenFrac ,
602
602
0 , 1 , opts . yanchor ) ;
603
603
604
604
var csr = dragElement . getCursor ( xf , yf , opts . xanchor , opts . yanchor ) ;
0 commit comments