Skip to content

mdequeljoe/d3-chord2

Repository files navigation

d3-chord2

d3-chord2 forks d3-chord in a plug-in format in order to provide minor extensions such as grouped arcs and target or source arrows for directionality. Also envisioned to add 'flattened' arcs.

Installing

...

<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="d3-chord2.js"></script>
<script>

var chord = d3.chord2();

</script>

Note

Work in progress and not on npm - and still needs proper testing. Feedback welcome.

API Reference

d3-chord2 builds on the API of d3-chord

# d3.chord2() <>

Constructs a new chord layout with the default settings.

# chord2.arcGroups([matrix]) <>

if arcGroups is specified, the chord groups indices specified in the subarrays will be connected (i.e. 0 padAngle between these groupings). Any group indices left unspecified will be laid out according to padAngle. Of course, if padAngle is set to zero then the arc groupings will not be seen. Note that by default, the arc groups will be ordered according to the order of arrays specified in group matrix.

# chord2.sortArcGroups([compare]) <>

If compare is specified, sets the arc group comparator to the specified function or null and returns this chord layout. If compare is not specified, returns the current arc group comparator, which defaults to null. If the group comparator is non-null, it is used to sort the arc groups by the sum of the included groups. Note that groups not included in the group matrix will not be sorted.

# chord2.chordSum([sum]) <>

If chordSum is specified, scales chord groups according to this sum, rather than the sum of the groups specified in the data matrix. Note that chordSum must be greater than this input matrix sum.

# d3.chordArrow() <>

Constructs a new chord layout with the default settings.

# chordArrow.radius([radius]) <>

See ribbon.radius

# chordArrow.target([compare]) <>

See ribbon.target

# chordArrow.targetRadius([targetRadius]) <>

to do

# chordArrow.source([source]) <>

See ribbon.source

# chordArrow.sourceRadius([sourceRadius]) <>

to do

Releases

No releases published

Packages

No packages published