kristw 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_r231726471
##########
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:
Umm, good point. It should be `10`.
- `20` is too many
- Maximum colors in our sequential palettes is `10` (I thought it was 9.
Just double-check)
----------------------------------------------------------------
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]