Skip to content

@eightkk/vue-weave / core / layoutConcentricGraph

Function: layoutConcentricGraph() ​

layoutConcentricGraph<N>(nodes, edges, options?): GraphLayout

Defined in: src/core/graphLayouts.ts:423

Concentric layout: nodes sit on rings chosen by a metric (the degree by default). Higher levels are closer to the centre; rank is the ring index, 0 for the innermost. Each ring is large enough for its nodes and rings are at least one node diagonal plus ringGap apart, so boxes never overlap. Nodes keep input order within a ring. Sorting the distinct levels makes the work O(n + e + k log k) for k rings.

Type Parameters ​

N ​

N extends IdentifiedNode

Parameters ​

nodes ​

readonly N[]

edges ​

readonly GraphEdge<unknown>[]

options? ​

GraphConcentricLayoutOptions<N> = {}

Returns ​

GraphLayout

Released under the MIT License.