schizophrenicmaniac commented on code in PR #45140:
URL: https://github.com/apache/superset/pull/45140#discussion_r4257425649
##########
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:
Agreed. I've added a note to the description that nested leaves no longer
pick up their own label colours and take a shade of their parent's colour
instead.
--
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]