Repository navigation
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. 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 |
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?
Adds
series.tree.radialLevelGapto configure distances between successive radial tree levels independently of the layout box.Fixed issues
New option; no issue is closed by this draft.
Details
Before: What was the problem?
Radial tree layout divides the available radius equally between all visible depth levels. Changing the layout box scales every gap together. A hidden data root therefore reserves the same radial distance as every other level, leaving excessive empty space in dense two-level hierarchies; applications cannot reduce that first gap independently of the distances required by outer labels.
After: How does it behave after the fixing?
Scalar distances use direct multiplication. Configured arrays calculate cumulative radii once per layout; the default path allocates no radius array. Polar radii and Cartesian coordinates use the same values, so existing curves and transitions continue to use coherent geometry.
Document Info
Option semantics are documented on
TreeSeriesOption.radialLevelGap;test/tree-radial.htmlincludes a paired default/custom example and explains indexing, units, partial arrays and resize behavior. This draft proposes the API before a separate website-option documentation change.Misc
Security Checking
ZRender Changes
Related test cases or examples to use the new APIs
test/ut/spec/series/tree.test.ts: eight real-chart tests cover default and empty-array compatibility, scalar/zero/oversized gaps, independently configured depths, unequal branches, partial arrays, resize and option updates, collapse/re-expansion, all orthogonal orientations and root-only trees. Assertions verify Cartesian geometry as well as stored radii and exact angular compatibility.test/tree-radial.html: paired default/custom multilevel example, exercised in headless Chrome. The custom example produces radii 0/90/115/160 with identical angles to the default.Verification:
TZ=UTC npm test -- --runInBand --coverage=false npm run build:lib npm run checktype npm run lint:nocacheAll 27 unit suites / 202 tests pass, exported declarations build, type checks pass and uncached lint passes. Before the implementation, four new geometry cases failed against the unchanged source because requested distances were ignored. The existing local-time test depends on the host's historical timezone offset, so the full suite was also run with an explicit UTC environment; no time-test code was changed.
The option was also exercised in a real dense radial tree: 103 labels, 93 visible parent-child edges, no initial label overlap or canvas clipping, with actual drag, wheel zoom and tag navigation checked. Label styling/packing for that application is not included in this library PR.
Merging options
Other information
This branch contains only the new option, layout implementation, geometry regressions and visual example. It does not include the separate dataZoom step-line patch carried by the fork.