xtinec commented on a change in pull request #6234: [reviewable] Integrate 
@superset-ui/{core,color,chart} modules
URL: 
https://github.com/apache/incubator-superset/pull/6234#discussion_r231646374
 
 

 ##########
 File path: 
superset/assets/src/explore/components/controls/ColorSchemeControl.jsx
 ##########
 @@ -47,23 +46,27 @@ export default class ColorSchemeControl extends 
React.PureComponent {
   }
 
   renderOption(key) {
-    const { schemes } = this.props;
+    const { isLinear, schemes } = this.props;
     const schemeLookup = isFunction(schemes) ? schemes() : schemes;
-    const currentScheme = schemeLookup[key.value || defaultProps.value].colors;
+    const currentScheme = schemeLookup[key.value || defaultProps.value];
 
-    let colors = currentScheme;
-    if (this.props.isLinear) {
-      const colorScaler = colorScalerFactory(currentScheme);
-      colors = [...Array(20).keys()].map(d => (colorScaler(d / 20)));
-    }
+    const colors = isLinear
+      ? currentScheme.getColors(9)
 
 Review comment:
   Why `9`? 🤔 Could perhaps add a comment here.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to