Module implementing a chord chart. A chord chart displays directed relationship between groups of segments. Each segment is represented by a slice in the chord and ribbons correspond to the flow between segments. In case of a flow matrix M, the color of a ribbon from segment i to segment j is always the color of the net receiver. That is, if M[i][j] = 3 and M[j][i] = 10, there is 7 more flow from j to i and the color of the ribbon between these segments is the same as the color of segment i (the target of the larger flow).
Requires: d3@v4du.Widget
ChordChart
du.widgets.chordchart.ChordChart(name[, parent])
The chord chart widget class.
arg
type
description
name
string
Identifier of the widget.
parent
object
Parent element to append widget to. If not specified, widget is appended to body. optional
radius
du.widgets.chordchart.ChordChart.radius(size)
Sets radius in pixels. Default is 100.
arg
type
description
size
number
Size of the radius in pixels.
return
description
du.widgets.chordchart.ChordChart
Reference to the current ChordChart.
thickness
du.widgets.chordchart.ChordChart.thickness(size)
Sets the thickness of the segments. Default is 10.
arg
type
description
size
number
Size of the thickness in pixels.
return
description
du.widgets.chordchart.ChordChart
Reference to the current ChordChart.
ticks
du.widgets.chordchart.ChordChart.ticks(on)
Whether to have ticks (labels on the segments). Default is false.
arg
type
description
on
boolean
Whether to have ticks or not.
return
description
du.widgets.chordchart.ChordChart
Reference to the current ChordChart.
invert
du.widgets.chordchart.ChordChart.invert(on)
Inverts the chord meaning the color of each chord now correspods to the largest source instead of the largest target.
arg
type
description
on
boolean
If chord should be inverted.
return
description
du.widgets.chordchart.ChordChart
Reference to the current ChordChart.
data
du.widgets.chordchart.ChordChart.data(data)
Binds data to the chord chart. Expected data format: array of object with properties source, target and value corresponding to the flows in the matrix to visualize. Missing source/target pairs default to zero flow.