EnxDev commented on code in PR #45140:
URL: https://github.com/apache/superset/pull/45140#discussion_r4256174265


##########
superset-frontend/plugins/plugin-chart-echarts/src/Treemap/transformProps.ts:
##########
@@ -184,13 +184,16 @@ export default function transformProps(
         }),
       });
       const newPath = path.concat(name);
+      // Nested leaves are left without a color so that ECharts derives it
+      // from their parent's color using colorSaturation.
+      const hasOwnColor = !!treeNode.children?.length || path.length === 0;
       let item: TreemapSeriesNodeItemOption = {
         name,
         value,
         colorSaturation: COLOR_SATURATION,
         itemStyle: {
           borderColor: BORDER_COLOR,
-          color: colorFn(name, sliceId),
+          ...(hasOwnColor && { color: colorFn(name, sliceId) }),

Review Comment:
   On the CodeAnt thread here: it's true that a nested leaf with its own entry 
in the dashboard's label colours stops getting it. That was also the case 
before 4.1.2 and it's the price of the shading, so I think it's the right trade.
   
   Worth a sentence in the description though, since someone relying on 
per-leaf label colours will see them change.



-- 
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