Skip to content

Instantly share code, notes, and snippets.

@mariusmuntean
Last active November 13, 2022 19:24
const options: OptionsProp = {
colors: ['#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd', '#8c564b'],
enableTooltip: true,
deterministic: true,
randomSeed: 'dgfwrhrh',
fontFamily: 'impact',
fontSizes: [10, 55],
fontStyle: 'normal',
fontWeight: 'normal',
padding: 1,
rotations: 1,
rotationAngles: [0, 90],
scale: 'log',
spiral: 'archimedean',
transitionDuration: 500,
enableOptimizations: true,
}
const wordcloudCallbacks: CallbacksProp = {
getWordTooltip: (w: Word) => `hashtag appears ${w.value} time(s)`,
}
return (
<>
<ReactWordcloud words={wordCloudData} options={options} callbacks={wordcloudCallbacks} />
</>
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment