DataViz.Layout.Chord
- Package
- purescript-hylograph-layout
- Repository
- afcondon/purescript-hylograph-layout
DataViz.Layout.Chord
Pure PureScript chord diagram layout algorithm.
A chord diagram shows relationships between nodes arranged in a circle, with ribbons (curved bands) connecting related nodes.
This module provides pure layout computation that can be used with any rendering backend (Hylograph HATS, D3, Canvas, SVG, etc.)
Example usage:
import DataViz.Layout.Chord (layout)
let matrix = [[0,1,2],[1,0,3],[2,3,0]]
result = layout matrix
-- result.groups contains arc positions
-- result.chords contains ribbon connections
For rendering, use the path generators in Hylograph.Expr.Path.Generators:
genArcfor the arc segmentsgenRibbonfor the ribbon paths
Re-exports from DataViz.Layout.Chord.Layout
#layoutWithConfig Source
layoutWithConfig :: LayoutConfig -> Array (Array Number) -> ChordLayoutLayout a chord diagram with custom configuration
#layout Source
layout :: Array (Array Number) -> ChordLayoutLayout a chord diagram with default configuration
Re-exports from DataViz.Layout.Chord.Types
#ChordLayout Source
type ChordLayout = { chords :: Array Chord, groups :: Array ChordGroup }Complete chord layout ready for rendering
#ChordGroup Source
type ChordGroup = { endAngle :: Number, index :: Int, startAngle :: Number, value :: Number }A group (arc) in the chord layout Represents a single node's portion of the circle perimeter
#Chord Source
type Chord = { source :: ChordGroup, target :: ChordGroup }A chord (ribbon) connecting two groups Represents the flow between two nodes
#defaultConfig Source
defaultConfig :: LayoutConfigDefault layout configuration
- Modules
- DataViz.
Layout. Adjacency - DataViz.
Layout. Adjacency. Layout - DataViz.
Layout. Adjacency. Types - DataViz.
Layout. Chord - DataViz.
Layout. Chord. Layout - DataViz.
Layout. Chord. Types - DataViz.
Layout. Hierarchy. Cluster - DataViz.
Layout. Hierarchy. Core - DataViz.
Layout. Hierarchy. EdgeBundle - DataViz.
Layout. Hierarchy. EdgeBundle. Bilink - DataViz.
Layout. Hierarchy. EdgeBundle. BundleCurve - DataViz.
Layout. Hierarchy. EdgeBundle. Hierarchy - DataViz.
Layout. Hierarchy. EdgeBundle. RadialCluster - DataViz.
Layout. Hierarchy. EdgeBundle. Types - DataViz.
Layout. Hierarchy. Link - DataViz.
Layout. Hierarchy. Pack - DataViz.
Layout. Hierarchy. Partition - DataViz.
Layout. Hierarchy. Tree - DataViz.
Layout. Hierarchy. TreeStyle - DataViz.
Layout. Hierarchy. Treemap - DataViz.
Layout. Hierarchy. Types - DataViz.
Layout. Pattern - DataViz.
Layout. Pattern. Types - DataViz.
Layout. Sankey. CSV - DataViz.
Layout. Sankey. Compute - DataViz.
Layout. Sankey. ComputeWithSteps - DataViz.
Layout. Sankey. Path - DataViz.
Layout. Sankey. Types - DataViz.
Layout. StateMachine - DataViz.
Layout. StateMachine. Layout - DataViz.
Layout. StateMachine. Path - DataViz.
Layout. StateMachine. Types