Skip to content

[codex] Fix treemap parent select fill with upperLabel#21575

Draft
susiwen8 wants to merge 2 commits intomasterfrom
codex/issue-21433-treemap-hover-clean
Draft

[codex] Fix treemap parent select fill with upperLabel#21575
susiwen8 wants to merge 2 commits intomasterfrom
codex/issue-21433-treemap-hover-clean

Conversation

@susiwen8
Copy link
Copy Markdown
Contributor

@susiwen8 susiwen8 commented Apr 9, 2026

Summary

  • keep parent treemap nodes with upperLabel using their configured select.itemStyle.color
  • add a regression test covering parent-node select styling with upper labels

Root Cause

The parent-node upperLabel rendering path hardwired the selected fill color to borderColor, so parent nodes ignored select.itemStyle.color. That broke parent-node selected styling and led to the hover/select behavior reported in the issue.

Validation

  • ./node_modules/.bin/jest --config test/ut/jest.config.cjs --runInBand test/ut/spec/series/treemap.test.ts
  • ./node_modules/.bin/eslint src/chart/treemap/TreemapView.ts test/ut/spec/series/treemap.test.ts

Fixes #21433

@echarts-bot
Copy link
Copy Markdown

echarts-bot bot commented Apr 9, 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

Fixes treemap parent-node selection styling when upperLabel is enabled by ensuring the selected background fill honors select.itemStyle.color (instead of being hardwired to borderColor), and adds a regression unit test for this behavior.

Changes:

  • Update treemap parent-node background select-state fill logic to prefer select.itemStyle.color, with fallbacks.
  • Add a unit test asserting parent nodes with upperLabel use select.itemStyle.color for the select state fill.

Reviewed changes

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

File Description
src/chart/treemap/TreemapView.ts Adjusts select-state fill computation for parent-node background rendering when upperLabel is used.
test/ut/spec/series/treemap.test.ts Adds a regression test validating the parent-node select fill uses select.itemStyle.color with upperLabel.

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

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

@susiwen8 susiwen8 marked this pull request as ready for review April 9, 2026 03:00
@susiwen8 susiwen8 requested a review from plainheart April 9, 2026 03:02
Copy link
Copy Markdown
Contributor

@Ovilia Ovilia left a comment

Choose a reason for hiding this comment

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

Can we have an HTML test for this case?

@susiwen8
Copy link
Copy Markdown
Contributor Author

Added a browser-level regression case in \ on top of the existing Jest regression. The new HTML page exercises the \ parent-node case directly in the browser.

@susiwen8
Copy link
Copy Markdown
Contributor Author

Added a browser-level regression case in test/treemap-upperLabel-select.html on top of the existing Jest regression.

The new HTML page exercises the upperLabel + select.itemStyle.color parent-node case directly in the browser.

@susiwen8 susiwen8 marked this pull request as draft April 10, 2026 02:17
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] Treemap selection children disappear on hover

3 participants