villebro commented on code in PR #30851:
URL: https://github.com/apache/superset/pull/30851#discussion_r1834911218
##########
superset-frontend/plugins/plugin-chart-echarts/src/Graph/transformProps.ts:
##########
@@ -248,8 +254,26 @@ export default function transformProps(
const targetCategoryName = targetCategory
? getCategoryName(targetCategory, link[targetCategory])
: undefined;
- const sourceNode = getOrCreateNode(sourceName, source, sourceCategoryName);
- const targetNode = getOrCreateNode(targetName, target, targetCategoryName);
+ const sourceNodeColor = sourceCategoryName
+ ? colorFn(sourceCategoryName)
+ : colorFn('node');
Review Comment:
hmm, isn't there the risk of a collision here if `node` is also a series
name in another chrart? I'm thinking maybe we should just default to the first
color of the selected palette?
##########
superset-frontend/plugins/plugin-chart-echarts/src/Graph/transformProps.ts:
##########
@@ -248,8 +254,26 @@ export default function transformProps(
const targetCategoryName = targetCategory
? getCategoryName(targetCategory, link[targetCategory])
: undefined;
- const sourceNode = getOrCreateNode(sourceName, source, sourceCategoryName);
- const targetNode = getOrCreateNode(targetName, target, targetCategoryName);
+ const sourceNodeColor = sourceCategoryName
+ ? colorFn(sourceCategoryName)
+ : colorFn('node');
+ const targetNodeColor = targetCategoryName
+ ? colorFn(targetCategoryName)
+ : colorFn('node');
+ const linkColor = colorFn('link');
Review Comment:
Same here - I think we should use the same color as the node, and having a
different series name here will cause the link to have a different color, which
I don't think is expected.
--
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]