layout_graph
Compute graph layout coordinates and edge routing paths from graph structure using elkjs. Takes nodes, edges, and layout options; returns node positions and polyline edge sections.
Instructions
Compute graph layout with elkjs and return node positions (x,y,width,height) and edge routing (sections with start/end/bend points). Pass graph structure in graph and layout settings in options separately. Hierarchy: use node.parent (flat) or node.children (nested), not both on one node. Put all edges in graph.edges; they are placed under the lowest common ancestor (LCA). Coordinates: defaults to absolute mode. When options.absoluteCoordinates=true, all returned node x/y and edge section points are in one global coordinate system. When options.absoluteCoordinates=false, values are returned in local coordinate systems (nodes/ports/labels relative to their containing node), so for typical rendering you should keep the default true. Node x/y are the top-left corner of the node bounding box (ELK semantics). edge.sections[] is an ordered list of routed polyline segments; each section has startPoint/endPoint and optional bendPoints (intermediate polyline vertices). edge.junctionPoints? may be present when ELK computes junction points (e.g. hyperedges).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| graph | Yes | Graph with nodes and edges | |
| options | No | Layout options (algorithm, direction, ...) |