Skip to content

Commit 6130f96

Browse files
committed
rename key to
1 parent e7e22c6 commit 6130f96

16 files changed

+64
-48
lines changed

src/traces/sunburst/attributes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ module.exports = {
158158
'value',
159159
'current path',
160160
'percent root',
161-
'percent visible',
161+
'percent entry',
162162
'percent parent'
163163
],
164164
extras: ['none'],
@@ -182,7 +182,7 @@ module.exports = {
182182
'name',
183183
'current path',
184184
'percent root',
185-
'percent visible',
185+
'percent entry',
186186
'percent parent'
187187
],
188188
dflt: 'label+text+value+name'

src/traces/sunburst/constants.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,20 @@ module.exports = {
1212
CLICK_TRANSITION_TIME: 750,
1313
CLICK_TRANSITION_EASING: 'linear',
1414
eventDataKeys: [
15+
// string
16+
'root',
17+
'entry',
18+
// 'parent', // no need to add parent here which is added somewhere else!
1519
'currentPath',
20+
21+
// percentages i.e. ratios
1622
'percentRoot',
17-
'percentVisible',
23+
'percentEntry',
1824
'percentParent',
19-
'root',
20-
'visible',
21-
'parent'
25+
26+
// sums
27+
'sumRoot',
28+
'sumEntry',
29+
'sumParent'
2230
]
2331
};

src/traces/sunburst/fx.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,10 @@ module.exports = function attachFxHandlers(sliceTop, entry, gd, cd, opts) {
115115

116116
var ref1 = entry;
117117
if(ref1 && getVal(ref1)) {
118-
hoverPt.percentVisible = pt.percentVisible = val / getVal(ref1);
119-
hoverPt.visible = pt.visible = helpers.getLabelString(ref1.data.data.label);
120-
if(hasFlag('percent visible')) {
121-
tx = helpers.formatPercent(hoverPt.percentVisible, separators) + ' of ' + hoverPt.visible;
118+
hoverPt.percentEntry = pt.percentEntry = val / getVal(ref1);
119+
hoverPt.entry = pt.entry = helpers.getLabelString(ref1.data.data.label);
120+
if(hasFlag('percent entry')) {
121+
tx = helpers.formatPercent(hoverPt.percentEntry, separators) + ' of ' + hoverPt.entry;
122122
insertPercent();
123123
}
124124
}

src/traces/sunburst/plot.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ exports.formatSliceLabel = function(pt, entry, trace, cd, fullLayout) {
519519

520520
var nPercent = 0;
521521
if(hasFlag('percent parent')) nPercent++;
522-
if(hasFlag('percent visible')) nPercent++;
522+
if(hasFlag('percent entry')) nPercent++;
523523
if(hasFlag('percent root')) nPercent++;
524524
var hasMultiplePercents = nPercent > 1;
525525

@@ -541,9 +541,9 @@ exports.formatSliceLabel = function(pt, entry, trace, cd, fullLayout) {
541541
ref = pt.parent;
542542
makePercent('parent');
543543
}
544-
if(hasFlag('percent visible') && pt.parent) {
544+
if(hasFlag('percent entry') && pt.parent) {
545545
ref = entry;
546-
makePercent('visible');
546+
makePercent('entry');
547547
}
548548
if(hasFlag('percent root') && (pt.parent || helpers.isLeaf(pt))) {
549549
ref = hierarchy;
@@ -580,11 +580,11 @@ exports.formatSliceLabel = function(pt, entry, trace, cd, fullLayout) {
580580
}
581581

582582
ref = entry;
583-
obj.percentVisible = calcPercent();
584-
obj.percentVisibleLabel = helpers.formatPercent(
585-
obj.percentVisible, separators
583+
obj.percentEntry = calcPercent();
584+
obj.percentEntryLabel = helpers.formatPercent(
585+
obj.percentEntry, separators
586586
);
587-
obj.visible = ref.data.data.label;
587+
obj.entry = ref.data.data.label;
588588

589589
ref = hierarchy;
590590
obj.percentRoot = calcPercent();

src/traces/treemap/constants.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,21 @@ module.exports = {
1212
CLICK_TRANSITION_TIME: 750,
1313
CLICK_TRANSITION_EASING: 'poly',
1414
eventDataKeys: [
15+
// string
16+
'root',
17+
'entry',
18+
// 'parent', // no need to add parent here which is added somewhere else!
1519
'currentPath',
20+
21+
// percentages i.e. ratios
1622
'percentRoot',
17-
'percentVisible',
23+
'percentEntry',
1824
'percentParent',
19-
'root',
20-
'visible',
21-
'parent'
25+
26+
// sums
27+
'sumRoot',
28+
'sumEntry',
29+
'sumParent'
2230
],
2331
gapWithPathbar: 1 // i.e. one pixel
2432
};
-202 Bytes
Loading
-581 Bytes
Loading
-1.84 KB
Loading
-337 Bytes
Loading
-1.56 KB
Loading

0 commit comments

Comments
 (0)