Skip to content
Calm motion: animations on this site only fade, with no movement

Chord diagram ​

Groups around a circle, with ribbons for the flows between them

Shows flows in both directions between a few groups, for example the listeners who move from one show to another. For flows in one direction through steps, use the Sankey chart.

Basic
Listeners moving between shows
FromTo Morning BriefTo Deep DiveTo Weekend ChatTo Tech Corner
Morning Brief0420018002500
Deep Dive3000012002000
Weekend Chat15009000600
Tech Corner280022004000
  • groups is a list of groups, each with a key, a label, and an optional color.
  • matrix is a square grid in the order of the groups. matrix[i][j] is the flow from group i to group j.
  • The arc of a group follows the sum of its row. Each ribbon joins two groups. Its width at each end is the flow out of that end, and its color is the color of the bigger flow.
  • A hover on a ribbon makes the others faint and shows the flows both ways. size sets the width of the chart (default 320), and format sets the text of a value.
  • Keep to about eight groups, so that the labels and the ribbons stay easy to read.
  • For screen readers, the chart is a table of the full matrix. label names the table. Change the words with labels or a label pack: from, and to (a function of the name).

Usage ​

ts
import { BlessChordDiagram } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
groups*BlessChordGroup[]—
matrix*number[][]—`matrix[i][j]` is the flow from group i to group j
sizenumber320the width of the chart in pixels
format((v: number) => string)—
labelstring"Chart"names the chart and its table for screen readers
labelsPartial<{ from: string; to: (name: string) => string; }>—

Released under the MIT License. Character names and artwork belong to their owners.