Skip to content

Fix sunburst text in sectors centered around theta=180 #3907

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
May 24, 2019
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
2 changes: 1 addition & 1 deletion src/traces/sunburst/plot.js
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ function determineInsideTextFont(trace, pt, layoutFont) {
}

function getInscribedRadiusFraction(pt) {
if(pt.rpx0 === 0 && pt.xmid === Math.PI) {
if(pt.rpx0 === 0 && Lib.isFullCircle([pt.x0, pt.x1])) {
// special case of 100% with no hole
return 1;
} else {
Expand Down
Binary file added test/image/baselines/sunburst_textfit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
86 changes: 86 additions & 0 deletions test/image/mocks/sunburst_textfit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"data": [
{
"type": "sunburst",
"ids": [
"Parent Name One",
"Parent Name Two",
"Parent Name Three",
"Parent Name Four",
"Parent Name Five",
"Parent Name Six",
"Parent Name Seven",
"Parent Name One-Child 1",
"Parent Name Two-Child 2",
"Parent Name Two-Child 3",
"Parent Name Two-Child 4",
"Parent Name Two-Child 5",
"Parent Name Three-Child 6",
"Parent Name Three-Child 7",
"Parent Name Four-Child 8",
"Parent Name Four-Child 9",
"Parent Name Five-Child 10",
"Parent Name Five-Child 11",
"Parent Name Five-Child 12",
"Parent Name Six-Child 13",
"Parent Name Six-Child 14",
"Parent Name Seven-Child 15",
"Parent Name Seven-Child 16",
"Parent Name Seven-Child 17"
],
"labels": [
"Parent Name One",
"Parent Name Two",
"Parent Name Three",
"Parent Name Four",
"Parent Name Five",
"Parent Name Six",
"Parent Name Seven",
"Child 1",
"Child 2",
"Child 3",
"Child 4",
"Child 5",
"Child 6",
"Child 7",
"Child 8",
"Child 9",
"Child 10",
"Child 11",
"Child 12",
"Child 13",
"Child 14",
"Child 15",
"Child 16",
"Child 17"
],
"parents": [
"",
"",
"",
"",
"",
"",
"",
"Parent Name One",
"Parent Name Two",
"Parent Name Two",
"Parent Name Two",
"Parent Name Two",
"Parent Name Three",
"Parent Name Three",
"Parent Name Four",
"Parent Name Four",
"Parent Name Five",
"Parent Name Five",
"Parent Name Five",
"Parent Name Six",
"Parent Name Six",
"Parent Name Seven",
"Parent Name Seven",
"Parent Name Seven"
]
}
],
"layout": {}
}