# Voronoi treemap

> Use a Voronoi treemap to show nested shares as organic cells inside a circle: each cell's area is its value, grouped by colour.

- Data type: Shares of a total (`parts`)
- Pro · not released yet: its code is not available; try it on its page, or use a free chart of the same data type (`parts`)
- Example: **Wheat and rice give the world twice the calories of all animal foods** (Calories available per person per day, world, by food, 2024)
- How to read it: The circle is a day's food for an average person; each cell's area is one food's calories, inside thick borders for its food group.
- Phone: Adapts to mobile (Draws its own phone layout below 520px) · Video formats: 16:9, 9:16 (best 9:16)

## Use it when
- a playful, organic picture of shares with one level of grouping
- 10 to 40 parts
- a cover image or explainer where the shape should feel alive

## Avoid it when
- readers must compare similar areas exactly (use bars)
- more than two levels of nesting
- the layout must be identical across updates (cells move when values change)

## Fields (data.json)
- `food` (category): the food
- `group` (category): its food group
- `kcal` (number, unit "kcal per person per day", format count): calories available per person per day
- `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 cell to read its calories and share
- hover a group in the key to light it
- Motion: Cells bloom out of their own centres one food group at a time, then the labels settle in.
- Sound: A pop 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": "voronoi-treemap",
  "title": "Wheat and rice give the world twice the calories of all animal foods",
  "subtitle": "Calories available per person per day, world, by food, 2024",
  "data": "/charts/voronoi-treemap.data.json"
}
```

## Source
Dietary composition by country (calories per person per day), Our World in Data (UN Food and Agriculture Organization, Food Balances) (CC BY 4.0), retrieved 2026-12-01: https://ourworldindata.org/grapher/dietary-composition-by-country

Note: Calories available for consumption, not eaten: food wasted at home is included. Cell areas are fitted by an iterative weighted Voronoi layout, accurate to within a few per cent.

Inspired by: [Computing Voronoi Treemaps](https://doi.org/10.1111/j.1467-8659.2012.03078.x), Arlind Nocaj and Ulrik Brandes (linked, not copied).

Live: /charts/voronoi-treemap · Manifest: /charts/voronoi-treemap.json · Tags: voronoi treemap, voronoi, power diagram, organic, part to whole, food, calories, diet, nested
