Skip to content

rune-langium / visual-editor/src / computeLayoutAsync

Function: computeLayoutAsync()

ts
function computeLayoutAsync(
   nodes, 
   edges, 
options?): Promise<TypeGraphNode[] | null>;

Defined in: packages/visual-editor/src/layout/layout-worker.ts:126

Compute layout asynchronously.

Prefers a Web Worker for true off-main-thread execution. Falls back to requestIdleCallback-based yielding on the main thread.

Returns null if a newer layout request superseded this one.

Parameters

ParameterType
nodesTypeGraphNode[]
edgesTypeGraphEdge[]
options?LayoutOptions

Returns

Promise<TypeGraphNode[] | null>

Core packages released under MIT. Studio app released under FSL-1.1-ALv2.