Module
Hylograph.Forces.Cohesion
- Package
- purescript-hylograph-forces
- Repository
- afcondon/purescript-hylograph-forces
Group cohesion: pull each node toward the centroid of its group.
Not in d3. The rule is the Rust kernel's (apply_cohesion in
force-kernel/src/forces.rs), and the two are held to each other bit
for bit by test/differential.mjs.
The centroid of a group is the mean position of its members whose position is finite, summed in node order. For every node in a group whose position is finite:
v += (centroid - position) * strength * alpha
A node in no group is left alone and counts toward no centroid. A
strength of NaN counts as zero, and such a node still counts toward
its group's centroid.
- 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