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
fix(jitter): fix overlap when there is enough space to avoid - #21067
The jittering implementation of 6.0.0-beta.1 has a bug that sometimes even when there is enough space to avoid overlap, it still overlaps.
This was because I used a double linked list to improve overlapping checking speed. When using a double linked list, I only need to check from the last scatter to see if it overlaps. But this is not correct because the previous scatters may also overlap. And when moving the new one to be farther, it can also overlap with previous nodes with slightly different value, not just the last one. So instead of a link, this PR proposes to use an ordinary array so the logic is even easier to follow; and it always checks all nodes to test overlapping instead of only the last one.
Fixed issues
Details
Before: What was the problem?
Overlap happens when there could be enough space.
After: How does it behave after the fixing?
There should be no overlap when there could be enough space.
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.
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.
Congratulations! Your PR has been merged. Thanks for your contribution! 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brief Information
This pull request is in the type of:
What does this PR do?
The jittering implementation of 6.0.0-beta.1 has a bug that sometimes even when there is enough space to avoid overlap, it still overlaps.
This was because I used a double linked list to improve overlapping checking speed. When using a double linked list, I only need to check from the last scatter to see if it overlaps. But this is not correct because the previous scatters may also overlap. And when moving the new one to be farther, it can also overlap with previous nodes with slightly different value, not just the last one. So instead of a link, this PR proposes to use an ordinary array so the logic is even easier to follow; and it always checks all nodes to test overlapping instead of only the last one.
Fixed issues
Details
Before: What was the problem?
Overlap happens when there could be enough space.
After: How does it behave after the fixing?
There should be no overlap when there could be enough space.
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