fix(radar): distinguish missing dimensions from zero - #21741
Open
tianrking wants to merge 1 commit into
Open
Conversation
|
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 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?
This PR keeps missing radar dimensions absent from the rendered geometry instead of drawing them as real zero values at the radar center.
Fixed issues
Details
Before: What was the problem?
Radar layout replaced
null,undefined,NaN, and'-'values with the coordinate-system center before rendering. This made missing observations indistinguishable from actual numeric zeroes: they changed the polygon shape, produced symbols at the center, and could visually suggest measurements that were never present.The center fallback originally protected the generic polygon renderer from
NaNcoordinates, so simply removing it would reintroduce unstable path and animation behavior.After: How does it behave after the fixing?
The layout now preserves one point per radar dimension and represents missing dimensions with invalid coordinates. Radar-specific polyline and polygon paths filter those coordinates only at the path-building boundary, retaining fixed-dimension shapes for animation while connecting neighboring valid dimensions without passing
NaNvalues to the renderer.Symbols are created only for valid dimensions. A real numeric zero still renders at the center, all-missing data renders no series geometry, tooltip values remain unchanged, and complete numeric radar data follows the existing fast path.
Document Info
One of the following should be checked.
Misc
Security Checking
ZRender Changes
Related test cases or examples to use the new APIs
test/ut/spec/series/radar.test.tscovers mixed missing values, real zeroes, path construction, symbols, tooltip data, all-missing input, updates that move the missing dimensions, and the unchanged complete-data path.test/radar-missing-value.htmlprovides side-by-side visual cases for partial and all-missing data.Merging options
Other information
Validation performed on Node.js 20.20.2:
npm test -- --runInBand(27 suites, 198 tests)npm run lintnpm run checktypenpm run test:dts(TypeScript 4.7 through 5.9)npm run releaseAI assistance (OpenAI Codex) was used for issue analysis, implementation, test authoring, and local verification. I reviewed and understand the complete change and the validation above.