schizophrenicmaniac opened a new pull request, #45140:
URL: https://github.com/apache/superset/pull/45140

   ### SUMMARY
   Since #30646, the Treemap sets `itemStyle.color` from the categorical color 
scale on every node, leaves included. A leaf with an explicit color no longer 
gets ECharts' `colorSaturation` shading from its parent. So in a Treemap with 
two or more dimensions, every leaf gets an unrelated color and you can't see 
the top-level grouping.
   
   This change sets the color only on nodes that have children, as before 
4.1.2, plus on leaves at the first level. Nested leaves go back to being shades 
of their parent's color.
   
   First-level leaves are kept because they are the categories themselves in a 
one-dimension Treemap. Without them, every node there would become a shade of 
the metric's color, and the label colors from #30646 would stop applying. Group 
nodes still go through the color scale with the slice id, so dashboard color 
consistency still works for them.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   Still to be added. Before: cities in the same state get unrelated colors 
(see the screenshot in #45135). After: cities are shades of their state's color.
   
   ### TESTING INSTRUCTIONS
   1. Create a Treemap with two dimensions, e.g. `state` and `name` from 
`birth_names`, with metric `SUM(num)`.
   2. Check that the leaves inside each top-level group are shades of the 
group's color, not unrelated colors.
   3. Remove the second dimension and check that each top-level category still 
gets its own color from the scheme.
   4. Add the two-level chart to a dashboard with label colors set for a few 
top-level values, and check that their children use the assigned color.
   5. Run `npm run test -- 
plugins/plugin-chart-echarts/test/Treemap/transformProps.test.ts`.
   
   ### ADDITIONAL INFORMATION
   - [x] Has associated issue: Fixes #45135
   - [ ] Required feature flags:
   - [x] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to