You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature] After jitter is set for the scatter points, the scatter points are displayed with fixed coordinates. #21753
The current scenario involves the same set of scatter data. Each time the setOption method is executed, the distribution position of the scatter points in the chart changes. It is hoped that a configuration can be provided to ensure that the coordinate positions of the scatter points do not change when the data remains unchanged.
What does the proposed API look like?
The configuration mode is the same as that of jitter.
This makes sense. To achieve deterministic jitter layout when data remains unchanged, we could introduce a way to configure a custom random number generator or a random seed.
How about adding options like jitterRng (or jitterRandom) to the configuration?
Here is a quick conceptual example using a seeded random generator (like seedrandom):
@plainheart Thanks for the design.
I understand jitterRng accepts a custom RNG function returning [0,1), matching the signature of Math.random().
Two possible approaches:
Use seedrandom library as shown in the example.
Implement a simple LCG RNG without external dependencies.
The design looks flexible, and I have no objection to it.
One concern: this may add extra work for ordinary users. Anyone wanting stable jitter positions would need to add an external library or write their own RNG.
Could we add a shorthand jitterSeed option?
If jitterSeed is set, ECharts uses its built-in seeded RNG automatically for most users, while keeping jitterRng as the advanced custom override.
This is just a suggestion.
Looking forward to this feature.
Hi, @wydsjyoung, thanks for your suggestion. I agree that adding a built-in seeded RNG is easier to use for most users. I just opened PR #21765 with the proposed implementation. Feel free to review and leave your comments!
Activity
plainheart commentedon Sep 16, 2026
This makes sense. To achieve deterministic jitter layout when data remains unchanged, we could introduce a way to configure a custom random number generator or a random seed.
How about adding options like
jitterRng(orjitterRandom) to the configuration?Here is a quick conceptual example using a seeded random generator (like
seedrandom):The usage is like this,
WDYT? @100pah @Ovilia @wydsjyoung
The proposed changes for this feature are available at 02eddda .
wydsjyoung commentedon Sep 18, 2026
@plainheart Thanks for the design.
I understand
jitterRngaccepts a custom RNG function returning [0,1), matching the signature of Math.random().Two possible approaches:
The design looks flexible, and I have no objection to it.
One concern: this may add extra work for ordinary users. Anyone wanting stable jitter positions would need to add an external library or write their own RNG.
Could we add a shorthand
jitterSeedoption?If
jitterSeedis set, ECharts uses its built-in seeded RNG automatically for most users, while keepingjitterRngas the advanced custom override.This is just a suggestion.
Looking forward to this feature.
plainheart commentedon Sep 28, 2026
Hi, @wydsjyoung, thanks for your suggestion. I agree that adding a built-in seeded RNG is easier to use for most users. I just opened PR #21765 with the proposed implementation. Feel free to review and leave your comments!