← Hylograph

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 are hylograph-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 ::
  1. ElementType
  2. ArrayAttr
  3. ArrayTree
  4. Tree

Construct a tree node: element type, attributes, children.

forEach ::
  1. String
  2. ElementType
  3. Arraya
  4. (
    1. a
    2. String
    )
  5. (
    1. a
    2. Tree
    )
  6. Tree

The fold: name, element type, data, key function, template — produces a tree.

withBehaviors ::
  1. ArrayThunkedBehavior
  2. Tree
  3. Tree

Attach interactive behaviors (hover, drag, zoom) to a tree node.

rerender ::
  1. String
  2. Tree
  3. EffectRerenderResult

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 ::
  1. ContinuousScale
  2. Number
  3. Number

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

Scales & Color

Interpreters

Interactions