Skip to content

Core contracts

Contract Defined in Purpose
EngineContract contract/types.ts Injected text, icon, colour-role, and legibility capabilities
FamilyDefinition family/types.ts Typed family authoring surface
GraphIR family/types.ts Shared normalized semantics
PlacementSpec family/types.ts Choice of configured or bespoke placement
MeasuredGraph measure/measure-graph.ts Content with exact extents
Placement place/types.ts Coordinates, route hints, and routing ownership
RoutedGraph route/route-placement.ts Final connectors and label positions
MaterializedGraph materialize/materialize-graph.ts Unframed neutral NGD elements
NGD ngd/types.ts Fully resolved renderer-independent scene graph
type RoutingOwnership = { kind: 'shared' } | { kind: 'authored' } | { kind: 'hybrid'; edgeIds: ReadonlySet<string> };

This union prevents ambiguous booleans and makes routePlacement() exhaustive.

NgdElement is a discriminated union of node, group, edge, vector, and label. Structured vector primitives are path, rectangle, circle, or text; all paints are semantic roles. Consumers can switch exhaustively without importing engine internals.