Repository navigation
Conversation
…he old series When a series declares an array seriesKey and its members change between updates (e.g. a pie whose categories shrink after filtering), findTransitionSeriesBatches looked up each member in oldDataMap and dereferenced undefined. The throw also skipped saving the old series, so every later update threw again.
|
Thanks for your contribution! Please DO NOT commit the files in dist, i18n, and ssr/client/dist folders in a non-release pull request. These folders are for release use only. |
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?
Stops
universalTransitionfrom throwing when a series' arrayseriesKeycontains members that don't exist among the previous update's series.Fixed issues
N.A. (no existing issue found; happy to open one if preferred)
Details
Before: What was the problem?
In
findTransitionSeriesBatches, when a new series has an arrayseriesKeythat does not match an old series' key as a whole, each member is looked up inoldDataMapand dereferenced without a check:Common trigger: a pie that merges several series (one key per category) and whose categories change between updates. For example, a dashboard filter shrinks the categories from
['A', 'B']to['B']:The error is also sticky. It is thrown before the
series:transitionhandler saves the current series as the next update's "old series", so every later update with the same keys throws again until the key set happens to match the old one. WithlazyUpdate, it surfaces as an uncaught error on the zrender frame.After: How does it behave after the fixing?
Members with no old series are skipped, like the existing
if (oldData.data)check already intends. If none of the members match, no transition batch is created and the regular update animation runs. Members that do match still transition as before.Added
test/ut/spec/series/pie.test.ts. It reproduces the case above, including the repeated update, and asserts the update completes. It fails onmasterwithTypeError: Cannot read properties of undefined (reading 'data')and passes with the fix.npm run testpasses (27 suites, 195 tests), andnpx tsc --noEmitis clean.Document Info
One of the following should be checked.
Misc
Security Checking
ZRender Changes
Related test cases or examples to use the new APIs
N.A.
Merging options
Other information
Found in production on echarts 6.1.0. The same line is unchanged on
master.