fix(Dashboard): Color inconsistency on refreshes and conflicts (#27439)

This commit is contained in:
Geido
2024-06-20 15:30:11 +02:00
committed by GitHub
parent 1770f8b783
commit 313ee596f5
55 changed files with 1050 additions and 742 deletions

View File

@@ -66,6 +66,7 @@ export interface WordCloudProps extends WordCloudVisualProps {
height: number;
width: number;
sliceId: number;
colorScheme: string;
}
export interface WordCloudState {
@@ -221,7 +222,7 @@ class WordCloud extends PureComponent<FullWordCloudProps, WordCloudState> {
render() {
const { scaleFactor } = this.state;
const { width, height, encoding, sliceId } = this.props;
const { width, height, encoding, sliceId, colorScheme } = this.props;
const { words } = this.state;
// @ts-ignore
@@ -249,7 +250,11 @@ class WordCloud extends PureComponent<FullWordCloudProps, WordCloudState> {
fontSize={`${w.size}px`}
fontWeight={w.weight}
fontFamily={w.font}
fill={colorFn(getValueFromDatum(w) as string, sliceId)}
fill={colorFn(
getValueFromDatum(w) as string,
sliceId,
colorScheme,
)}
textAnchor="middle"
transform={`translate(${w.x}, ${w.y}) rotate(${w.rotate})`}
>