本文へ移動

@eightkk/vue-weave / core / layoutSwimlaneGraph

Function: layoutSwimlaneGraph() ​

layoutSwimlaneGraph<N>(nodes, edges, options): GraphSwimlaneLayout

Defined in: src/core/graphSwimlanes.ts:195

Swimlane layout: one band per lane in the caller's order, with the flow running along the bands. A node's rank (position along the flow) comes from the dependency structure exactly as in layoutLayeredGraph, so every node of a cycle shares one rank. Across the flow a node sits in its own lane's band; several nodes of one lane in one rank are stacked inside it and the band grows to fit. With crossingReduction: 'barycenter' (the default) the nodes of one lane in one rank are reordered to reduce crossings; the lane order itself never changes, and a lane without nodes still gets a band, so adding a node or an edge keeps every lane in place relative to the others. Deterministic.

Throws an Error for a duplicate or empty lane ID, a node without a lane or with an unknown lane, and the graph errors of indexGraph; a RangeError for an unknown direction or crossing method and for sizes that are not finite and nonnegative (node sizes positive). Traversals are iterative.

Type Parameters ​

N ​

N extends IdentifiedNode

Parameters ​

nodes ​

readonly N[]

edges ​

readonly GraphEdge<unknown>[]

options ​

GraphSwimlaneLayoutOptions<N>

Returns ​

GraphSwimlaneLayout

MIT ライセンスで公開しています。