Hylograph.Forces.ThreeD.Link
- Package
- purescript-hylograph-forces
- Repository
- afcondon/purescript-hylograph-forces
The link force in three dimensions: each link is a spring that pulls its two nodes towards a set distance apart.
Ported from d3-force-3d 3.0.6, link.js (MIT, Copyright 2017 Vasco
Asturiano; itself from d3-force, ISC, Mike Bostock); see LICENSE. It is
d3-force's link.js with a third coordinate and nothing else.
The joining of links to nodes (Hylograph.Forces.Linkage: degrees,
bias, by place or by id) has no dimension and is the two-dimensional
force's.
#strengthFromDegree Source
strengthFromDegree :: forall link. Strength linkd3's default: 1 / min(degree of source, degree of target).
#strengthPerLink Source
strengthPerLink :: forall link. (link -> Number) -> Strength linkA strength asked of each link when the force is initialized.
#defaultConfig Source
defaultConfig :: forall link. Config linkd3's defaults: distance 30, strength from degree, one iteration.
#initialize Source
initialize :: forall row linkRow. Config (Endpoints linkRow) -> Source -> Array (Node row) -> Array (Endpoints linkRow) -> Link rowforce.initialize(nodes, random, 3) together with force.links(links),
for links that name their nodes by place in the node array. A link
naming a place outside the array is dropped.
#initializeById Source
initializeById :: forall id row linkRow. Ord id => Show id => (Node row -> id) -> Config (Identified id linkRow) -> Source -> Array (Node row) -> Array (Identified id linkRow) -> Either String (Link row)The same for links that name their nodes by id; a link naming an id
that no node has is d3's error, node not found: <id>.
#apply Source
apply :: forall row. Link row -> Number -> Effect Unitd3-force-3d's force(alpha). Links are taken in order and each sees
what the ones before it did.
x = target.x + target.vx - source.x - source.vx || jiggle(random);
y = target.y + target.vy - source.y - source.vy || jiggle(random);
z = target.z + target.vz - source.z - source.vz || jiggle(random);
Re-exports from Hylograph.Forces.Linkage
#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.
- 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. ThreeD - Hylograph.
Forces. ThreeD. Center - Hylograph.
Forces. ThreeD. Collide - Hylograph.
Forces. ThreeD. Link - Hylograph.
Forces. ThreeD. ManyBody - Hylograph.
Forces. ThreeD. Node - Hylograph.
Forces. ThreeD. Octree - Hylograph.
Forces. ThreeD. Position - Hylograph.
Forces. ThreeD. Radial - Hylograph.
Forces. ThreeD. Tick - Hylograph.
Forces. Tick - Hylograph.
Forces. Towards