Skip to content
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

Merged
merged 3 commits into from
Feb 13, 2020

Conversation

archmoj
Copy link
Contributor

@archmoj archmoj commented Feb 13, 2020

Fixes #4569 | Demo before vs after

@plotly/plotly_js
cc: @emmanuelle

@archmoj archmoj added bug something broken status: reviewable labels Feb 13, 2020
if(isEmpty) {
return {
rCenter: 1 - rInscribed,
scale: 0,
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct.

Copy link
Contributor Author

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.

Copy link
Contributor

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

Copy link
Contributor

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.

@etpinard
Copy link
Contributor

Nicely done 💃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sunburst text does not fit inside for 0-valued sectors
2 participants