Skip to content

Commit

Permalink
perf(word-cloud): reduce render to improve performance (#21504)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenLYZ authored Sep 19, 2022
1 parent 7d2f07e commit 94a724e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
},
"peerDependencies": {
"@types/react": "*",
"@types/lodash": "*",
"@superset-ui/chart-controls": "*",
"@superset-ui/core": "*",
"react": "^16.13.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
seed,
CategoricalColorScale,
} from '@superset-ui/core';
import { isEqual } from 'lodash';

const seedRandom = seed('superset-ui');
export const ROTATION = {
Expand Down Expand Up @@ -134,8 +135,8 @@ class WordCloud extends React.PureComponent<
const { data, encoding, width, height, rotation } = this.props;

if (
prevProps.data !== data ||
prevProps.encoding !== encoding ||
!isEqual(prevProps.data, data) ||
!isEqual(prevProps.encoding, encoding) ||
prevProps.width !== width ||
prevProps.height !== height ||
prevProps.rotation !== rotation
Expand Down

0 comments on commit 94a724e

Please sign in to comment.