@graphty/graphty-element / layout/LayoutEngine / LayoutEngine
Abstract Class: LayoutEngine ​
Defined in: graphty-element/src/layout/LayoutEngine.ts:36
Base class for all layout engines
Extended by ​
Constructors ​
Constructor ​
new LayoutEngine():
LayoutEngine
Returns ​
LayoutEngine
Properties ​
config? ​
optionalconfig:Record<string,unknown>
Defined in: graphty-element/src/layout/LayoutEngine.ts:39
maxDimensions ​
staticmaxDimensions:number
Defined in: graphty-element/src/layout/LayoutEngine.ts:38
type ​
statictype:string
Defined in: graphty-element/src/layout/LayoutEngine.ts:37
zodOptionsSchema? ​
staticoptionalzodOptionsSchema:OptionsSchema
Defined in: graphty-element/src/layout/LayoutEngine.ts:47
NEW: Zod-based options schema for unified validation and UI metadata
Subclasses should override this to define their configurable options using the new Zod-based schema system.
Accessors ​
edges ​
Get Signature ​
get
abstractedges():Iterable<Edge>
Defined in: graphty-element/src/layout/LayoutEngine.ts:62
Returns ​
Iterable<Edge>
isSettled ​
Get Signature ​
get
abstractisSettled():boolean
Defined in: graphty-element/src/layout/LayoutEngine.ts:63
Returns ​
boolean
nodes ​
Get Signature ​
get
abstractnodes():Iterable<Node>
Defined in: graphty-element/src/layout/LayoutEngine.ts:61
Returns ​
Iterable<Node>
type ​
Get Signature ​
get type():
string
Defined in: graphty-element/src/layout/LayoutEngine.ts:89
Get the type identifier for this layout engine
Returns ​
string
The layout engine type string
Methods ​
addEdge() ​
abstractaddEdge(e):void
Defined in: graphty-element/src/layout/LayoutEngine.ts:52
Parameters ​
e ​
Returns ​
void
addEdges() ​
addEdges(
edges):void
Defined in: graphty-element/src/layout/LayoutEngine.ts:79
Add multiple edges to the layout engine
Parameters ​
edges ​
Edge[]
Array of edges to add
Returns ​
void
addNode() ​
abstractaddNode(n):void
Defined in: graphty-element/src/layout/LayoutEngine.ts:51
Parameters ​
n ​
Returns ​
void
addNodes() ​
addNodes(
nodes):void
Defined in: graphty-element/src/layout/LayoutEngine.ts:69
Add multiple nodes to the layout engine
Parameters ​
nodes ​
Node[]
Array of nodes to add
Returns ​
void
get() ​
staticget(type,opts):LayoutEngine|null
Defined in: graphty-element/src/layout/LayoutEngine.ts:111
Get a layout engine instance by type
Parameters ​
type ​
string
The layout engine type identifier
opts ​
object = {}
Configuration options for the layout engine
Returns ​
LayoutEngine | null
A new layout engine instance or null if type not found
getClass() ​
staticgetClass(type):LayoutEngineClass&LayoutEngineStatics|null
Defined in: graphty-element/src/layout/LayoutEngine.ts:180
Get a layout class by type
Parameters ​
type ​
string
The layout engine type identifier
Returns ​
LayoutEngineClass & LayoutEngineStatics | null
The layout engine class or null if not found
getEdgePosition() ​
abstractgetEdgePosition(e):EdgePosition
Defined in: graphty-element/src/layout/LayoutEngine.ts:55
Parameters ​
e ​
Returns ​
getNodePosition() ​
abstractgetNodePosition(n):Position
Defined in: graphty-element/src/layout/LayoutEngine.ts:53
Parameters ​
n ​
Returns ​
getOptionsForDimension() ​
staticgetOptionsForDimension(dimension):object|null
Defined in: graphty-element/src/layout/LayoutEngine.ts:125
Get dimension-specific options for this layout
Parameters ​
dimension ​
The desired dimension (2 or 3)
2 | 3
Returns ​
object | null
Options object for the dimension or null if unsupported
getOptionsForDimensionByType() ​
staticgetOptionsForDimensionByType(type,dimension):object|null
Defined in: graphty-element/src/layout/LayoutEngine.ts:142
Get dimension-specific options for a layout by type
Parameters ​
type ​
string
The layout engine type identifier
dimension ​
The desired dimension (2 or 3)
2 | 3
Returns ​
object | null
Options object for the dimension or null if type not found or unsupported
getRegisteredTypes() ​
staticgetRegisteredTypes():string[]
Defined in: graphty-element/src/layout/LayoutEngine.ts:171
Get a list of all registered layout types
Returns ​
string[]
Array of registered layout type identifiers
getZodOptionsSchema() ​
staticgetZodOptionsSchema():OptionsSchema
Defined in: graphty-element/src/layout/LayoutEngine.ts:155
Get the Zod-based options schema for this layout
Returns ​
The options schema, or an empty object if no schema defined
hasZodOptions() ​
statichasZodOptions():boolean
Defined in: graphty-element/src/layout/LayoutEngine.ts:163
Check if this layout has a Zod-based options schema
Returns ​
boolean
true if the layout has options defined
init() ​
abstractinit():Promise<void>
Defined in: graphty-element/src/layout/LayoutEngine.ts:50
Returns ​
Promise<void>
pin() ​
abstractpin(n):void
Defined in: graphty-element/src/layout/LayoutEngine.ts:58
Parameters ​
n ​
Returns ​
void
register() ​
staticregister<T>(cls):T
Defined in: graphty-element/src/layout/LayoutEngine.ts:98
Register a layout engine class in the global registry
Type Parameters ​
T ​
T extends LayoutEngineClass
Parameters ​
cls ​
T
The layout engine class to register
Returns ​
T
The registered class for chaining
setNodePosition() ​
abstractsetNodePosition(n,p):void
Defined in: graphty-element/src/layout/LayoutEngine.ts:54
Parameters ​
n ​
p ​
Returns ​
void
step() ​
abstractstep():void
Defined in: graphty-element/src/layout/LayoutEngine.ts:57
Returns ​
void
unpin() ​
abstractunpin(n):void
Defined in: graphty-element/src/layout/LayoutEngine.ts:59
Parameters ​
n ​
Returns ​
void