Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mdequeljoe/d3-chord2
extensions to d3-chord
https://github.com/mdequeljoe/d3-chord2
d3 d3-module d3-plugin
Last synced: 12 days ago
JSON representation
extensions to d3-chord
- Host: GitHub
- URL: https://github.com/mdequeljoe/d3-chord2
- Owner: mdequeljoe
- License: bsd-3-clause
- Created: 2018-03-03T17:23:09.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2021-05-06T22:21:27.000Z (over 3 years ago)
- Last Synced: 2024-11-05T05:42:45.906Z (about 2 months ago)
- Topics: d3, d3-module, d3-plugin
- Language: JavaScript
- Homepage:
- Size: 154 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# d3-chord2
d3-chord2 forks [d3-chord](https://github.com/d3/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
...
```htmlvar chord = d3.chord2();
```
## NoteWork in progress and not on npm - and still needs proper testing. Feedback welcome.
## API Reference
d3-chord2 builds on the API of [d3-chord](https://github.com/d3/d3-chord)
# d3.chord2() [<>](https://github.com/mdequeljoe/d3-chord2/blob/master/src/chord2.js "Source")
Constructs a new chord layout with the default settings.
# chord2.arcGroups([matrix]) [<>](https://github.com/mdequeljoe/d3-chord2/blob/master/src/chord2.js#L168 "Source")
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]) [<>](https://github.com/mdequeljoe/d3-chord2/blob/master/src/chord2.js#L176 "Source")
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]) [<>](https://github.com/mdequeljoe/d3-chord2/blob/master/src/chord2.js#L172 "Source")
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() [<>](https://github.com/mdequeljoe/d3-chord2/blob/master/src/chordArrow.js "Source")
Constructs a new chord layout with the default settings.
# chordArrow.radius([radius]) [<>](https://github.com/mdequeljoe/d3-chord2/blob/master/src/chord2.js#L168 "Source")
See [ribbon.radius](https://github.com/d3/d3-chord#ribbon_radius)
# chordArrow.target([compare]) [<>](https://github.com/mdequeljoe/d3-chord2/blob/master/src/chord2.js#L176 "Source")
See [ribbon.target](https://github.com/d3/d3-chord#ribbon_target)
# chordArrow.targetRadius([targetRadius]) [<>](https://github.com/mdequeljoe/d3-chord2/blob/master/src/chord2.js#L176 "Source")
to do
# chordArrow.source([source]) [<>](https://github.com/mdequeljoe/d3-chord2/blob/master/src/chord2.js#L172 "Source")
See [ribbon.source](https://github.com/d3/d3-chord#ribbon_source)
# chordArrow.sourceRadius([sourceRadius]) [<>](https://github.com/mdequeljoe/d3-chord2/blob/master/src/chord2.js#L172 "Source")
to do