Skip to content

fix(dataZoom): keep toolbox zoom from dropping stacked areas#21600

Open
susiwen8 wants to merge 3 commits intomasterfrom
codex/fix-toolbox-stack-21111
Open

fix(dataZoom): keep toolbox zoom from dropping stacked areas#21600
susiwen8 wants to merge 3 commits intomasterfrom
codex/fix-toolbox-stack-21111

Conversation

@susiwen8
Copy link
Copy Markdown
Contributor

@susiwen8 susiwen8 commented May 2, 2026

Summary

Fixes #21111.

Toolbox dataZoom injects internal dataZoom.select components for the target axes. When a value axis uses scale: true, the generated dataZoom window is based on the axis extent, which already uses the stacked result dimension for stacked series. The filtering path still used the raw axis dimension, so stacked area data could be filtered away before rendering.

This changes AxisProxy filtering to reuse the same axis-dimension selection helper used by extent calculation, keeping stacked data filtered by its rendered stack result dimension.

Changes

  • Reuse getDataDimensionsOnAxis in dataZoom filtering.
  • Add a focused unit regression for toolbox-injected dataZoom with a scaled y-axis and stacked line data.
  • Add an HTML visual test for a toolbox dataZoom stacked confidence band.

Validation

  • ./node_modules/.bin/jest --config test/ut/jest.config.cjs --coverage=false test/ut/spec/component/dataZoom --runInBand
  • npm run checktype
  • ./node_modules/.bin/eslint src/component/dataZoom/AxisProxy.ts test/ut/spec/component/dataZoom/AxisProxy.test.ts
  • git diff --check -- src/component/dataZoom/AxisProxy.ts test/toolbox-dataZoom-stack-area.html test/ut/spec/component/dataZoom/AxisProxy.test.ts
  • Chrome headless screenshot of test/toolbox-dataZoom-stack-area.html

npm run checkheader still fails on pre-existing unrelated files missing headers; the new files are not listed in that failure.

image

Toolbox dataZoom injects select dataZoom components for both axes. When the value axis is scaled, its window is derived from the stacked coordinate extent, but filtering still used the original value dimension, so stacked area series could be filtered away before render. Reuse the axis extent dimension selection so dataZoom filters stacked series by their rendered stack result dimension.

Constraint: toolbox dataZoom creates internal value-axis filters even before users actively zoom.

Rejected: Force toolbox dataZoom to filterMode empty | changes existing dataZoom semantics and revives an older workaround.

Confidence: high

Scope-risk: narrow

Directive: Keep dataZoom filtering dimensions aligned with axis extent calculation for stacked data.

Tested: ./node_modules/.bin/jest --config test/ut/jest.config.cjs --coverage=false test/ut/spec/component/dataZoom --runInBand

Tested: npm run checktype

Tested: ./node_modules/.bin/eslint src/component/dataZoom/AxisProxy.ts test/ut/spec/component/dataZoom/AxisProxy.test.ts

Tested: git diff --check -- src/component/dataZoom/AxisProxy.ts test/toolbox-dataZoom-stack-area.html test/ut/spec/component/dataZoom/AxisProxy.test.ts

Tested: Chrome headless screenshot of test/toolbox-dataZoom-stack-area.html

Not-tested: npm run checkheader fails on pre-existing unrelated files missing headers.
@echarts-bot
Copy link
Copy Markdown

echarts-bot Bot commented May 2, 2026

Thanks for your contribution!
The community will review it ASAP. In the meanwhile, please checkout the coding standard and Wiki about How to make a pull request.

The pull request is marked to be PR: author is committer because you are a committer of this project.

To reviewers: If this PR is going to be described in the changelog in the future release, please make sure this PR has one of the following labels: PR: doc ready, PR: awaiting doc, PR: doc unchanged

This message is shown because the PR description doesn't contain the document related template.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a stacked-series regression in dataZoom filtering: toolbox-injected dataZoom.select components were computing value-axis windows from stacked extents but still filtering against raw value dimensions, which could remove stacked areas before render. The change aligns AxisProxy filtering with the same axis-dimension helper already used by extent calculation and adds regression coverage around the reported toolbox scenario.

Changes:

  • Reuse getDataDimensionsOnAxis in AxisProxy so dataZoom filtering follows stacked render dimensions.
  • Add a focused unit regression for toolbox-enabled stacked line data on a scaled value axis.
  • Add a manual HTML visual case reproducing the stacked confidence-band scenario from the bug report.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/component/dataZoom/AxisProxy.ts Switches axis-dimension selection in dataZoom filtering to the shared helper used by axis extent calculation.
test/ut/spec/component/dataZoom/AxisProxy.test.ts Adds a unit regression that verifies stacked line data is preserved when toolbox dataZoom injects value-axis filtering.
test/toolbox-dataZoom-stack-area.html Adds a manual visual reproduction for toolbox dataZoom with a stacked area/confidence band.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/component/dataZoom/AxisProxy.ts
Comment thread src/component/dataZoom/AxisProxy.ts
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2026

The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-21600@7d0292f

susiwen8 added 2 commits May 3, 2026 00:35
Copilot noted that the AxisProxy change touches weakFilter and raised concern about empty mode. Add focused coverage for both paths so the stacked-dimension filtering contract is explicit.

Constraint: toolbox dataZoom exposes filterMode and may inject value-axis filters before user zoom actions.

Rejected: Revert empty mode to raw axis dimensions | tests show stackResultDimension is the rendered value and should be emptied directly.

Confidence: high

Scope-risk: narrow

Directive: Keep weakFilter and empty coverage when changing stacked dataZoom dimensions.

Tested: ./node_modules/.bin/jest --config test/ut/jest.config.cjs --coverage=false test/ut/spec/component/dataZoom --runInBand

Tested: npm run checktype

Tested: ./node_modules/.bin/eslint test/ut/spec/component/dataZoom/AxisProxy.test.ts

Tested: git diff --check -- test/ut/spec/component/dataZoom/AxisProxy.test.ts

Not-tested: npm run checkheader not rerun for this test-only follow-up; previous run failed on pre-existing unrelated files.
Copilot suggested using raw axis dimensions for empty mode. A temporary verification showed that change turns raw y values for in-window stacked points into NaN, even though their stack result remains visible. Preserve the current implementation and cover that invariant explicitly.

Constraint: mapDimensionsAll(axisDim) includes both raw value and stack result dimensions for stacked series.

Rejected: Apply Copilot empty-mode suggestion | it corrupts raw values for in-window stacked points.

Confidence: high

Scope-risk: narrow

Directive: Do not special-case empty mode to mapDimensionsAll without preserving raw stacked values.

Tested: ./node_modules/.bin/jest --config test/ut/jest.config.cjs --coverage=false test/ut/spec/component/dataZoom --runInBand

Tested: npm run checktype

Tested: ./node_modules/.bin/eslint test/ut/spec/component/dataZoom/AxisProxy.test.ts

Tested: git diff --check -- test/ut/spec/component/dataZoom/AxisProxy.test.ts
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] stack is not rendered when toolbox is enabled

2 participants