Skip to content

Apply root.color in treemap & sunburst style and adopt tests #5245

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/traces/treemap/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ function styleOne(s, pt, trace, opts) {
lineColor = trace._hovered.marker.line.color;
lineWidth = trace._hovered.marker.line.width;
} else {
if(isRoot && fillColor === 'rgba(0,0,0,0)') {
opacity = 0;
if(isRoot && fillColor === trace.root.color) {
opacity = 100;
lineColor = 'rgba(0,0,0,0)';
lineWidth = 0;
} else {
Expand Down
Binary file modified test/image/baselines/sunburst_inside-text-orientation_clock.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/treemap_textposition.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions test/image/mocks/sunburst_inside-text-orientation_clock.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"name": "horizontal",
"insidetextorientation": "horizontal",
"type": "sunburst",
"root": { "color": "yellow" },
"parents": [
"",
"A",
Expand Down Expand Up @@ -77,6 +78,7 @@
"name": "radial",
"insidetextorientation": "radial",
"type": "sunburst",
"root": { "color": "yellow" },
"parents": [
"",
"A",
Expand Down Expand Up @@ -150,6 +152,7 @@
"name": "tangential",
"insidetextorientation": "tangential",
"type": "sunburst",
"root": { "color": "yellow" },
"parents": [
"",
"A",
Expand Down Expand Up @@ -223,6 +226,7 @@
"name": "auto",
"insidetextorientation": "auto",
"type": "sunburst",
"root": { "color": "yellow" },
"parents": [
"",
"A",
Expand Down
9 changes: 9 additions & 0 deletions test/image/mocks/treemap_textposition.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"data": [
{
"type": "treemap",
"root": { "color": "yellow" },
"textinfo": "label+text+percent parent+percent entry+percent root",
"name": "bottom left textposition",
"textposition": "bottom left",
Expand Down Expand Up @@ -110,6 +111,7 @@
},
{
"type": "treemap",
"root": { "color": "yellow" },
"textinfo": "label+text+percent parent+percent entry+percent root",
"name": "bottom center textposition",
"textposition": "bottom center",
Expand Down Expand Up @@ -219,6 +221,7 @@
},
{
"type": "treemap",
"root": { "color": "yellow" },
"textinfo": "label+text+percent parent+percent entry+percent root",
"name": "bottom right textposition",
"textposition": "bottom right",
Expand Down Expand Up @@ -330,6 +333,7 @@
},
{
"type": "treemap",
"root": { "color": "yellow" },
"textinfo": "label+text+percent parent+percent entry+percent root",
"name": "middle left textposition",
"textposition": "middle left",
Expand Down Expand Up @@ -436,6 +440,7 @@
},
{
"type": "treemap",
"root": { "color": "yellow" },
"textinfo": "label+text+percent parent+percent entry+percent root",
"name": "middle center textposition",
"textposition": "middle center",
Expand Down Expand Up @@ -543,6 +548,7 @@
},
{
"type": "treemap",
"root": { "color": "yellow" },
"textinfo": "label+text+percent parent+percent entry+percent root",
"name": "middle right textposition",
"textposition": "middle right",
Expand Down Expand Up @@ -649,6 +655,7 @@
},
{
"type": "treemap",
"root": { "color": "yellow" },
"textinfo": "label+text+percent parent+percent entry+percent root",
"name": "top left textposition",
"textposition": "top left",
Expand Down Expand Up @@ -759,6 +766,7 @@
},
{
"type": "treemap",
"root": { "color": "yellow" },
"textinfo": "label+text+percent parent+percent entry+percent root",
"name": "top center textposition",
"textposition": "top center",
Expand Down Expand Up @@ -869,6 +877,7 @@
},
{
"type": "treemap",
"root": { "color": "yellow" },
"textinfo": "label+text+percent parent+percent entry+percent root",
"name": "top right textposition",
"textposition": "top right",
Expand Down