-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Ensure text fits inside sunburst sectors with zero values #4580
Conversation
if(isEmpty) { | ||
return { | ||
rCenter: 1 - rInscribed, | ||
scale: 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, by fitting inside text of zero-value sunburst sectors, you mean setting their scale
transform to 0
, correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other option (not implemented here) may be not to draw sectors with zero values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or set them with display: 'none'
, to keep the sector <--> node map 1:1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... but really, this is fine. It allows us to keep all the logic in transformInsideText
.
Nicely done 💃 |
Fixes #4569 | Demo before vs after
@plotly/plotly_js
cc: @emmanuelle