{
  "id": "adjacency-matrix",
  "name": "Adjacency matrix",
  "family": "flow",
  "tier": "free",
  "summary": "Use an adjacency matrix to show who links to whom in a dense network: one row and one column per node, a filled cell for each link, and reordering to reveal clusters. Takes the example's Eurovision votes or any { rows, cols, layers: [{ name, matrix }] }, with a button per layer.",
  "title": "Neighbours still trade Eurovision's top marks: Greece and Cyprus gave each other 12",
  "subtitle": "Points from each voting country to each finalist, Eurovision Song Contest 2026 grand final",
  "howToRead": "Each row is a country giving points and each column a finalist receiving them; darker cells are more points, and the highlighted cells are 12s.",
  "useWhen": [
    "the network is dense, so lines would tangle",
    "readers must look up any one pair",
    "reordering rows and columns can reveal blocs or clusters",
    "any who-to-whom counts (reviews between engineers, trade between regions, messages between teams): pass { rows, cols, layers }; a row and column with the same name is drawn dashed as itself"
  ],
  "avoidWhen": [
    "you want to show paths through the network (use a node-link drawing)",
    "there are hundreds of nodes",
    "most cells would be empty and the few links matter (use an arc diagram)"
  ],
  "fields": [
    {
      "name": "finalists",
      "type": "category",
      "description": "the 25 countries in the grand final (columns)"
    },
    {
      "name": "televoters, juryVoters",
      "type": "category",
      "description": "the countries voting (rows); the televote adds the Rest of the World"
    },
    {
      "name": "tele, jury",
      "type": "number",
      "description": "matrix[row][column]: points given, 0 to 12",
      "unit": "points",
      "format": "count"
    },
    {
      "name": "totals",
      "type": "number",
      "description": "each finalist's jury, televote and total points",
      "unit": "points",
      "format": "count"
    }
  ],
  "shapes": [
    {
      "when": [
        "layers"
      ],
      "fields": [
        {
          "name": "rows",
          "type": "category",
          "description": "the row names (who gives)"
        },
        {
          "name": "cols",
          "type": "category",
          "description": "the column names (who receives); up to about 30"
        },
        {
          "name": "layers[].name",
          "type": "category",
          "description": "each layer's name, one button each (one layer: no buttons)"
        },
        {
          "name": "layers[].matrix",
          "type": "number",
          "sign": "non-negative",
          "description": "matrix[row][column]: the count or score from that row to that column"
        },
        {
          "name": "year",
          "type": "year",
          "description": "optional: the year, shown in tooltips",
          "optional": true
        }
      ]
    }
  ],
  "hints": {
    "layers": "Televote; Jury",
    "key": "1; 4; 8; 10; 12",
    "names": {
      "Rest of the World": "Rest of world"
    }
  },
  "interactive": [
    "sort"
  ],
  "interactions": [
    "hover or tap a cell to read the points one country gave another",
    "switch between televote and jury",
    "reorder by neighbours, by points received, or alphabetically"
  ],
  "motion": "Cells fade in row by row; reordering slides every row and column to its new place.",
  "sound": "A whoosh on each reorder; a pop on hover pitched by points. Quiet while it draws and between steps; mute it from its card.",
  "annotations": [
    {
      "type": "underline",
      "words": "gave each other 12",
      "in": "title"
    }
  ],
  "tags": [
    "matrix",
    "network",
    "who links to whom",
    "reorderable",
    "Eurovision",
    "music",
    "voting blocs"
  ],
  "mobile": "desktop",
  "mobileNote": "79 labels overlap on a phone",
  "mobileChecked": "2026-12-02",
  "ratios": [],
  "bestRatio": "16:9",
  "source": {
    "title": "Eurovision Song Contest 2026: detailed voting results of the final",
    "publisher": "Wikipedia, citing the European Broadcasting Union",
    "url": "https://en.wikipedia.org/wiki/Eurovision_Song_Contest_2026",
    "license": "CC BY-SA 4.0",
    "retrieved": "2026-12-01"
  },
  "note": "Dashed cells are a country's own column: no country can vote for itself. \"Order: neighbours\" pulls together rows and columns that give and receive points from each other; it is a simple seriation, not a statistical test of blocs.",
  "reference": {
    "title": "Les Misérables co-occurrence",
    "author": "Mike Bostock",
    "url": "https://bost.ocks.org/mike/miserables/"
  }
}