Group elements into a labelled box
group_elementsGroup top-level diagram elements inside a labelled container, preserving their connections. Use to wrap services in a VPC, draw boundaries around data layers, or organize by VLAN.
Instructions
Wrap existing top-level elements in a labelled container.
USE THIS for "put all of this inside a box called AWS", "group these services into a VPC", "draw a boundary around the data layer", "show which parts are in VLAN 10".
The members keep their ids, and every connection to or from them keeps working - including connections that cross the boundary.
Set layout to re-arrange the members inside the box ('vertical' stacks them, 'horizontal'
puts them in a row, 'grid' wraps them). Leave it out to keep their current arrangement.
Only top-level elements can be grouped. To nest a group inside another group, create the inner one first, then group it together with its siblings.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fill | No | Background colour. | |
| label | No | Text drawn on the box, e.g. 'AWS'. | |
| layout | No | Re-arrange the members. Default 'manual' (keep their current positions). | |
| stroke | No | Border colour. | |
| groupId | Yes | Id for the new group, e.g. 'aws' or 'vlan-10'. | |
| sceneId | Yes | Id of the scene to work on, as returned by render_diagram or create_scene. | |
| elementIds | Yes | Ids of the top-level elements to move inside the box. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | Present only when success is false. | |
| groupId | No | ||
| members | No | ||
| sceneId | No | ||
| success | Yes |