echarts icon indicating copy to clipboard operation
echarts copied to clipboard

feat: Chord charts

Open Ovilia opened this issue 1 year ago • 2 comments

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

Ovilia avatar Nov 18 '24 10:11 Ovilia

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.

echarts-bot[bot] avatar Nov 18 '24 10:11 echarts-bot[bot]

The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-20522@87599b5

github-actions[bot] avatar Nov 18 '24 10:11 github-actions[bot]

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.

echarts-bot[bot] avatar Feb 18 '25 10:02 echarts-bot[bot]

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 avatar Mar 18 '25 11:03 pissang

@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.

Ovilia avatar Mar 24 '25 08:03 Ovilia

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 avatar Mar 24 '25 10:03 pissang

@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.

Ovilia avatar Mar 25 '25 03:03 Ovilia

Congratulations! Your PR has been merged. Thanks for your contribution! 👍

echarts-bot[bot] avatar Apr 07 '25 06:04 echarts-bot[bot]

@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

rwittbrg avatar Nov 11 '25 00:11 rwittbrg