Docs
πŸ“Š ⏐ Charts
Word Cloud πŸ†•

Word Cloud

A word cloud is a visual representation for text data to visualize keywords or tags. Tags are usually single words, and the importance of each tag is shown with size or color. This format is useful for quickly perceiving the most prominent terms and for locating a term alphabetically to determine its relative prominence.

Quick Start

To create a word cloud, use import the WordCloud and give it some data.

API

WordCloud (opens in a new tab)

PropDescriptionDefault
dataData to render in the word cloud. The 'key' represents the word and 'data' represents its frequency/weight.
ChartShallowDataShape<ChartDataTypes | [ChartDataTypes, ChartDataTypes]>[]
[]
fontSizeRangeFont size range [min, max].
[number, number]
[12, 50]
fontFamilyFont family to use.
string
Arial
paddingPadding between words.
number
3
rotationAnglesRotation angles for words.
[number, number]
[-30, 30]
rotationsNumber of possible rotations.
number
2
colorSchemeCustom color scheme for words.
string[]
schemes.cybertron
onLabelClickEvent triggered when a word is clicked.
(event: MouseEvent<Element, MouseEvent>, data: ChartShallowDataShape<ChartDataTypes | [ChartDataTypes, ChartDataTypes]>) => void
onLabelMouseEnterMouse enter handler.
(event: PointerEvent<Element>, data: ChartShallowDataShape<ChartDataTypes | [ChartDataTypes, ChartDataTypes]>) => void
onLabelMouseLeaveMouse leave handler.
(event: PointerEvent<Element>, data: ChartShallowDataShape<ChartDataTypes | [ChartDataTypes, ChartDataTypes]>) => void
idId of the chart.
string
widthWidth of the chart. If not provided will autosize.
number
heightHeight of the chart. If not provided will autosize.
number
marginsMargins for the chart.
Margins
classNameClassnames for the chart.
string
containerClassNameClassnames for the chart.
string
styleAdditional css styles.
StyleHTMLAttributes<SVGSVGElement>
centerCenter the chart. Used mainly internally.
boolean
centerXCenter chart on X Axis only. Used mainly internally.
boolean
centerYCenter chart on Y Axis only. Used mainly internally.
boolean

WordCloudLabel (opens in a new tab)

PropDescriptionDefault
textText to display.
string
fontSizeFont size in pixels.
number
fontFamilyFont family to use.
string
fillFill color for the text.
string
xX position of the text.
number
yY position of the text.
number
rotateRotation angle in degrees.
number
dataOriginal data point.
ChartShallowDataShape<ChartDataTypes | [ChartDataTypes, ChartDataTypes]>
classNameAdditional className to apply.
string
tooltipTooltip element.
ReactElement<ChartTooltipProps, FC<Partial<ChartTooltipProps>>>
<ChartTooltip />
onClickClick handler.
(event: MouseEvent<Element, MouseEvent>, data: ChartShallowDataShape<ChartDataTypes | [ChartDataTypes, ChartDataTypes]>) => void
onMouseEnterMouse enter handler.
(event: PointerEvent<Element>, data: ChartShallowDataShape<ChartDataTypes | [ChartDataTypes, ChartDataTypes]>) => void
onMouseLeaveMouse leave handler.
(event: PointerEvent<Element>, data: ChartShallowDataShape<ChartDataTypes | [ChartDataTypes, ChartDataTypes]>) => void