# Force network

> Use a force network to show who connects to whom when the shape of the web matters more than exact positions; readers can drag it apart. Takes any { nodes: [{ name, group?, <number>? }], links: [[i, j] or { source, target }] }: links count each node's degree, circles are sized by any number field, and nodes with no links get a dashed ring.

- Data type: Movement between stages (`flow`)
- Free (MIT): install with `npx chartreuse add force-network`, or registry item `/r/force-network.json`
- Example: **DR Congo touches nine neighbours, more than any other African country** (African countries joined by a shared land border; circle area is population, 2024)
- How to read it: Each circle is a country, sized by population; a line means the two share a land border, and dashed rings mark islands with none.
- Interactive: drag
- Phone: Not recommended for mobile (5 labels are cut off at the drawing's edge) · Video formats: none passed; closest 16:9

## Use it when
- the data is a set of links with no natural layout
- clusters, hubs and loners are the story
- there are 20 to 150 nodes
- any who-links-to-whom data (people, services, papers, stations): links can be node indices, ids or names

## Avoid it when
- readers need to look up a specific pair (use an adjacency matrix)
- the network is very dense (it becomes a hairball)
- positions carry meaning, such as places on a map (use a map)

## Fields (data.json)
- `groups` (category): the five UN subregions, in ink order (optional: else groups come in order of first use; past six share one ink and the key says other)
- `nodes[].name` (place): the country
- `nodes[].group` (category): its UN subregion (optional: a group sets colour and a loose home; the hint homes places groups)
- `nodes[].population` (number, unit "people", format count): people, 2024 (null where the World Bank has no figure): the circle's size (optional: any number field works, or name it with the hint size; none sizes by links)
- `nodes[].borders` (number, unit "neighbours", format count): number of African land neighbours (optional: the chart counts each node's links itself)
- `links` (id): pairs of node indices that share a land border; also [id, id], [name, name] or { source, target }

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
- drag a country and the network follows, then settles
- hover or tap a country to light its neighbours
- Motion: The countries start bunched together and the forces open them out into a loose map of the continent once; dragging reheats it.
- Sound: A pop when you pick a country up and a plink when you drop it. 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": "force-network",
  "title": "DR Congo touches nine neighbours, more than any other African country",
  "subtitle": "African countries joined by a shared land border; circle area is population, 2024",
  "data": "/charts/force-network.data.json"
}
```

## Source
Natural Earth 1:50m countries (world-atlas), UN M49 regions, World Bank population, Natural Earth; United Nations Statistics Division; World Bank (Public domain (Natural Earth); CC BY 4.0 (World Bank)), retrieved 2026-12-01: https://www.naturalearthdata.com/downloads/50m-cultural-vectors/

Note: Borders are boundaries shared in Natural Earth's 1:50m map, so a tiny touch such as Zambia–Botswana at Kazungula may be missed. Western Sahara is shown as Natural Earth draws it.

Live: /charts/force-network · Manifest: /charts/force-network.json · Tags: network, graph, borders, Africa, geography, draggable, physics
