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

feat(scatter): jittering for category data #19941

Open
wants to merge 6 commits into
base: next
Choose a base branch
from
Open

feat(scatter): jittering for category data #19941

wants to merge 6 commits into from

Conversation

Ovilia
Copy link
Contributor

@Ovilia Ovilia commented May 16, 2024

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

This PR proposes a jittering effect for category axes and single axes, solving #18432 as well as providing a foundation to support the violin series.

image image image

It also provide an option jitterOverlap to support a beeswarm-like effect where scatters try not to overlap each other.

Screenshot 2024-05-29 at 19 06 23

Fixed issues

#18432

API Changes

A new axis.jitter option in number type, which is the jitter max range in pixels

axis
    jitter: number, max range in pixels that scatters can range from
    jitterOverlap: boolean, whether scatters can overlap each other
    jitterMargin: if jitterOverlap is false, the margin of scatters from each other

Details

Jittering is useful in scatter plots for:

  • Overlapping Data Points: Prevents points with the same or similar values from overlapping.
  • Categorical Axes: Distinguishes points within the same category.
  • Small Sample Sizes: Separates closely clustered data points.
  • Discrete Data: Helps with data naturally falling into specific values (e.g., counts).

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@5b6f4ec

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

Copy link

echarts-bot bot commented May 16, 2024

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.

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.

@Ovilia Ovilia added this to the 6.0.0 milestone May 16, 2024
@Ovilia Ovilia linked an issue May 16, 2024 that may be closed by this pull request
Copy link
Contributor

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

Ovilia added a commit to apache/echarts-doc that referenced this pull request May 17, 2024
@echarts-bot echarts-bot bot added PR: doc ready and removed PR: awaiting doc Document changes is required for this PR. labels May 17, 2024
Ovilia added a commit to apache/echarts-examples that referenced this pull request May 20, 2024
Ovilia added a commit to apache/echarts-doc that referenced this pull request May 20, 2024
@Ovilia Ovilia marked this pull request as draft May 23, 2024 06:44
@xyy7260
Copy link

xyy7260 commented May 28, 2024

@Ovilia 这个还有多久可以发布呢

@Ovilia
Copy link
Contributor Author

Ovilia commented May 29, 2024

@xyy7260 This feature is planned for ECharts 6.0, which is expected to be release in the first season of 2025. If you are interested in using it before then, you may fork it after being merged and use it locally.

@pull-request-size pull-request-size bot added size/L and removed size/S labels May 29, 2024
@Ovilia Ovilia marked this pull request as ready for review May 30, 2024 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Almost Done
Development

Successfully merging this pull request may close these issues.

[Feature] add jitter option for scatter plots
2 participants