# Two-column links

> Use a two-column link chart (a bipartite graph) to show which items on the left connect to which items on the right, and how strongly. Takes the example's crops-and-producers table or any two-sided links as { left: [{ name, total? }], links: [{ left, right, value }] }.

- Data type: Movement between stages (`flow`)
- Pro · not released yet: its code is not available; try it on its page, or use a free chart of the same data type (`flow`)
- Example: **Three countries grow more than half the world's coffee, and three more than half its cocoa** (Top three producers of four crops, share of world production by weight, 2024)
- How to read it: Each crop on the left is its whole world harvest; ribbons run to the three biggest growers on the right, as wide as their share, and the faint rest is everyone else.
- Phone: Adapts to mobile (Draws its own phone layout below 520px) · Video formats: 16:9 (best 16:9)

## Use it when
- there are two kinds of thing and links only run between the kinds
- some items on one side link to several on the other
- there are up to about 15 items a side
- any items linked to another kind with a weight (products to suppliers, skills to teams, topics to sources): pass { left, links }; a left item's total is the whole its links are a share of, else their sum

## Avoid it when
- links also run within a side (use a network)
- there are more than two stages (use a Sankey)
- every item links to every other (use a heatmap)

## Fields (data.json)
- `crops[].crop` (category): the left column
- `crops[].year` (year): the year of the figures
- `crops[].worldTonnes` (number, unit "tonnes", format count): world production, tonnes
- `links[].crop` (category): the crop a link starts from
- `links[].country` (place): the producer it runs to
- `links[].tonnes` (number, unit "tonnes", format count): tonnes that country produced

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 ribbon to read a country's share
- hover a crop or a country to light its links
- Motion: The ribbons draw across from the crops to the growers one after another.
- Sound: A pop on hover pitched by crop. 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": "bipartite",
  "title": "Three countries grow more than half the world's coffee, and three more than half its cocoa",
  "subtitle": "Top three producers of four crops, share of world production by weight, 2024",
  "data": "/charts/bipartite.data.json"
}
```

## Source
Coffee, cocoa bean, banana and avocado production, Our World in Data, from the Food and Agriculture Organization of the United Nations (FAOSTAT) (CC BY 4.0), retrieved 2026-12-01: https://ourworldindata.org/grapher/coffee-bean-production

Note: Shares are of each crop's own world total, so the four crops fill the same height whatever their tonnes. Coffee is green coffee beans.

Live: /charts/bipartite · Manifest: /charts/bipartite.json · Tags: bipartite, links, two columns, food, agriculture, coffee, trade
