Skip to content

Commit 06def17

Browse files
committed
rename to hColorbarMoveTitle
1 parent 3c11c1f commit 06def17

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

src/components/colorbar/draw.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -651,21 +651,22 @@ function drawColorBar(g, opts, gd) {
651651
ypad
652652
) * 2 + innerThickness + borderwidth + outlinewidth / 2;
653653

654-
var gapTitleHColorbar = 0;
654+
var hColorbarMoveTitle = 0;
655655
if(!isVertical && title.text && optsY <= 0) {
656-
gapTitleHColorbar = outerThickness / 2;
656+
hColorbarMoveTitle = outerThickness / 2;
657657

658-
outerThickness += gapTitleHColorbar;
659-
moveY += gapTitleHColorbar;
658+
outerThickness += hColorbarMoveTitle;
659+
moveY += hColorbarMoveTitle;
660660
}
661-
gd._fullLayout._gapTitleHColorbar = gapTitleHColorbar;
661+
fullLayout._hColorbarMoveTitle = hColorbarMoveTitle;
662+
fullLayout._hColorbarMoveCBTitle = moveY;
662663

663664
var extraW = borderwidth + outlinewidth;
664665

665666
g.select('.' + cn.cbbg)
666667
.attr('x', (isVertical ? uPx : vPx) - extraW / 2 - (isVertical ? xpad : 0))
667-
.attr('y', (isVertical ? vPx : uPx) - (isVertical ? lenPx : ypad + moveY - gapTitleHColorbar))
668-
.attr(isVertical ? 'width' : 'height', Math.max(outerThickness - gapTitleHColorbar, 2))
668+
.attr('y', (isVertical ? vPx : uPx) - (isVertical ? lenPx : ypad + moveY - hColorbarMoveTitle))
669+
.attr(isVertical ? 'width' : 'height', Math.max(outerThickness - hColorbarMoveTitle, 2))
669670
.attr(isVertical ? 'height' : 'width', Math.max(lenPx + extraW, 2))
670671
.call(Color.fill, opts.bgcolor)
671672
.call(Color.stroke, opts.bordercolor)

src/components/titles/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ function draw(gd, titleClass, options) {
9696

9797
var elShouldExist = txt || editable;
9898

99-
var gapTitleHColorbar;
99+
var hColorbarMoveTitle;
100100
if(!group) {
101101
group = Lib.ensureSingle(fullLayout._infolayer, 'g', 'g-' + titleClass);
102-
gapTitleHColorbar = fullLayout._gapTitleHColorbar;
102+
hColorbarMoveTitle = fullLayout._hColorbarMoveTitle;
103103
}
104104

105105
var el = group.selectAll('text')
@@ -123,7 +123,7 @@ function draw(gd, titleClass, options) {
123123
function drawTitle(titleEl) {
124124
var transformVal;
125125

126-
if(!transform && gapTitleHColorbar) {
126+
if(!transform && hColorbarMoveTitle) {
127127
transform = {};
128128
}
129129

@@ -132,8 +132,8 @@ function draw(gd, titleClass, options) {
132132
if(transform.rotate) {
133133
transformVal += 'rotate(' + [transform.rotate, attributes.x, attributes.y] + ')';
134134
}
135-
if(transform.offset || gapTitleHColorbar) {
136-
transformVal += strTranslate(0, (transform.offset || 0) - (gapTitleHColorbar || 0));
135+
if(transform.offset || hColorbarMoveTitle) {
136+
transformVal += strTranslate(0, (transform.offset || 0) - (hColorbarMoveTitle || 0));
137137
}
138138
} else {
139139
transformVal = null;

0 commit comments

Comments
 (0)