Skip to main content

Function: computeChordLayout()

computeChordLayout(matrix, options): ChordLayout

Defined in: src/mobjects/graphing/chordLayout.ts:120

Compute the arcs and ribbons of a chord diagram.

Group i's arc angle is proportional to the sum of row i. The cell matrix[i][j] is a sub-span on arc i; a ribbon joins the span (i, j) on arc i to the span (j, i) on arc j. One ribbon is produced per unordered pair whose combined flow is positive, including a self-ribbon when the diagonal is positive.

The function never throws. An empty matrix returns empty arrays, and an all-zero matrix returns zero-angle arcs and no ribbons.

Parameters​

matrix​

number[][]

The square flow matrix.

options​

ChordLayoutOptions = {}

Gap and start angle.

Returns​

ChordLayout

The computed layout.