{
  "id": "magnet-clusters",
  "name": "Magnet clusters",
  "family": "parts",
  "tier": "pro",
  "physics": [
    "gravity",
    "drag",
    "size",
    "seed"
  ],
  "summary": "Use magnet clusters to sort items into groups you can see: each item is a dot pulled to its group's magnet, and switching what a dot weighs re-sorts the story.",
  "title": "Most countries are high-income, but three in four people live in middle-income ones",
  "subtitle": "Countries by World Bank income group; dot area is population, 2025",
  "howToRead": "Each dot is one country, pulled to the magnet for its income group; switch to one dot per country to count countries instead of people.",
  "useWhen": [
    "sorting 30 to 300 items into 2 to 6 groups",
    "the count of items and their total size tell different stories",
    "a lively alternative to a grouped bar"
  ],
  "avoidWhen": [
    "the exact size of each cluster matters (use bars)",
    "items belong to more than one group",
    "more than six groups"
  ],
  "fields": [
    {
      "name": "groups",
      "type": "category",
      "description": "World Bank income groups, poorest first"
    },
    {
      "name": "countries[][0]",
      "type": "place",
      "description": "country"
    },
    {
      "name": "countries[][1]",
      "type": "id",
      "description": "index into groups"
    },
    {
      "name": "countries[][2]",
      "type": "number",
      "description": "population",
      "unit": "people",
      "format": "count"
    },
    {
      "name": "year",
      "type": "year",
      "description": "population year"
    }
  ],
  "interactive": [
    "regroup"
  ],
  "interactions": [
    "switch between dot size by people and one dot per country",
    "hover or tap a dot to read the country",
    "hover a group's label for its totals"
  ],
  "motion": "Dots start scattered like iron filings, then a force simulation pulls each to its magnet; switching the sizing makes the clusters swell or shrink and repack.",
  "sound": "A whoosh as the magnets switch on; a pop on hover. Quiet while it draws and between steps; mute it from its card.",
  "annotations": [
    {
      "type": "underline",
      "words": "three in four",
      "in": "title"
    }
  ],
  "tags": [
    "force",
    "clusters",
    "groups",
    "beeswarm",
    "income",
    "population",
    "economics"
  ],
  "mobile": "adapts",
  "mobileNote": "Draws its own phone layout below 520px",
  "mobileChecked": "2026-12-02",
  "ratios": [
    "16:9"
  ],
  "bestRatio": "16:9",
  "source": {
    "title": "World Bank country classifications and Population, total (SP.POP.TOTL)",
    "publisher": "World Bank (World Development Indicators API)",
    "url": "https://api.worldbank.org/v2/country?format=json&per_page=400",
    "license": "CC BY 4.0",
    "retrieved": "2026-12-01"
  },
  "note": "Shares are of the 217 economies the World Bank classifies and reports a population for. Group thresholds are set each July by gross national income per person."
}