Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b5caa8f

Browse filesBrowse files
authored
Merge pull request plotly#5245 from plotly/rootcolor-tests
Apply root.color in treemap & sunburst style and adopt tests
2 parents aad34f1 + 03ea08d commit b5caa8f
Copy full SHA for b5caa8f

File tree

Expand file treeCollapse file tree

5 files changed

+15
-2
lines changed
Filter options
Expand file treeCollapse file tree

5 files changed

+15
-2
lines changed

‎src/traces/treemap/style.js

Copy file name to clipboardExpand all lines: src/traces/treemap/style.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ function styleOne(s, pt, trace, opts) {
4747
lineColor = trace._hovered.marker.line.color;
4848
lineWidth = trace._hovered.marker.line.width;
4949
} else {
50-
if(isRoot && fillColor === 'rgba(0,0,0,0)') {
51-
opacity = 0;
50+
if(isRoot && fillColor === trace.root.color) {
51+
opacity = 100;
5252
lineColor = 'rgba(0,0,0,0)';
5353
lineWidth = 0;
5454
} else {
Loading
884 Bytes
Loading

‎test/image/mocks/sunburst_inside-text-orientation_clock.json

Copy file name to clipboardExpand all lines: test/image/mocks/sunburst_inside-text-orientation_clock.json
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"name": "horizontal",
55
"insidetextorientation": "horizontal",
66
"type": "sunburst",
7+
"root": { "color": "yellow" },
78
"parents": [
89
"",
910
"A",
@@ -77,6 +78,7 @@
7778
"name": "radial",
7879
"insidetextorientation": "radial",
7980
"type": "sunburst",
81+
"root": { "color": "yellow" },
8082
"parents": [
8183
"",
8284
"A",
@@ -150,6 +152,7 @@
150152
"name": "tangential",
151153
"insidetextorientation": "tangential",
152154
"type": "sunburst",
155+
"root": { "color": "yellow" },
153156
"parents": [
154157
"",
155158
"A",
@@ -223,6 +226,7 @@
223226
"name": "auto",
224227
"insidetextorientation": "auto",
225228
"type": "sunburst",
229+
"root": { "color": "yellow" },
226230
"parents": [
227231
"",
228232
"A",

‎test/image/mocks/treemap_textposition.json

Copy file name to clipboardExpand all lines: test/image/mocks/treemap_textposition.json
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"data": [
33
{
44
"type": "treemap",
5+
"root": { "color": "yellow" },
56
"textinfo": "label+text+percent parent+percent entry+percent root",
67
"name": "bottom left textposition",
78
"textposition": "bottom left",
@@ -110,6 +111,7 @@
110111
},
111112
{
112113
"type": "treemap",
114+
"root": { "color": "yellow" },
113115
"textinfo": "label+text+percent parent+percent entry+percent root",
114116
"name": "bottom center textposition",
115117
"textposition": "bottom center",
@@ -219,6 +221,7 @@
219221
},
220222
{
221223
"type": "treemap",
224+
"root": { "color": "yellow" },
222225
"textinfo": "label+text+percent parent+percent entry+percent root",
223226
"name": "bottom right textposition",
224227
"textposition": "bottom right",
@@ -330,6 +333,7 @@
330333
},
331334
{
332335
"type": "treemap",
336+
"root": { "color": "yellow" },
333337
"textinfo": "label+text+percent parent+percent entry+percent root",
334338
"name": "middle left textposition",
335339
"textposition": "middle left",
@@ -436,6 +440,7 @@
436440
},
437441
{
438442
"type": "treemap",
443+
"root": { "color": "yellow" },
439444
"textinfo": "label+text+percent parent+percent entry+percent root",
440445
"name": "middle center textposition",
441446
"textposition": "middle center",
@@ -543,6 +548,7 @@
543548
},
544549
{
545550
"type": "treemap",
551+
"root": { "color": "yellow" },
546552
"textinfo": "label+text+percent parent+percent entry+percent root",
547553
"name": "middle right textposition",
548554
"textposition": "middle right",
@@ -649,6 +655,7 @@
649655
},
650656
{
651657
"type": "treemap",
658+
"root": { "color": "yellow" },
652659
"textinfo": "label+text+percent parent+percent entry+percent root",
653660
"name": "top left textposition",
654661
"textposition": "top left",
@@ -759,6 +766,7 @@
759766
},
760767
{
761768
"type": "treemap",
769+
"root": { "color": "yellow" },
762770
"textinfo": "label+text+percent parent+percent entry+percent root",
763771
"name": "top center textposition",
764772
"textposition": "top center",
@@ -869,6 +877,7 @@
869877
},
870878
{
871879
"type": "treemap",
880+
"root": { "color": "yellow" },
872881
"textinfo": "label+text+percent parent+percent entry+percent root",
873882
"name": "top right textposition",
874883
"textposition": "top right",

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.