feat: improve color consistency (save all labels) (#19038)

This commit is contained in:
Stephen Liu
2022-03-21 15:20:04 +08:00
committed by GitHub
parent e1d0b83885
commit dc575080d7
68 changed files with 690 additions and 137 deletions

View File

@@ -71,13 +71,14 @@ class CustomHistogram extends React.PureComponent {
xAxisLabel,
yAxisLabel,
showLegend,
sliceId,
} = this.props;
const colorFn = CategoricalColorNamespace.getScale(colorScheme);
const keys = data.map(d => d.key);
const colorScale = scaleOrdinal({
domain: keys,
range: keys.map(x => colorFn(x)),
range: keys.map(x => colorFn(x, sliceId)),
});
return (