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 a

Type alias for the complete bilinked tree

#BilinkedNode Source

data BilinkedNode a

A node with bidirectional link information

Constructors

Instances

#getOutgoing Source

getOutgoing :: forall a. BilinkedNode a -> Array Link

Get outgoing links from a node

#getIncoming Source

getIncoming :: forall a. BilinkedNode a -> Array Link

Get incoming links to a node

#getBilinkedData Source

getBilinkedData :: forall a. BilinkedNode a -> Maybe a

Get 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 -> String

Get 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