suddjian commented on a change in pull request #16540:
URL: https://github.com/apache/superset/pull/16540#discussion_r706384061



##########
File path: superset-frontend/src/setup/setupColors.ts
##########
@@ -31,44 +31,44 @@ import {
   SequentialScheme,
 } from '@superset-ui/core';
 import superset from 
'@superset-ui/core/lib/color/colorSchemes/categorical/superset';
+import ColorSchemeRegistry from 
'@superset-ui/core/lib/color/ColorSchemeRegistry';
 
-export default function setupColors(
-  extraCategoricalColorSchemas: CategoricalScheme[] = [],
-  extraSequentialColorSchemes: SequentialScheme[] = [],
+function registerColorSchemes(
+  registry: ColorSchemeRegistry<unknown>,
+  colorSchemes: (CategoricalScheme | SequentialScheme)[],
+  standardDefaultKey: string,
 ) {
-  // Register color schemes
-  const categoricalSchemeRegistry = getCategoricalSchemeRegistry();
+  colorSchemes.forEach(scheme => {
+    registry.registerValue(scheme.id, scheme);
+  });
 
-  if (extraCategoricalColorSchemas?.length > 0) {
-    extraCategoricalColorSchemas.forEach(scheme => {
-      categoricalSchemeRegistry.registerValue(scheme.id, scheme);
-    });
-  }
+  const defaultKey =
+    colorSchemes.find(scheme => scheme.isDefault)?.id || standardDefaultKey;
+  console.log({ defaultKey });

Review comment:
       oh shoot thanks




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