Hylograph.Forces.Node
- Package
- purescript-hylograph-forces
- Repository
- afcondon/purescript-hylograph-forces
The simulation node, as the rest of Hylograph hands it over: a JavaScript object typed as a record, which the forces update in place.
PureScript can read a record field but has no way to assign one, and
nothing in the package set does it either (Record.ST left record at
4.0). So this module holds the package's only foreign code: four
assignments, one line each, in Node.js. Every piece of arithmetic is
PureScript.
The fields are mutable behind the type system's back, so the forces follow one rule: a mutable field is read where its value is used, in the arguments of the write that replaces it or inside a pure function that returns before anything is written. It is never bound to a name across a write.
#writeIndex Source
writeIndex :: forall row. EffectFn2 (Node row) Int Unitnode.index = index, for d3's initializeNodes. d3 puts the index on
every node whether or not the application's node type has a field for
it, and so does this: the row is not asked to contain index.
- 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