本文へ移動

@eightkk/vue-weave / core / collapseGraphGroups

Function: collapseGraphGroups() ​

collapseGraphGroups<N, E>(nodes, edges, groups, collapsedIds, options?): GraphCollapseResult<N, E>

Defined in: src/core/graphCollapse.ts:74

Replaces each outermost collapsed group with one proxy node. The proxy has the group's ID and label, a detail with the member count, the rounded shape and data of type GraphCollapsedNodeData. Member nodes are removed, edges are re-attached to the proxy (dropping the port on that end), edges inside one collapsed group are dropped, and parallel re-attached edges are merged; a merged edge keeps its label, edgeStyle, markers, animated and dashed flags only when every merged edge has the same value. Throws Error for a duplicate or empty group ID, an unknown parent, a parent cycle, an unknown or repeated member, an unknown collapsed ID, or a collapsed group ID that is also a visible node ID. The inputs are not modified.

Type Parameters ​

N ​

N extends NetworkNode<unknown>

E ​

E extends GraphEdge<unknown>

Parameters ​

nodes ​

readonly N[]

edges ​

readonly E[]

groups ​

readonly NetworkGroup[]

collapsedIds ​

Iterable<string>

options? ​

GraphCollapseOptions = {}

Returns ​

GraphCollapseResult<N, E>

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