Skip to content

@graphty/graphty-element / extend / LayoutEngineStatics

Interface: LayoutEngineStatics ​

Defined in: graphty-element/src/layout/LayoutEngine.ts:128

What a layout engine class declares about itself, which is what the element and a picker read without constructing one.

Properties ​

descriptor? ​

optional descriptor?: AuthoredLayoutDescriptor

Defined in: graphty-element/src/layout/LayoutEngine.ts:168

What the catalogue publishes about this layout, so a picker can offer it.

REQUIRED OF A THIRD PARTY'S ENGINE and absent from the element's own nineteen, whose arrangements are authored in src/catalog/layouts.ts instead. descriptor.id must equal LayoutEngineStatics.type: one key, so nothing is named twice and layoutIdForEngine can answer a plugin's own id.


honoursWeights? ​

optional honoursWeights?: boolean

Defined in: graphty-element/src/layout/LayoutEngine.ts:140

Whether this engine arranges a graph differently when its edges carry weights.

Optional, and false for all but two of the element's own nineteen. It exists so that a picker can tell a reader which arrangements the weighted option actually does something for, instead of offering it on seventeen layouts that ignore it.


maxDimensions ​

maxDimensions: number

Defined in: graphty-element/src/layout/LayoutEngine.ts:132

The most dimensions this engine can arrange a graph in.


scoped? ​

optional scoped?: boolean

Defined in: graphty-element/src/layout/LayoutEngine.ts:159

Whether this engine can lay out a set of nodes while holding every other node still, which is what setLayout(type, opts, { scope }) asks of it.

Optional, and false unless declared: an engine that says nothing refuses a scope with E_UNSUPPORTED, so no existing engine is handed a hold it never agreed to.

THE CONTRACT A SCOPED ENGINE ACCEPTS. The element hands it a hold mask through LayoutEngine.setHoldMask after init() and again whenever the graph is renumbered, and the protected writeNodePosition already refuses a layout write onto a held row that has a coordinate -- so a held node never MOVES under any engine. That alone is not enough: an engine that keeps integrating a held body computes every force on its members against a position the element will never draw. A scoped engine must therefore treat held nodes as fixed in its own state -- a fixed-node mask, fx/fy, a pinned body -- read through the protected isHeld(index), including for a node added after the hold was set and a node a reader unpins while it is held. The hold is never a pin: it is not written to the element's pin lane, so it never leaks into saved pins or exports.


type ​

type: string

Defined in: graphty-element/src/layout/LayoutEngine.ts:130

The name a consumer passes to setLayout, and the name the class is filed under.


zodOptionsSchema? ​

optional zodOptionsSchema?: OptionsSchema

Defined in: graphty-element/src/layout/LayoutEngine.ts:169

Methods ​

getZodOptionsSchema() ​

getZodOptionsSchema(): OptionsSchema

Defined in: graphty-element/src/layout/LayoutEngine.ts:170

Returns ​

OptionsSchema


hasZodOptions() ​

hasZodOptions(): boolean

Defined in: graphty-element/src/layout/LayoutEngine.ts:171

Returns ​

boolean