# Waffle

> Use a waffle to show shares as countable squares: 100 squares, each one per cent of the whole.

- Data type: Shares of a total (`parts`)
- Free (MIT): install with `npx chartreuse add waffle`, or registry item `/r/waffle.json`
- Example: **Almost six in every ten people on Earth live in Asia** (World population by continent, 2023, squares out of 100)
- How to read it: The grid is everyone alive in 2023; each square is one in a hundred people, coloured by continent.
- Phone: Adapts to mobile (Draws its own phone layout below 520px) · Video formats: 16:9 (best 16:9)

## Use it when
- a few shares of one whole (2 to 6)
- readers think in 'out of 100' more easily than in angles
- a friendly, countable picture of a percentage

## Avoid it when
- shares below about half a per cent matter (they vanish or round up)
- more than six parts
- you compare several wholes (use stacked bars)

## Fields (data.json)
- `continent` (category): the part
- `people` (number, unit "people", format count): population, people
- `year` (year): the year measured

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 square or a key row to light that continent
- Motion: The squares pop into the grid as a wave, one continent after another, while the counts beside them tick up.
- Sound: A soft pop on hover, pitched by continent. 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": "waffle",
  "title": "Almost six in every ten people on Earth live in Asia",
  "subtitle": "World population by continent, 2023, squares out of 100",
  "data": "/charts/waffle.data.json"
}
```

## Source
Population, Our World in Data (HYDE, Gapminder, UN World Population Prospects) (CC BY 4.0), retrieved 2026-12-01: https://ourworldindata.org/grapher/population

Note: Squares are rounded so they add to 100; Oceania's 0.6% shows as one square.

Live: /charts/waffle · Manifest: /charts/waffle.json · Tags: part to whole, waffle, square pie, out of 100, population, continents, share
