Module
DataViz.Layout.Hierarchy.Cluster
- Package
- purescript-hylograph-layout
- Repository
- afcondon/purescript-hylograph-layout
DataViz.Layout.Hierarchy.Cluster
Cluster (dendrogram) layout using Data.Tree Uses Reingold-Tilford algorithm for x-positioning (like Tree) But positions nodes by height (distance from leaves) instead of depth Result: All leaf nodes appear at the same level (y = 0)
#ClusterConfig Source
type ClusterConfig = { minSeparation :: Number, size :: { height :: Number, width :: Number } }Configuration for cluster layout
#defaultClusterConfig Source
defaultClusterConfig :: ClusterConfigDefault configuration
#cluster Source
cluster :: forall r. ClusterConfig -> Tree { height :: Int, x :: Number, y :: Number | r } -> Tree { height :: Int, x :: Number, y :: Number | r }Cluster layout in 4 steps:
- addHeight: Bottom-up pass computing height (distance from deepest leaf)
- sortByHeight: Sort children by height to minimize crossovers (D3 pattern)
- render: Bottom-up pass assigning sequential x to leaves, mean x to parents
- addY: Add y coordinates based on height (leaves at 0)
- scale: Scale abstract coordinates to pixel coordinates
Key difference from Tree:
- All leaves get sequential x positions (not contour-based)
- y is based on height (distance from leaves) not depth
- All leaves appear at y = 0 (dendrogram)
- Children sorted by height (descending) to minimize crossovers
Input must have x, y, height fields (initial values don't matter, they'll be overwritten)
- 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