Module

DataViz.Layout.Chord.Layout

Package
purescript-hylograph-layout
Repository
afcondon/purescript-hylograph-layout

DataViz.Layout.Chord.Layout

Pure PureScript implementation of the chord layout algorithm.

The algorithm:

  1. Compute row sums to get total value for each group
  2. Compute the grand total of all values
  3. Assign angular extent to each group proportional to its value
  4. For each non-zero matrix[i][j], create a chord connecting groups
  5. Track angular position within each group for ribbon placement

#layout Source

layout :: Array (Array Number) -> ChordLayout

Layout a chord diagram with default configuration

#layoutWithConfig Source

layoutWithConfig :: LayoutConfig -> Array (Array Number) -> ChordLayout

Layout a chord diagram with custom configuration