pbcodesC commented on code in PR #36541:
URL: https://github.com/apache/superset/pull/36541#discussion_r2616162516


##########
superset-frontend/src/utils/colorScheme.ts:
##########
@@ -103,8 +103,26 @@ export const getFreshLabelsColorMapEntries = (
   Object.keys(customLabelsColor).forEach(label => {
     delete allEntries[label];
   });
+// Ensure no duplicate colors
+const usedColors = new Set<string>();
+const updatedEntries: Record<string, string> = {};
+
+Object.entries(allEntries).forEach(([label, color]) => {
+  let finalColor = color;
+
+  // If this color is already used, pick the next available color
+  if (usedColors.has(color)) {
+    const availableColors = 
Object.values(labelsColorMapInstance.getColorMap());

Review Comment:
   Thank you for the detailed review and helpful suggestions.
   I’ve addressed all the review comments and updated the PR accordingly.
   
   Please let me know if anything else needs adjustment.
   If possible, I’d be happy to be assigned to this PR to continue following up 
on it.
   
   Thanks again for your time and guidance!
   



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