mirror of
https://github.com/apache/superset.git
synced 2024-09-18 11:39:49 -04:00
perf(word-cloud): reduce render to improve performance (#21504)
This commit is contained in:
parent
7d2f07e78f
commit
94a724e49b
@ -36,6 +36,7 @@
|
|||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@types/react": "*",
|
"@types/react": "*",
|
||||||
|
"@types/lodash": "*",
|
||||||
"@superset-ui/chart-controls": "*",
|
"@superset-ui/chart-controls": "*",
|
||||||
"@superset-ui/core": "*",
|
"@superset-ui/core": "*",
|
||||||
"react": "^16.13.1"
|
"react": "^16.13.1"
|
||||||
|
@ -31,6 +31,7 @@ import {
|
|||||||
seed,
|
seed,
|
||||||
CategoricalColorScale,
|
CategoricalColorScale,
|
||||||
} from '@superset-ui/core';
|
} from '@superset-ui/core';
|
||||||
|
import { isEqual } from 'lodash';
|
||||||
|
|
||||||
const seedRandom = seed('superset-ui');
|
const seedRandom = seed('superset-ui');
|
||||||
export const ROTATION = {
|
export const ROTATION = {
|
||||||
@ -134,8 +135,8 @@ class WordCloud extends React.PureComponent<
|
|||||||
const { data, encoding, width, height, rotation } = this.props;
|
const { data, encoding, width, height, rotation } = this.props;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
prevProps.data !== data ||
|
!isEqual(prevProps.data, data) ||
|
||||||
prevProps.encoding !== encoding ||
|
!isEqual(prevProps.encoding, encoding) ||
|
||||||
prevProps.width !== width ||
|
prevProps.width !== width ||
|
||||||
prevProps.height !== height ||
|
prevProps.height !== height ||
|
||||||
prevProps.rotation !== rotation
|
prevProps.rotation !== rotation
|
||||||
|
Loading…
Reference in New Issue
Block a user