Module
DataViz.Layout.Hierarchy.EdgeBundle.Bilink
- Package
- purescript-hylograph-layout
- Repository
- afcondon/purescript-hylograph-layout
DataViz.Layout.Hierarchy.EdgeBundle.Bilink
Create bidirectional links between nodes based on imports. This implements D3's bilink pattern:
- Each leaf node gets an "outgoing" array (imports it makes)
- Each leaf node gets an "incoming" array (nodes that import it)
#BilinkedTree Source
type BilinkedTree a = BilinkedNode aType alias for the complete bilinked tree
#BilinkedNode Source
data BilinkedNode aA node with bidirectional link information
Constructors
BilinkedNode { children :: Array (BilinkedNode a), data_ :: Maybe a, depth :: Int, fullName :: String, height :: Int, incoming :: Array Link, name :: String, outgoing :: Array Link }
Instances
(Show a) => Show (BilinkedNode a)
#bilink Source
bilink :: forall a. (a -> Array String) -> TreeNode a -> BilinkedTree aCreate bidirectional links from a hierarchy and import data
Algorithm:
- Build a map from fullName -> leaf node
- For each leaf with imports, create outgoing links
- For each outgoing link, add corresponding incoming link to target
Takes:
- A tree built from buildHierarchy
- A function to get imports from the leaf data
#getOutgoing Source
getOutgoing :: forall a. BilinkedNode a -> Array LinkGet outgoing links from a node
#getIncoming Source
getIncoming :: forall a. BilinkedNode a -> Array LinkGet incoming links to a node
#getBilinkedData Source
getBilinkedData :: forall a. BilinkedNode a -> Maybe aGet the data from a bilinked node
#getBilinkedChildren Source
getBilinkedChildren :: forall a. BilinkedNode a -> Array (BilinkedNode a)Get children of a bilinked node
#getBilinkedFullName Source
getBilinkedFullName :: forall a. BilinkedNode a -> StringGet full name of a bilinked node
#allBilinkedNodes Source
allBilinkedNodes :: forall a. BilinkedNode a -> Array (BilinkedNode a)Get all nodes in the tree (pre-order)
#allBilinkedLeaves Source
allBilinkedLeaves :: forall a. BilinkedNode a -> Array (BilinkedNode a)Get all leaf nodes from a bilinked tree
- 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