Skip to content

Commit

Permalink
change word.count to word.value
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisrzhou committed Mar 6, 2019
1 parent 65c88b4 commit 63ab988
Show file tree
Hide file tree
Showing 7 changed files with 139 additions and 139 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import * as React from "react";
import ReactWordcloud from "react-wordcloud";

const words = [
{ text: "hello", count: 3 },
{ text: "world", count: 1 },
{ text: "github", count: 1 },
{ text: "code", count: 1 }
{ text: "hello", value: 3 },
{ text: "world", value: 12.5 },
{ text: "github", value: 1 },
{ text: "code", value: 1 }
];

function MyApp() {
Expand Down
2 changes: 1 addition & 1 deletion docs/usage/basic.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import words from "./words";

# Basic Example

Simply provide an array of words with valid `text` and `count` fields to begin!
Simply provide an array of words with valid `text` and `value` fields to begin!

<Playground>
<ReactWordcloud words={words} />
Expand Down
8 changes: 4 additions & 4 deletions docs/usage/callbacks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ In the example below, we can pass custom `getWordColor` and `getWordTooltip` cal
<ReactWordcloud
words={words}
callbacks={{
getWordColor: ({ count }) => {
return count > 50 ? "blue" : "red";
getWordColor: ({ value }) => {
return value > 50 ? "blue" : "red";
},
getWordTooltip: ({ count, text }) => {
return count > 50 ? `${text.toUpperCase()} (> 50)` : `${text} (<= 50)`;
getWordTooltip: ({ text, value }) => {
return value > 50 ? `${text.toUpperCase()} (> 50)` : `${text} (<= 50)`;
}
}}
/>
Expand Down
Loading

0 comments on commit 63ab988

Please sign in to comment.