fix(sunburst): fix root node label may not be centered#21306
fix(sunburst): fix root node label may not be centered#21306Ovilia merged 3 commits intoapache:masterfrom
Conversation
|
Thanks for your contribution! |
|
@Ovilia Can you review the PR |
|
The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-21306@9c07df0 |
c611cba to
2362925
Compare
There was a problem hiding this comment.
Based on the test case you provided, if you print out console.log(angle, layout.r0, layout.r0 === 0, angle === 2 * Math.PI);, you should see SunburstPiece.ts:236 6.283185307179587 0 true false, which means the problem is caused by the precision of Math.PI * 2. So this can be simply fixed as
if (layout.r0 === 0 && isRadianAroundZero(angle - 2 * Math.PI))
And please don't use forced pushes because we need to reserve the commit history. Thanks!
@Ovilia Thank you for the feedback. I guess it works perfectly. can you take a look now |
|
Congratulations! Your PR has been merged. Thanks for your contribution! 👍 |
|
Hey @Ovilia , may I ask , when the 6.0.1 planned for a release as we want to integrate this change |
Brief Information
This pull request is in the type of:
What does this PR do?
The PR aligns the root node label in sunburst chart at the center.
Fixed issues
This is enhancement request
Details
Before: What was the problem?
The root node label would appear at the bottom half of the inner circle in non expanded mode. there is no way that we could align it to center.
After: How does it behave after the fixing?
Document Info
One of the following should be checked.
Misc
ZRender Changes
Related test cases or examples to use the new APIs
N.A.
Others
Merging options
Other information