Skip to content

Commit 65c0e02

Browse files
committed
display percent of root on leaf when it is an entry
1 parent 4c85360 commit 65c0e02

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ exports.formatSliceLabel = function(pt, entry, trace, cd, fullLayout) {
539539
ref = entry.data.data;
540540
calcPercent('visible');
541541
}
542-
if(hasFlag('percent root') && pt.parent) {
542+
if(hasFlag('percent root') && (pt.parent || helpers.isLeaf(pt))) {
543543
ref = cd0;
544544
calcPercent('root');
545545
}

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function plotOne(gd, cd, element, transitionOpts) {
8181
var prevLookup = {};
8282
var prevLookdown = {};
8383
var getPrev = function(pt, upDown) {
84-
return (upDown) ?
84+
return upDown ?
8585
prevLookup[helpers.getPtId(pt)] :
8686
prevLookdown[helpers.getPtId(pt)];
8787
};
@@ -498,7 +498,7 @@ function plotOne(gd, cd, element, transitionOpts) {
498498
hasTransition: hasTransition
499499
});
500500

501-
if(trace.pathbar.visible && trace.pathbar.position !== 'inside') {
501+
if(trace.pathbar.visible) {
502502
drawAncestors(gd, cd, entry, selAncestors, {
503503
barDifY: barDifY,
504504
width: barW,

Diff for: test/image/baselines/treemap_textposition.png

2.53 KB
Loading

0 commit comments

Comments
 (0)