Skip to content

Commit 648167d

Browse files
committed
correct current path when there is no parent
now no need to include empty string to hide last label on the barpath
1 parent 671e864 commit 648167d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/traces/sunburst/plot.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -567,9 +567,11 @@ exports.attachFxHandlers = function(sliceTop, entry, gd, cd, styleOne, constants
567567
if(hasFlag('value')) thisText.push(hoverPt.valueLabel);
568568
}
569569

570-
hoverPt.currentPath = pt.currentPath = helpers.getPath((pt.parent || pt).data);
571-
if(hasFlag('current path')) {
572-
thisText.push(hoverPt.currentPath);
570+
if(pt.parent) {
571+
hoverPt.currentPath = pt.currentPath = helpers.getPath(pt.parent.data);
572+
if(hasFlag('current path')) {
573+
thisText.push(hoverPt.currentPath);
574+
}
573575
}
574576

575577
var tx;

src/traces/treemap/draw_ancestors.js

-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ module.exports = function drawAncestors(gd, cd, entry, slices, opts) {
116116
});
117117

118118
var tx = helpers.getLabelStr(pt.data.data.label);
119-
if(!pt.children) tx = ' '; // don't display last label on the menu - should use space instead of empty string
120119

121120
sliceText.text(tx)
122121
.classed('slicetext', true)

0 commit comments

Comments
 (0)