Skip to content

diaglam developer docs

Follow one semantic program through typed plugins, measurement, placement, routing, and a renderer-independent scene graph.
flowchart LR
  Program["Semantic program<br/>meaning only"] --> Plugin["typed family<br/>schema + lowering"]
  Plugin --> Measure["measure<br/>real content"]
  Measure --> Place["place<br/>coordinates"]
  Place --> Route["route + labels<br/>traceable lines"]
  Route --> NGD["NGD<br/>resolved scene graph"]
  NGD --> Render["faithful renderer<br/>SVG + PNG"]
The complete engine in one line. Each arrow is a typed handoff you can inspect.

Start from layout.ts

Read the 60-line orchestrator first, then follow every call with a map of the input and output type at each boundary.

See the real architecture

Explore function-level diagrams for plugins, placement strategies, routing ownership, materialization, NGD, and the verification loop.

Change code safely

Use symptom-driven debugging routes and understand exactly which snapshots, metrics, and invariants guard each subsystem.

New hereCodebase tour → pipeline → contracts

Bad layoutDebugging → placement & routing

New notationFamily plugins → add a family

Geometry changeVerification → inspect → bless

  • Measurement drives geometry. Real content is measured before placement; no nominal node size exists.
  • Families are constrained plugins. They validate, normalize, select a placement strategy, and define notation—nothing downstream.
  • The renderer is faithful. NGD is complete enough to draw verbatim.
  • Determinism is a contract. Same program plus contract means byte-identical NGD, SVG, and PNG.
  • Humans trace every relation. Routing and labels optimize for a reader, with metric gates backing the claim.