# State transitions

> Use a state-transition diagram to show a transition matrix as arrows: how likely each state is to lead to each other state next.

- Data type: Movement between stages (`flow`)
- Pro · not released yet: its code is not available; try it on its page, or use a free chart of the same data type (`flow`)
- Example: **In Seattle, three dry days in four are followed by another dry day** (What tomorrow brings, given today's weather, Seattle–Tacoma airport, every day 2016–2025)
- How to read it: Each circle is a kind of day, sized by how often it happened; an arrow's width is the chance the next day is the state it points to, and loops mean the weather stayed the same.
- Phone: Adapts to mobile (Draws its own phone layout below 520px) · Video formats: none passed; closest 9:16

## Use it when
- you have a transition matrix or a Markov chain
- there are 2 to 6 states
- persistence (staying put) matters as much as change

## Avoid it when
- there are many states (use a heatmap of the matrix)
- transitions depend on more than the current state
- you need the sequence itself, not the odds (use a timeline)

## Fields (data.json)
- `states` (category): the kinds of day, in ink order
- `definitions` (text): how each state is defined from the measurements
- `days` (number, unit "days", format count): days in each state
- `counts` (number, unit "days", format count): counts[a][b]: days in state a followed by a day in state b
- `years` (year): first and last year counted

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 an arrow to read the chance and the count
- hover a state to light where it leads
- Motion: The states pop up, then each arrow draws itself from today to tomorrow.
- Sound: A pop on hover pitched by the next state. 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": "state-transitions",
  "title": "In Seattle, three dry days in four are followed by another dry day",
  "subtitle": "What tomorrow brings, given today's weather, Seattle–Tacoma airport, every day 2016–2025",
  "data": "/charts/state-transitions.data.json"
}
```

## Source
Global Historical Climatology Network daily, station USW00024233 (Seattle–Tacoma International Airport), NOAA National Centers for Environmental Information (Public domain (US government)), retrieved 2026-12-01: https://www.ncei.noaa.gov/products/land-based-station/global-historical-climatology-network-daily

Note: A day is Snowy if any snow fell; otherwise Dry (no measurable rain; a trace counts as dry), Showery (0.1–4.9 mm) or Rainy (5 mm or more). Six days with no precipitation record are skipped.

Live: /charts/state-transitions · Manifest: /charts/state-transitions.json · Tags: Markov chain, transition matrix, states, weather, rain, probability, climate
