API reference

Conditions, formations & modes

The dimensions that shape the field independently of the forces themselves — when a force acts, a bias on every particle, how the field is drawn, and its colour.

Conditions

Gate any force with data-when; it acts only while the condition holds.

active per body
Only while the body is engaged..
fast per particle
Only on fast-moving matter (v² > 0.9)..
slow per particle
Only on calm matter (v² < 0.22)..
hot per particle
Only on energized matter (heat > 0.3)..
cool per particle
Only on calm, un-energized matter (heat < 0.08)..
scrolling per body
Only while the page is scrolling..

Formations

A formation is a single global bias on every particle at once. Switch it live with field.setFormation(name).

ambient resting drift
Ambient — the Hero state.
wells matter pools
Wells — the Work state.
lanes a current carries
Lanes — the Writing state.
scatter energy dispersed
Scatter — the Practice state.
accretion everything gathers
Accretion — the Contact state.

Render modes

The same physics, drawn differently. Set render or call field.setRender(mode).

dots
The default — each particle a soft dot, cool centre → warm edge → accent.
trails
Light-painting — particle history persists and fades.
links
Constellation — lines drawn between nearby particles.
metaballs
A liquid iso-surface — the swarm rendered as one molten skin via marching squares, not dots.
voronoi
Shattered glass — each particle owns a cell; the walls are the boundaries between nearest-neighbour regions.
streamlines
Draws the force field itself — a grid of arrows along the net push. A diagnostic view.

Palettes

The colour template the travelling accent journeys through. Swap with field.setPalette(name).

ours
#4da3ff #2dd4bf #a78bfa #ff6e9c #ff9d5c
heatmap
#2b3a8c #2d8fd4 #3fd07a #ffe14d #ff8a3d #e23b3b
infrared
#2a0a4a #8e24aa #e53935 #ff8f00 #ffd54f #fffde7
spectrum
#ff3b30 #ff9500 #ffcc00 #34c759 #00c7be #007aff #af52de