Hylograph.Forces.Linkage
- Package
- purescript-hylograph-forces
- Repository
- afcondon/purescript-hylograph-forces
Links joined to their nodes: what the link force and the directional constraint both start from.
The degree counts and the bias are d3-force 3.0.0's (link.js,
initialize; ISC, Copyright 2010-2021 Mike Bostock; see LICENSE).
A link can name its nodes by their place in the node array (joinByPlace) or
by an id read off each node (joinById). By place, a link that names a
place outside the array is dropped. By id, a link that names an id no
node has is an error, with d3's message.
#Identified Source
type Identified :: Type -> Row Type -> Typetype Identified id row = { source :: id, target :: id | row }
A link, by the ids of its two nodes.
#Joined Source
type Joined :: Row Type -> Type -> Typetype Joined row link = { bias :: Number, link :: link, source :: Node row, sourceDegree :: Number, target :: Node row, targetDegree :: Number }
A link with its nodes found. The degrees are d3's count: how many
links touch each end. bias is d3's
count[source] / (count[source] + count[target]): the share of a
correction that the target takes, so that the better connected end moves
less.
#joinById Source
joinById :: forall id row linkRow. Ord id => Show id => (Node row -> id) -> Array (Node row) -> Array (Identified id linkRow) -> Either String (Array (Joined row (Identified id linkRow)))Join links that name their nodes by id: d3's force.id(...). Where two
nodes share an id the later one is meant, as in d3. A link whose source
or target is no node's id gives d3's error, node not found: <id>.
- Modules
- Hylograph.
Forces - Hylograph.
Forces. Center - Hylograph.
Forces. Cohesion - Hylograph.
Forces. Collide - Hylograph.
Forces. Contain - Hylograph.
Forces. Directional - Hylograph.
Forces. Group - Hylograph.
Forces. Link - Hylograph.
Forces. Linkage - Hylograph.
Forces. ManyBody - Hylograph.
Forces. Measure - Hylograph.
Forces. Node - Hylograph.
Forces. Position - Hylograph.
Forces. Quadtree - Hylograph.
Forces. Radial - Hylograph.
Forces. Random - Hylograph.
Forces. RectCollide - Hylograph.
Forces. Snapshot - Hylograph.
Forces. Tick - Hylograph.
Forces. Towards