Types
Import these from @grafloria/engine.
Types
GroupFitMode
Also has every member of String, listed on its own entry.
How {@link GroupModel.fitToContents} reconciles the freshly computed content rectangle with the group's current rectangle.
exact— snap to the content rectangle (default).grow-only— never shrink below the current rectangle (union).shrink-only— never grow beyond the current rectangle (intersection-ish).
tstype GroupFitMode = 'exact' | 'grow-only' | 'shrink-only';
GroupPadding
Per-side padding (a scalar expands to all four sides).
tstype GroupPadding =
| number
| { top?: number; right?: number; bottom?: number; left?: number };
Members
toString(radix?: number): string— Returns a string representation of an object.valueOf(): number— Returns the primitive value of the specified object.toLocaleString(locales?: string | string[], options?: Intl.NumberFormatOptions): string— Converts a number to a string by using the current or specified locale.
LinkConnectorName
Also has every member of String, listed on its own entry.
tstype LinkConnectorName =
| 'straight'
| 'rounded'
| 'smooth'
| 'bezier'
| (string & {});
LinkRouterName
Also has every member of String, listed on its own entry.
. pathType conflated two independent choices:
WHERE the line goes (routing geometry) and HOW the polyline is drawn
(connector rendering). They are now two orthogonal, per-link, serializable
settings, with pathType kept as the back-compat shorthand that derives both
when the explicit fields are absent.
Router names resolve against the engine's RoutingEngine registry, so a custom registered router is addressable per link by its registration name.
tstype LinkRouterName =
| 'straight'
| 'orthogonal'
| 'manhattan'
| 'avoid'
| 'elk'
| (string & {});
MembershipRule
A SERIALIZABLE declarative membership predicate over a node's
data (never eval'd code). Leaves match one field with an operator; branches
compose with all/any/not. Kept intentionally small and closed so it round-
trips and can be reasoned about / edited as data.
tstype MembershipRule =
| MembershipLeaf
| { all: MembershipRule[] }
| { any: MembershipRule[] }
| { not: MembershipRule };
MemberValidation
Predicate used to gate group membership. Return false to reject a candidate entity from joining the group.
tstype MemberValidation = (candidateId: string, group: GroupModel) => boolean;
Parameters
candidateId: id of the node/group being addedgroup: the group the candidate would join
PositioningMode
Also has every member of String, listed on its own entry.
Positioning mode
- absolute: Position relative to diagram origin (default, backward compatible)
- relative: Position relative to parent
- layout: Position managed by parent's layout algorithm (future)
tstype PositioningMode = 'absolute' | 'relative' | 'layout';
Was this page helpful?