Word cloud

A word cloud sizes terms by a weight. It is a poor analytical chart, because comparing font sizes is imprecise, and a genuinely useful summary graphic when precision is not the goal.

Use it to convey a shape at a glance, then put the numbers in a table underneath.


#When this is the right chart

  • Summarising themes in feedback or survey responses.

  • An opening graphic for a report whose detail follows.

  • Showing which terms dominate a corpus.


#What the data needs to look like

Field

Type

Term

Nominal

Weight

Quantitative: drives the size


#A worked example

Terms sized by frequency:

Word cloud

The source, which you can paste into a new diagram and edit:

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "description": "Feedback themes by frequency",
  "width": 380,
  "height": 240,
  "data": {"values": [
    {"term": "performance", "n": 82}, {"term": "export", "n": 61},
    {"term": "permissions", "n": 54}, {"term": "search", "n": 47},
    {"term": "onboarding", "n": 39}, {"term": "pricing", "n": 33},
    {"term": "mobile", "n": 28}, {"term": "api", "n": 22},
    {"term": "dark mode", "n": 18}, {"term": "templates", "n": 14}
  ]},
  "mark": {"type": "text", "fontWeight": "bold"},
  "encoding": {
    "text": {"field": "term"},
    "x": {"field": "n", "type": "quantitative", "title": "Mentions"},
    "y": {"field": "term", "type": "nominal", "sort": "-x", "title": null},
    "size": {"field": "n", "type": "quantitative", "legend": null, "scale": {"range": [12, 34]}},
    "color": {"field": "n", "type": "quantitative", "legend": null, "scale": {"scheme": "blues"}}
  }
}

#A few things that catch people out

  • Font size is read imprecisely. Never use a word cloud to make a close comparison.

  • Strip stop words first, or the biggest term will be "the".

  • Put a sorted table of the same numbers underneath. It costs nothing and answers the follow-up question.



Pick the chart for the question, not for the look.