fix(treemap): restore sequential coloring + remove label box, 1px gap (fixes #36807)
User description
SUMMARY
-
Restore sequential (continuous) coloring for Treemap when a numeric metric with varying values is present, while preserving categorical coloring for categorical/constant metrics.
-
Remove boxed label appearance and eliminate the 1px gap by default.
-
Ensure de-emphasized (filtered-out) nodes are muted via opacity rather than overriding their color so gradients remain visible.
-
Add unit tests to prevent regressions.
BEFORE/AFTER SCREENSHOTS
-- BEFORE :
-- AFTER :
TESTING INSTRUCTIONS / FILES MODIFIED
transformProps.ts— core logic and label/de-emphasis changesconstants.ts— adjusted defaults forBORDER_WIDTH/GAP_WIDTHto remove thin gaptransformProps.test.ts— new/updated tests
What I Changed
-
Behavior: Treemap now:
- Automatically uses a sequential palette via the sequential scheme registry when metric values vary (
min !== max). - Falls back to categorical palette behavior otherwise.
- Uses opacity for de-emphasis instead of forcing a text color.
- Automatically uses a sequential palette via the sequential scheme registry when metric values vary (
-
UI: Labels no longer display a visible border/background by default, and that 1px gap.
-
Typing: Replaced
@ts-ignorewith a typed assignment forvisualMap. -
Tests: Added Jest tests validating
visualMapexistence for numeric-varying metric and absence for constant metrics.
Fixes
- Closes: #36807
CodeAnt-AI Description
Restore continuous coloring for numeric treemaps and remove boxed labels
What Changed
- Treemap now shows a continuous/sequential color gradient when the metric column has varying numeric values; static/categorical metrics keep categorical colors.
- The visible label box and the thin 1px gap around labels are removed by default so labels render without a border or background.
- Filtered/de-emphasized nodes are muted using opacity so their color gradients remain visible instead of being overridden.
- Adds unit tests that verify sequential coloring is applied only for varying numeric metrics.
Impact
✅ Clearer sequential color gradients for numeric treemaps
✅ No boxed labels or thin gaps around treemap labels
✅ Filtered nodes retain underlying color gradients (better visual fidelity)
💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
@codeant-ai ask: Your question here
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
@codeant-ai ask: Can you suggest a safer alternative to storing this secret?
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
@codeant-ai: Your feedback here
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
@codeant-ai: Do not flag unused imports.
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
@codeant-ai: review
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.
CodeAnt AI is reviewing your PR.
Thanks for using CodeAnt! 🎉
We're free for open-source projects. if you're enjoying it, help us grow by sharing.
Share on X · Reddit · LinkedIn
Code Review Agent Run #d0ad56
Actionable Suggestions - 0
Additional Suggestions - 2
-
superset-frontend/plugins/plugin-chart-echarts/src/Treemap/transformProps.ts - 1
-
Type safety violation · Line 325-325The code uses `as any` for accessing `linearColorScheme` from `formData` and assigning `visualMap` to `echartOptions`, violating the project's rule against using `any` types for proper TypeScript safety. This affects type checking and maintainability. Consider updating the types to include `linearColorScheme` in `EchartsTreemapFormData` and ensuring the ECharts option type supports `visualMap` without casting.
-
-
superset-frontend/plugins/plugin-chart-echarts/test/Treemap/transformProps.test.ts - 1
-
TypeScript Standards Violation · Line 78-106The added test cases use `as any` and `@ts-ignore` which violate the project's TypeScript standards requiring proper typing without `any` or ignore directives. Since `EChartsCoreOption` doesn't include `visualMap` in its type definition, casting `echartOptions` to `any` for access is acceptable here, but remove the unnecessary `as any` on `formData` and replace `@ts-ignore` with the cast to maintain consistency with the implementation code.
-
Review Details
-
Files reviewed - 3 · Commit Range:
5c34a05..47a16af- superset-frontend/plugins/plugin-chart-echarts/src/Treemap/constants.ts
- superset-frontend/plugins/plugin-chart-echarts/src/Treemap/transformProps.ts
- superset-frontend/plugins/plugin-chart-echarts/test/Treemap/transformProps.test.ts
-
Files skipped - 0
-
Tools
- Whispers (Secret Scanner) - ✔︎ Successful
- Detect-secrets (Secret Scanner) - ✔︎ Successful
- Eslint (Linter) - ✔︎ Successful
Bito Usage Guide
Commands
Type the following command in the pull request comment and save the comment.
-
/review- Manually triggers a full AI review. -
/pause- Pauses automatic reviews on this pull request. -
/resume- Resumes automatic reviews. -
/resolve- Marks all Bito-posted review comments as resolved. -
/abort- Cancels all in-progress reviews.
Refer to the documentation for additional commands.
Configuration
This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].
Documentation & Help
Nitpicks 🔍
| 🔒 No security issues identified |
⚡ Recommended areas for review
|
CodeAnt AI finished reviewing your PR.
Code Review Agent Run #1e540b
Actionable Suggestions - 0
Review Details
-
Files reviewed - 3 · Commit Range:
47a16af..91696e4- superset-frontend/plugins/plugin-chart-echarts/src/Treemap/constants.ts
- superset-frontend/plugins/plugin-chart-echarts/src/Treemap/transformProps.ts
- superset-frontend/plugins/plugin-chart-echarts/test/Treemap/transformProps.test.ts
-
Files skipped - 0
-
Tools
- Eslint (Linter) - ✔︎ Successful
- Whispers (Secret Scanner) - ✔︎ Successful
- Detect-secrets (Secret Scanner) - ✔︎ Successful
Bito Usage Guide
Commands
Type the following command in the pull request comment and save the comment.
-
/review- Manually triggers a full AI review. -
/pause- Pauses automatic reviews on this pull request. -
/resume- Resumes automatic reviews. -
/resolve- Marks all Bito-posted review comments as resolved. -
/abort- Cancels all in-progress reviews.
Refer to the documentation for additional commands.
Configuration
This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].
Documentation & Help
Hello maintainers @rusackas @msyavuz @geido @kgabryje, Just checking in on this PR. Please let me know if any changes, tests, or adjustments are needed. I'd be happy to update it. Thanks for your time!
Deploy Preview for superset-docs-preview ready!
| Name | Link |
|---|---|
| Latest commit | bf3cf81f93243efc3dad2b1db991f9340879a56c |
| Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6981353804b749000839ec62 |
| Deploy Preview | https://deploy-preview-36847--superset-docs-preview.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify project configuration.
Code Review Agent Run #7f1f44
Actionable Suggestions - 0
Review Details
-
Files reviewed - 4 · Commit Range:
91696e4..bf3cf81- superset-frontend/packages/superset-ui-switchboard/src/switchboard.ts
- superset-frontend/plugins/plugin-chart-echarts/src/Treemap/constants.ts
- superset-frontend/plugins/plugin-chart-echarts/src/Treemap/transformProps.ts
- superset-frontend/plugins/plugin-chart-echarts/test/Treemap/transformProps.test.ts
-
Files skipped - 0
-
Tools
- Eslint (Linter) - ✔︎ Successful
- Whispers (Secret Scanner) - ✔︎ Successful
- Detect-secrets (Secret Scanner) - ✔︎ Successful
Bito Usage Guide
Commands
Type the following command in the pull request comment and save the comment.
-
/review- Manually triggers a full AI review. -
/pause- Pauses automatic reviews on this pull request. -
/resume- Resumes automatic reviews. -
/resolve- Marks all Bito-posted review comments as resolved. -
/abort- Cancels all in-progress reviews.
Refer to the documentation for additional commands.
Configuration
This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].
Documentation & Help
Aww dang... why did you close this @hassaansaleem28 ?
That little one pixel line has been bothering me forever... I just never got around to investigating it.