Types
Import these from @grafloria/engine.
Types
CompoundAlgorithm
Also has every member of String, listed on its own entry.
Any registered layout name, or the built-in grid.
tstype CompoundAlgorithm = 'grid' | 'dagre' | 'elk' | (string & {});
ConstraintType
Also has every member of String, listed on its own entry.
Types of layout constraints that can be applied to nodes
tstype ConstraintType = 'pin' | 'fix-x' | 'fix-y' | 'boundary';
EdgeBundlingStrategy
Also has every member of String, listed on its own entry.
Bundling strategy
tstype EdgeBundlingStrategy = 'stub' | 'force-directed' | 'hierarchical' | 'none';
ELKAlgorithm
Also has every member of String, listed on its own entry.
ELK layout algorithms
tstype ELKAlgorithm =
| 'layered'
| 'force'
| 'stress'
| 'mrtree'
| 'radial'
| 'disco';
ElkPortConstraint
Also has every member of String, listed on its own entry.
tstype ElkPortConstraint = 'FREE' | 'FIXED_SIDE' | 'FIXED_ORDER' | 'FIXED_POS';
ElkPortSide
Also has every member of String, listed on its own entry.
ELK's compass vocabulary for a port side.
tstype ElkPortSide = 'NORTH' | 'EAST' | 'SOUTH' | 'WEST';
FlowDirection
Also has every member of String, listed on its own entry.
tstype FlowDirection = 'TB' | 'BT' | 'LR' | 'RL';
GraphLayoutFn
The contract a layout must satisfy to be packable: nodes + links in, positions out. Deliberately array-based (not DiagramModel-based) — a component is a SUBSET of a diagram, and there is no such thing as a sub-DiagramModel.
tstype GraphLayoutFn = (
nodes: NodeModel[],
links: LinkModel[],
options: UnifiedLayoutOptions
) => Promise<LayoutResult> | LayoutResult;
IncrementalLayoutStrategy
Also has every member of String, listed on its own entry.
Strategy for incremental layout
tstype IncrementalLayoutStrategy =
| 'pin-existing'
| 'fix-anchors'
| 'proximity-aware'
| 'minimal-shift';
LayoutAlgorithmType
Also has every member of String, listed on its own entry.
Layout algorithm types
tstype LayoutAlgorithmType = 'grid' | 'force-directed' | 'hierarchical' | 'hybrid';
LayoutEventType
Also has every member of String, listed on its own entry.
Layout event types
tstype LayoutEventType =
| 'layout:started'
| 'layout:completed'
| 'layout:failed'
| 'layout:algorithm-changed'
| 'layout:node-placed';
LayoutMode
Also has every member of String, listed on its own entry.
Layout mode for automatic vs manual positioning
tstype LayoutMode = 'auto' | 'manual';
LayoutRequest
Also has every member of LayoutRequestRun, listed on its own entry.
tstype LayoutRequest = LayoutRequestRun | LayoutRequestCancel;
LayoutResponse
Also has every member of LayoutProgressMessage, listed on its own entry.
tstype LayoutResponse =
| LayoutProgressMessage
| LayoutResultMessage
| LayoutErrorMessage;
LayoutStopReason
Also has every member of String, listed on its own entry.
Why a run stopped early. Absent when it ran to completion.
tstype LayoutStopReason = 'cancelled' | 'timeout' | 'iteration-cap';
LayoutWireOptions
Also has every member of LayoutOptions, listed on its own entry.
Options as they cross the wire: the named ones, plus whatever adapter-specific
knobs the caller supplied (iterations, repulsion, rankdir, …). Anything
here must be structured-clone-safe — stripNonClonable enforces that at the
seam rather than trusting callers to.
tstype LayoutWireOptions = Partial<LayoutOptions> & Record<string, unknown>;
PortConstraintMode
Also has every member of String, listed on its own entry.
How much freedom does the layout engine have over this node's ports?
FREE — no declared ports: put the edge wherever it routes best. FIXED_SIDE — the author said which side; the engine may still reorder within that side to reduce crossings. FIXED_ORDER — side AND order are the author's. FIXED_POS — the exact coordinates are the author's.
'auto' (the default) resolves per node: FIXED_SIDE when the node declares
ports, FREE when it does not. That is what makes port-awareness safe to leave
ON — it constrains only the nodes whose author asked for it.
tstype PortConstraintMode = 'auto' | 'free' | 'fixed-side' | 'fixed-order' | 'fixed-pos';
PortFlowDirection
Also has every member of String, listed on its own entry.
Port direction (input or output)
tstype PortFlowDirection = 'input' | 'output' | 'bidirectional';
PortSide
Also has every member of String, listed on its own entry.
Port side relative to node
tstype PortSide = 'left' | 'right' | 'top' | 'bottom';
Was this page helpful?