# Word tree

> Use a word tree to show what follows a word in a text: branches split wherever the next words differ, sized by how often each path appears.

- Data type: Words and text (`text`)
- Pro · not released yet: its code is not available; try it on its page, or use a free chart of the same data type (`text`)
- Example: **In Alice in Wonderland, “I” is most often followed by “don't”** (The words that follow “I” in Lewis Carroll's Alice's Adventures in Wonderland (1865), within a clause)
- How to read it: Read each branch left to right as a phrase; bigger words and thicker lines are more common, and only continuations used at least twice are shown.
- Phone: Adapts to mobile (Draws its own phone layout below 520px) · Video formats: none passed; closest 9:16

## Use it when
- exploring how a word or phrase is used across a text
- repeated phrasings are the story (habits of speech, slogans, formulas)
- one root word and a few hundred uses

## Avoid it when
- the root is rare (a tree of single uses says little)
- comparing two texts (use side-by-side frequency bars)
- readers need exact counts for many phrases (use a table)

## Fields (data.json)
- `root` (text): the root word
- `total` (number, unit "times", format count): how often the root appears
- `rows[].phrase` (text): up to three words that followed the root, within a clause
- `rows[].count` (number, unit "times", format count): how often that exact continuation appears

Units are the example's: with your own data, set each number field's `unit` and `format` (percent, count, decimal, currency, compact) in the meta you pass to mount, or `chartreuse render --unit field=text --format field=count`. Scales and labels follow your data.

## Interactions, motion, sound
- hover or tap a word to read the phrase so far and its count
- Motion: The branches grow out from the root word, one level at a time, and the words fade in at their tips.
- Sound: Play speaks each branch's opening words. Quiet while it draws and between steps; mute it from its card. (sound is off until the viewer turns it on)

## Example spec
```json
{
  "chart": "word-tree",
  "title": "In Alice in Wonderland, “I” is most often followed by “don't”",
  "subtitle": "The words that follow “I” in Lewis Carroll's Alice's Adventures in Wonderland (1865), within a clause",
  "data": "/charts/word-tree.data.json"
}
```

## Source
Alice's Adventures in Wonderland by Lewis Carroll (eBook #11), Project Gutenberg (Public domain in the USA (Project Gutenberg License)), retrieved 2026-12-01: https://www.gutenberg.org/ebooks/11

Note: Counted from the plain-text edition; a continuation stops at punctuation, so “I think,” and “I think I” are separate branches.

Inspired by: [The Word Tree, an interactive visual concordance](https://doi.org/10.1109/TVCG.2008.172), Martin Wattenberg and Fernanda Viégas (linked, not copied).

Live: /charts/word-tree · Manifest: /charts/word-tree.json · Tags: text, language, phrases, concordance, books, literature, Alice in Wonderland
