groups

groups.collapse

collapse(groupId: string): void

Collapse a group onto a single anchor member.

The anchor is spec.anchorNodeId if specified, otherwise the member closest to the group's centroid is chosen automatically. Non-anchor members are hidden; the anchor is marked with the 4-corner-ball collection visual. Cross-group edges to other collapsed groups or to free nodes are aggregated into single virtual edges whose width reflects the original edge count (width = 1 + ln(weight)).

The anchor stays at its current position — collapse does NOT trigger a force-layout restart, and no synthetic proxy node is added to the graph.

No-op if the group is already collapsed or does not exist. Not undoable. Emits "group:collapsed".

groupIdstring

Returns: void