Skip to content

Commit 4c85360

Browse files
committed
correct transition of text inside pathbar namely when side is bottom
1 parent a7b6074 commit 4c85360

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

Diff for: src/traces/treemap/draw_ancestors.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ module.exports = function drawAncestors(gd, cd, entry, slices, opts) {
6868

6969
pt.x0 = eachWidth * level;
7070
pt.x1 = width;
71-
pt.y0 = 0;
72-
pt.y1 = height;
71+
pt.y0 = barDifY + 0;
72+
pt.y1 = barDifY + height;
7373

7474
pt._redirect = entry.data.id;
7575

@@ -153,8 +153,8 @@ module.exports = function drawAncestors(gd, cd, entry, slices, opts) {
153153
pt.transform = toMoveInsideSlice(
154154
pt.x0,
155155
Math.min(pt.x0 + eachWidth, pt.x1),
156-
pt.y0 + barDifY,
157-
pt.y1 + barDifY,
156+
pt.y0,
157+
pt.y1,
158158
pt.textBB,
159159
{
160160
isMenu: true

Diff for: src/traces/treemap/plot.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ function plotOne(gd, cd, element, transitionOpts) {
8686
prevLookdown[helpers.getPtId(pt)];
8787
};
8888

89+
var barDifY;
8990
var getOrigin = function(pt, upDown, refRect, size) {
9091
var clicked = trace._clickedInfo;
9192
if(!clicked) {
@@ -99,8 +100,8 @@ function plotOne(gd, cd, element, transitionOpts) {
99100
if(upDown) {
100101
x0 = width; // always slide pathbar to the right, unless it is the root node
101102
x1 = width;
102-
y0 = 0;
103-
y1 = height;
103+
y0 = barDifY + 0;
104+
y1 = barDifY + height;
104105
} else {
105106
var ref = clicked.zoomOut ? refRect : prevLookdown[clicked.id] || prevLookup[clicked.id];
106107

@@ -157,6 +158,7 @@ function plotOne(gd, cd, element, transitionOpts) {
157158
vph -= (barH + barPad);
158159
}
159160
}
161+
barDifY = barTop ? -(barH + barPad) : vph + barPad;
160162

161163
var domainMidX = (domain.x[1] + domain.x[0]) / 2;
162164
var domainMidY = (domain.y[1] + domain.y[0]) / 2;
@@ -170,8 +172,7 @@ function plotOne(gd, cd, element, transitionOpts) {
170172
var viewMapX = function(x) { return cenX + x; };
171173
var viewMapY = function(y) { return cenY + y; };
172174

173-
var barDifY = barTop ? -(barH + barPad) : vph + barPad;
174-
var barY0 = viewMapY(0) + barDifY;
175+
var barY0 = viewMapY(0);
175176
var barX0 = viewMapX(0);
176177

177178
var viewDirX = function(x) { return barX0 + x; };

0 commit comments

Comments
 (0)