Skip to content

Commit

Permalink
remove useless array map data clone
Browse files Browse the repository at this point in the history
  • Loading branch information
chentsulin committed Oct 30, 2018
1 parent fcb80e4 commit a126e46
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/WordCloud.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class WordCloud extends Component {
onWordMouseOver,
onWordMouseOut,
} = this.props;
const wordCounts = data.map(text => ({ ...text }));

// clear old words
select(this.wordCloud)
Expand All @@ -69,7 +68,7 @@ class WordCloud extends Component {
const layout = cloud()
.size([width, height])
.font(font)
.words(wordCounts)
.words(data)
.padding(padding)
.rotate(rotate)
.fontSize(fontSizeMapper)
Expand Down

0 comments on commit a126e46

Please sign in to comment.