# Kingdom map

> Use a kingdom map to turn shares of one whole into territories on an invented continent, so the biggest share reads as the biggest realm.

- 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: **Coal still rules a third of the world's electricity, and solar's young realm has just passed wind's** (Share of world electricity generation by source, %, 2025)
- How to read it: Each territory's land area is its share of the world's electricity; the crowned realm is the largest.
- Phone: Adapts to mobile (Draws its own phone layout below 520px) · Video formats: 16:9, 9:16 (best 9:16)

## Use it when
- shares of one whole, 3 to 7 parts
- a playful, memorable view for an explainer or a poster
- the ranking matters more than exact values

## Avoid it when
- readers must compare close shares exactly (use sorted bars)
- more than seven parts
- the parts do not add up to one whole

## Fields (data.json)
- `year` (year): the year of the shares
- `sources[].source` (category): the electricity source; becomes a territory
- `sources[].share` (number, unit "%", format percent): share of world electricity generation, %; sets the territory's area

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 territory to read its share
- Motion: Each territory spreads out from its capital in turn, largest first, like a kingdom claiming land.
- Sound: A soft pop on hover, pitched by rank. 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": "kingdom-map",
  "title": "Coal still rules a third of the world's electricity, and solar's young realm has just passed wind's",
  "subtitle": "Share of world electricity generation by source, %, 2025",
  "data": "/charts/kingdom-map.data.json"
}
```

## Source
Share of electricity generated by source, Our World in Data (Ember; Energy Institute Statistical Review of World Energy) (CC BY 4.0), retrieved 2026-12-01: https://ourworldindata.org/grapher/share-elec-by-source

Note: Oil, bioenergy and other renewables are folded into one small realm. The coastline and borders are drawn from seeded noise and a weighted Voronoi (power) diagram; only the areas carry data, within about one percent.

Inspired by: [Fantasy cartography in data visualisation](https://xeno.graphics/), various (linked, not copied).

Live: /charts/kingdom-map · Manifest: /charts/kingdom-map.json · Tags: fantasy map, voronoi, power diagram, territories, shares, energy, electricity, playful
