du.widgets.chordchart

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@v4 du.Widget

ChordChart

du.widgets.chordchart.ChordChart(name[, parent])

The chord chart widget class.
argtypedescription
namestringIdentifier of the widget.
parentobjectParent 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.
argtypedescription
sizenumberSize of the radius in pixels.
returndescription
du.widgets.chordchart.ChordChartReference to the current ChordChart.

thickness

du.widgets.chordchart.ChordChart.thickness(size)

Sets the thickness of the segments. Default is 10.
argtypedescription
sizenumberSize of the thickness in pixels.
returndescription
du.widgets.chordchart.ChordChartReference to the current ChordChart.

ticks

du.widgets.chordchart.ChordChart.ticks(on)

Whether to have ticks (labels on the segments). Default is false.
argtypedescription
onbooleanWhether to have ticks or not.
returndescription
du.widgets.chordchart.ChordChartReference 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.
argtypedescription
onbooleanIf chord should be inverted.
returndescription
du.widgets.chordchart.ChordChartReference 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.
argtypedescription
dataArrayData to plot.
returndescription
du.widgets.chordchart.ChordChartReference to the current ChordChart.

highlight

du.widgets.chordchart.ChordChart.highlight(key, duration)

Highlights the specified segment.
argtypedescription
keystring string[]Single key or an array of keys of the segment(s) to highlight.
durationnumberDuration of the highlight animation.
returndescription
du.widgets.chordchart.ChordChartReference to the current ChordChart.