DataViz.Layout.Hierarchy.Types
- Package
- purescript-hylograph-layout
- Repository
- afcondon/purescript-hylograph-layout
DataViz.Layout.Hierarchy.Types
Pure PureScript implementation of D3 hierarchy types. Follows D3's conceptual model but uses separate types for each processing phase.
#HierarchyNode Source
data HierarchyNode aBasic hierarchy node after construction
Analogous to D3's Node structure but without layout-specific fields
Type parameter a represents the user's data type
Note: This is a data type (not newtype or type synonym) to allow:
- Recursive definition without cycles
- Pattern matching
- Direct field access via record syntax
Constructors
HNode { children :: Array (HierarchyNode a), data_ :: a, depth :: Int, height :: Int, parent :: Maybe (HierarchyNode a) }
Instances
(Eq a) => Eq (HierarchyNode a)(Show a) => Show (HierarchyNode a)
#ValuedNode Source
data ValuedNode aNode with computed value (after calling .sum() or .count()) This is a separate type to ensure type safety - can't use value before computing it
Constructors
VNode { children :: Array (ValuedNode a), data_ :: a, depth :: Int, height :: Int, parent :: Maybe (ValuedNode a), value :: Number }
Instances
(Eq a) => Eq (ValuedNode a)(Show a) => Show (ValuedNode a)
#getData Source
getData :: forall a. HierarchyNode a -> aHelper functions to access node fields
#getDepth Source
getDepth :: forall a. HierarchyNode a -> Int#getHeight Source
getHeight :: forall a. HierarchyNode a -> Int#getParent Source
getParent :: forall a. HierarchyNode a -> Maybe (HierarchyNode a)#getChildren Source
getChildren :: forall a. HierarchyNode a -> Array (HierarchyNode a)#getValuedData Source
getValuedData :: forall a. ValuedNode a -> aHelper functions for ValuedNode
#getValue Source
getValue :: forall a. ValuedNode a -> Number#getValuedDepth Source
getValuedDepth :: forall a. ValuedNode a -> Int#getValuedHeight Source
getValuedHeight :: forall a. ValuedNode a -> Int#getValuedChildren Source
getValuedChildren :: forall a. ValuedNode a -> Array (ValuedNode a)#HierarchyConfig Source
type HierarchyConfig a = { children :: a -> Maybe (Array a) }Configuration for hierarchy construction
#Hierarchy Source
type Hierarchy a = HierarchyNode aResult of hierarchy construction Just a type alias for clarity
#ValuedHierarchy Source
type ValuedHierarchy a = ValuedNode aResult of sum/count operations Just a type alias for clarity
- 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