API Reference
Full type signatures and module documentation are on Pursuit. This page maps the territory.
Pursuit Documentation
Each package has auto-generated API docs on Pursuit, the PureScript documentation hub. Click any package to browse its types, functions, and module structure.
hylograph-selection v0.6.0 Core: HATS trees, interpreters, scales, color schemes, coordinated highlighting, interactions. hylograph-simulation v1.1.0 Force simulation — n-body, collision, link, centring and six more forces, on a PureScript kernel with an optional Rust/WASM one. No D3: since 1.0 the forces arehylograph-forces.
hylograph-forces v0.1.0
The force kernel: d3-force’s seven forces in PureScript, held to d3-force 3.0.0 bit for bit, and six that d3 does not have (towards, rectangle collision, containment, cohesion, scoped many-body, directional links).
hylograph-wasm-kernel v1.0.0
The optional Rust/WASM kernel, carried inside the package: call install and engine: WASM works, with nothing to build or serve.
hylograph-simulation-halogen v0.6.0
Halogen subscription adapter: a simulation’s events as a Halogen emitter.
hylograph-layout v0.5.0
Layout algorithms in pure PureScript — tree, cluster, pack, partition, treemap, edge bundle, Sankey, chord.
hylograph-graph v0.3.1
Graph data structures and algorithms — shortest path, traversals, components, decomposition, topo sort.
hylograph-music v0.4.0
Data to sound — a proof-of-concept audio interpreter for HATS trees.
Key Signatures
Five functions that tell the whole programming model. Build a tree with elem and forEach, add interactivity with withBehaviors, render with rerender.
elem ::ElementTypeArrayAttrArrayTreeTree
Construct a tree node: element type, attributes, children.
forEach ::StringElementTypeArraya(- a
String
)(- a
Tree
)Tree
The fold: name, element type, data, key function, template — produces a tree.
withBehaviors ::ArrayThunkedBehaviorTreeTree
Attach interactive behaviors (hover, drag, zoom) to a tree node.
rerender ::StringTreeEffectRerenderResult
The interpreter boundary: pure tree in, effectful DOM out. The result holds the named selections and any transitions still to be ticked; discard it with void for a static chart.
applyScale ::ContinuousScaleNumberNumber
Scales are just functions. Pure, no D3.
Key Modules (hylograph-selection)
The selection package is the foundation. Here are its main module groups:
Tree Construction
- Hylograph.HATS — Tree type, elem, forEach, withBehaviors
- Hylograph.HATS.Friendly — F.width, F.cx, F.fill and friends
- Hylograph.HATS.InterpreterTick — rerender (the DOM interpreter: SVG and HTML)
Scales & Color
- Hylograph.Scale — Facade: linear, log, pow, sqrt + color schemes + interpolators
- Hylograph.Scale.Pure — Pure implementation (no D3); log scale uses linear ticks
- Hylograph.Scale.Sequential — 37 color interpolators (Viridis, Blues, RdYlGn, etc.)
Interpreters
- Hylograph.Interpreter.English — Plain English description of a tree
- Hylograph.Interpreter.Mermaid — Mermaid diagram syntax (experimental, untested)
- Hylograph.Interpreter.MetaHATS — Tree → Tree structure visualization (experimental)
Interactions
- Hylograph.Interaction.Coordinated — Cross-view hover, brush, selection
- Hylograph.Interaction.Zoom — Zoom and pan
- Hylograph.Interaction.Brush — Brush selection
