feat: Chord charts
Brief Information
This pull request is in the type of:
- [ ] bug fixing
- [x] new feature
- [ ] others
What does this PR do?
Fixed issues
Details
Before: What was the problem?
After: How does it behave after the fixing?
Document Info
One of the following should be checked.
- [ ] This PR doesn't relate to document changes
- [ ] The document should be updated later
- [ ] The document changes have been made in apache/echarts-doc#xxx
Misc
ZRender Changes
- [ ] This PR depends on ZRender changes (ecomfe/zrender#xxx).
Related test cases or examples to use the new APIs
N.A.
Others
Merging options
- [ ] Please squash the commits into a single one when merging.
Other information
Thanks for your contribution! The community will review it ASAP. In the meanwhile, please checkout the coding standard and Wiki about How to make a pull request.
The pull request is marked to be PR: author is committer because you are a committer of this project.
⚠️ MISSING DOCUMENT INFO: Please make sure one of the document options are checked in this PR's description. Search "Document Info" in the description of this PR. This should be done either by the author or the reviewers of the PR.
The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-20522@87599b5
Document changes are required in this PR. Please also make a PR to apache/echarts-doc for document changes and update the issue id in the PR description. When the doc PR is merged, the maintainers will remove the PR: awaiting doc label.
It looks beautiful.
Curious about the decision that padAngle will be set to 0 when padAngle * nodeCount >= PI * 2 instead of decreasing the padAngle until it fits.
@pissang Thanks for the review!
Curious about the decision that padAngle will be set to 0 when padAngle * nodeCount >= PI * 2 instead of decreasing the padAngle until it fits.
How do you define until it fits? For example, if padAngle is 60 degrees and nodeCount is 10, do you mean padAngle should be 360 / 10 = 36 degree? If so, then all space is used for padAngle and shows no sector at all, which I don't think should be intuitive.
I'm thinking of constraints similar to the rules in flexbox, but I'm not sure yet what exactly those rules would be.
The main issue is that the overflow transition should be smooth, not just snap back to zero. That way, users won’t feel that jarring jump when crossing the threshold. As for what you mentioned about showing no sector at all — I assume that currently, at the exact threshold point(padAngle * nodeCount == PI * 2), it is also fully hidden?
@pissang I agree about using transition should be great if appliable.
Currently, at the exact threshold point(padAngle * nodeCount == PI * 2), padAngle would be 0 and sectors will have angles linear mapping to their values.
Congratulations! Your PR has been merged. Thanks for your contribution! 👍
@Ovilia can you please push the doc changes for this cool new feature? the link here to the series option is a deadlink: https://echarts.apache.org/handbook/en/basics/release-note/v6-feature/#4.-new-chord-chart --> https://echarts.apache.org/option.html#series-chord
there are also no examples in the example inventory - those would also be awesome though some of the sankey/network ones work if the type is changed