groups

groups.create

create(nodeIds: string[], spec: GroupSpec): string

Create a group containing the given node IDs.

spec may include an optional anchorNodeId (the member that becomes the visible anchor when the group is collapsed — defaults to the centroid member) and an optional kind: "group" | "collect" (set by CollectionManager.collect() for collect-style groups; defaults to "group").

Not undoable. Emits "group:created".

nodeIdsstring[]IDs of the nodes that form the group.
specGroupSpecGroup configuration (name, color, opacity, anchorNodeId, kind, …).

Returns: string