# Ranked table

> Use a ranked table when readers need exact values and several attributes per item, with inline bars and rank badges to keep the order visible.

- Data type: Values per item (`compare`)
- Pro · not released yet: its code is not available; try it on its page, or use a free chart of the same data type (`compare`)
- Example: **Kamchatka's magnitude 8.8 released more energy than 2025's other big earthquakes put together** (Every earthquake of magnitude 7 or more in 2025, ranked by magnitude; bars show energy as a share of the largest)
- How to read it: Each row is one earthquake, strongest first; the bar is its energy compared with the 8.8, and the toggle switches the bars to magnitude.
- Phone: Adapts to mobile (Draws its own phone layout below 520px) · Video formats: none passed; closest 9:16

## Use it when
- readers need exact values and two or three attributes per item (a label, the ranked value, and up to three columns named in the hint columns: [{ field, head }])
- the ranking matters and the list is up to about 25 rows
- a scale is hard to feel (logarithmic magnitudes, money) and an inline bar helps

## Avoid it when
- the pattern matters more than the values (use a chart)
- more than about 25 rows without search or paging
- only one attribute per item (use sorted bars)

## Fields (data.json)
- `place` (place): each row's label (the USGS place name of the epicentre; tidied by the hints trim and short)
- `mag` (number, unit "magnitude", format decimal): the value rows are ranked by (moment magnitude; with the unit magnitude the bars can show energy)
- `depth` (number, unit "km", format count): optional column: depth of the hypocentre, km
- `date` (date): optional column: date (UTC); also breaks ties, earliest first
- `tsunami` (number, unit "flag (0 or 1)", format count): optional: USGS tsunami flag (1 when the event is large and in an oceanic region; not a confirmed tsunami); not drawn
- `url` (text): optional: the USGS event page; not drawn

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 row to read its energy against #1
- the Bars chips switch between energy and magnitude
- Motion: Rows deal in from the right like cards, then the bars fill; switching the bar mode rescales them smoothly.
- Sound: A chime on toggle; a pop pitched by rank on hover. 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": "ranked-table",
  "title": "Kamchatka's magnitude 8.8 released more energy than 2025's other big earthquakes put together",
  "subtitle": "Every earthquake of magnitude 7 or more in 2025, ranked by magnitude; bars show energy as a share of the largest",
  "data": "/charts/ranked-table.data.json"
}
```

## Source
ANSS Comprehensive Earthquake Catalog (ComCat), event query: 2025, magnitude 7+, US Geological Survey Earthquake Hazards Program (Public domain (US government work)), retrieved 2026-12-01: https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&starttime=2025-01-01&endtime=2026-01-01&minmagnitude=7

Note: Energy uses the standard rule that each whole step of magnitude is about 32 times the energy (10^1.5).

Live: /charts/ranked-table · Manifest: /charts/ranked-table.json · Tags: ranked table, table, leaderboard, inline bars, earthquakes, science, logarithmic
