mirror of
https://github.com/apache/superset.git
synced 2026-04-21 17:14:57 +00:00
fix(Dashboard): Color inconsistency on refreshes and conflicts (#27439)
This commit is contained in:
@@ -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})`}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user