Skip to content

Commit b10a169

Browse files
committed
rename yBottom to v
1 parent 4c99aeb commit b10a169

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/components/colorbar/draw.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -224,15 +224,15 @@ function drawColorBar(g, opts, gd) {
224224
var uFrac = optsX - thickFrac * ({center: 0.5, right: 1}[xanchor] || 0);
225225

226226
// 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;
230230

231231
// stash a few things for makeEditable
232232
opts._lenFrac = lenFrac;
233233
opts._thickFrac = thickFrac;
234234
opts._uFrac = uFrac;
235-
opts._yBottomFrac = yBottomFrac;
235+
opts._vFrac = vFrac;
236236

237237
// stash mocked axis for contour label formatting
238238
var ax = opts._axis = mockColorBarAxis(gd, opts, zrange);
@@ -244,15 +244,15 @@ function drawColorBar(g, opts, gd) {
244244
if(['top', 'bottom'].indexOf(titleSide) !== -1) {
245245
ax.title.side = titleSide;
246246
ax.titlex = optsX + xpadFrac;
247-
ax.titley = yBottomFrac + (title.side === 'top' ? lenFrac - ypadFrac : ypadFrac);
247+
ax.titley = vFrac + (title.side === 'top' ? lenFrac - ypadFrac : ypadFrac);
248248
}
249249

250250
if(line.color && opts.tickmode === 'auto') {
251251
ax.tickmode = 'linear';
252252
ax.tick0 = levelsIn.start;
253253
var dtick = levelsIn.size;
254254
// 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;
256256
var dtFactor = (zrange[1] - zrange[0]) / ((opts.nticks || autoNtick) * dtick);
257257
if(dtFactor > 1) {
258258
var dtexp = Math.pow(10, Math.floor(Math.log(dtFactor) / Math.LN10));
@@ -270,8 +270,8 @@ function drawColorBar(g, opts, gd) {
270270
// set domain after init, because we may want to
271271
// allow it outside [0,1]
272272
ax.domain = [
273-
yBottomFrac + ypadFrac,
274-
yBottomFrac + lenFrac - ypadFrac
273+
vFrac + ypadFrac,
274+
vFrac + lenFrac - ypadFrac
275275
];
276276

277277
ax.setScale();
@@ -317,10 +317,10 @@ function drawColorBar(g, opts, gd) {
317317
var y;
318318

319319
if(titleSide === 'top') {
320-
y = (1 - (yBottomFrac + lenFrac - ypadFrac)) * gs.h +
320+
y = (1 - (vFrac + lenFrac - ypadFrac)) * gs.h +
321321
gs.t + 3 + fontSize * 0.75;
322322
} else {
323-
y = (1 - (yBottomFrac + ypadFrac)) * gs.h +
323+
y = (1 - (vFrac + ypadFrac)) * gs.h +
324324
gs.t - 3 - fontSize * 0.25;
325325
}
326326
drawTitle(ax._id + 'title', {
@@ -512,7 +512,7 @@ function drawColorBar(g, opts, gd) {
512512
}
513513

514514
var outerwidth = 2 * xpad + innerWidth + borderwidth + outlinewidth / 2;
515-
var outerheight = yBottomPx - yTopPx;
515+
var outerheight = vPx - yTopPx;
516516

517517
g.select('.' + cn.cbbg).attr({
518518
x: u - xpad - (borderwidth + outlinewidth) / 2,
@@ -598,7 +598,7 @@ function makeEditable(g, opts, gd) {
598598

599599
xf = dragElement.align(opts._uFrac + (dx / gs.w), opts._thickFrac,
600600
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,
602602
0, 1, opts.yanchor);
603603

604604
var csr = dragElement.getCursor(xf, yf, opts.xanchor, opts.yanchor);

0 commit comments

Comments
 (0)