Skip to content

Type Alias: ChordTrace ​

ts
type ChordTrace = Omit<CommonTraceAttributes, 'hoverinfo'> & DomainTraceAttributes & object;

Chord diagram: nodes as arcs of a ring, as wide as their flow, and links as ribbons between them; from node / link (as sankey and graph take them) or from a square matrix.

Type Declaration ​

NameTypeDescription
directed?booleanWhether a link has a direction. Every link takes its value of its source arc and of its target arc, so an arc is as wide as the outgoing plus the incoming flow of its node, directed or not. Directed links can end in an arrowhead (link.arrowlen) or short of the ring (link.targetgap), and hover labels tell outgoing from incoming flow; undirected links are one symmetric band. See matrix for how a matrix is read.
direction?"clockwise" | "counterclockwise"Direction in which the arcs follow each other.
groups?ChordTraceGroupsThe outer ring of node.group: one arc around the nodes of every group, with its name.
hoverinfo?"all" | "none" | "skip"Hover of nodes and links: labels ('all'), highlighting without labels ('none') or no hover at all ('skip'). The default of node.hoverinfo and link.hoverinfo.
labels?DataColumnNode labels, one per row of matrix. The default of node.label, which wins when both are given.
link?ChordTraceLinkThe links: ribbons between the arcs.
matrix?DataColumnThe flows as a square matrix, instead of link: matrix[i][j] is the flow from node i to node j. Directed (the default), every positive cell is a ribbon. With directed: false every pair of nodes has one ribbon, matrix[i][j] wide at i and matrix[j][i] wide at j (a symmetric matrix gives ribbons as wide at both ends). Missing cells are 0; negative and non-numeric cells are left out and counted in the description. Ignored when link.source and link.target are given.
node?ChordTraceNodeThe nodes: arcs of the ring.
padangle?numberGap between neighbouring arcs, in degrees. The gaps take at most half the ring: more is scaled down. Minimum: 0
rotation?numberWhere the first arc starts, in degrees clockwise from 12 o'clock.
sort?"input" | "value" | "group"Order of the arcs around the ring. 'input': by node index. 'value': widest first. 'group': groups by name (numbers by value), nodes by index. With node.group the nodes of a group are always next to each other: 'input' then orders the groups by their first node and 'value' by their width.
textfont?ChordTraceTextfontFont of the node labels. Default: layout.font.
textorientation?"auto" | "radial" | "tangential" | "none"Node labels, outside the ring. 'radial': along the radius, reading away from the center on the right half and towards it on the left, so no label is upside down. 'tangential': across the radius, flipped on the lower half. 'auto': tangential when every label fits along its arc, else radial. 'none': no labels (they still show in hover labels). A label that does not fit its arc is not drawn; a radial label too long for the room around the ring is cut with an ellipsis.
type"chord"Trace type.
valueformat?stringd3-format of the node and link values in hover labels (%{value}).
valuesuffix?stringText after the values in hover labels (a unit such as GWh).

Released under the MIT License.