# Hexbin

> Use a hexbin when thousands of points pile on top of each other: count them into hexagons and show each count as size and depth of colour.

- Data type: Several measures per item (`relationships`)
- Free (MIT): install with `npx chartreuse add hexbin`, or registry item `/r/hexbin.json`
- Example: **A year of strong earthquakes draws the outline of the Pacific** (Earthquakes of magnitude 4.5 or more, 1 December 2025 to 29 November 2026, counted in equal-area hexagons roughly 750 km across)
- How to read it: Each hexagon counts the quakes inside it: bigger and darker means more; rings mark the five strongest of the year.
- Phone: Adapts to mobile (Draws its own phone layout below 520px) · Video formats: 16:9 (best 16:9)

## Use it when
- thousands of points overlap so a plain scatter turns into a blob
- where things cluster matters more than any single point
- points on a map or on two numeric axes

## Avoid it when
- fewer than a few hundred points (show them all)
- single points matter, such as the one record-breaker (annotate it as here, or use dots)
- the bins would cut across a meaningful border

## Fields (data.json)
- `quakes` (text): one row per point: [longitude, latitude, value, time bin], the bin counted from `from` in hints.bin units (months in the example: 0 = Dec 2025); Play steps through the bins. Words from hints: noun/nouns, valueWord, valuePrefix, maxWord
- `biggest` (text): up to five points to ring and name, with place, value (mag), date and position (the five strongest quakes in the example)
- `from` (date): start of the window (YYYY-MM-DD); time bin 0 starts here
- `to` (date): end of the window (YYYY-MM-DD); the bins run to here

## Interactions, motion, sound
- hover or tap a hexagon to read its count and strongest quake
- hover a ring to read that quake
- Play builds up the year month by month
- Motion: Hexagons grow in a sweep from west to east; the five rings then close in on the strongest quakes.
- Sound: A pop on hover, higher for busier hexagons. 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": "hexbin",
  "title": "A year of strong earthquakes draws the outline of the Pacific",
  "subtitle": "Earthquakes of magnitude 4.5 or more, 1 December 2025 to 29 November 2026, counted in equal-area hexagons roughly 750 km across",
  "data": "/charts/hexbin.data.json"
}
```

## Source
ANSS Comprehensive Earthquake Catalog (FDSN event web service), US Geological Survey Earthquake Hazards Program (Public domain (US government work)), retrieved 2026-12-01: https://earthquake.usgs.gov/fdsnws/event/1/

Note: Coordinates rounded to 0.1°. Land outline: Natural Earth 1:110m via world-atlas (public domain). Hexagons are drawn on the Equal Earth projection, so they cover equal areas.

Live: /charts/hexbin · Manifest: /charts/hexbin.json · Tags: hexbin, binning, density, many points, earthquakes, map, ring of fire, geology
