Skip to content

Commit 1270d67

Browse files
committed
draw new points of pathbar below parents (to avoid text overlay) - improve pathbar hover position
1 parent ceb13f7 commit 1270d67

File tree

5 files changed

+5
-3
lines changed

5 files changed

+5
-3
lines changed

src/traces/treemap/draw_ancestors.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ module.exports = function drawAncestors(gd, cd, entry, slices, opts) {
7373
return true;
7474
});
7575

76+
sliceData.reverse();
77+
7678
slices = slices.data(sliceData, function(pt) { return helpers.getPtId(pt); });
7779

7880
slices.enter().append('g')
@@ -97,8 +99,8 @@ module.exports = function drawAncestors(gd, cd, entry, slices, opts) {
9799
}
98100

99101
updateSlices.each(function(pt) {
100-
pt._hoverX = viewX(pt.x0) + eachWidth / 2;
101-
pt._hoverY = viewY(pt.y0) + height / 2;
102+
pt._hoverX = viewX(pt.x1 - height / 2);
103+
pt._hoverY = viewY(pt.y1 - height / 2);
102104

103105
var sliceTop = d3.select(this);
104106

@@ -150,7 +152,7 @@ module.exports = function drawAncestors(gd, cd, entry, slices, opts) {
150152
pt.textBB = Drawing.bBox(sliceText.node());
151153
pt.transform = toMoveInsideSlice(
152154
pt.x0,
153-
Math.min(pt.x0 + eachWidth, pt.x1),
155+
pt.x1,
154156
pt.y0,
155157
pt.y1,
156158
pt.textBB,
4 Bytes
Loading
-10 Bytes
Loading
2 Bytes
Loading
-7 Bytes
Loading

0 commit comments

Comments
 (0)