<!-- Public documentation export; not library implementation source. -->
# IShapesGroupControllerApi

[Integration guide](https://docs.lumencharts.com/charting-library/drawings#selection-groups-and-ordering) · [Reference index](https://docs.lumencharts.com/charting-library/api/)

Public contract reference. This declaration describes types and callback shapes; availability is constrained by the linked integration guide and the runtime capability. Legacy product-specific fields are not a promise of implementation.

## createGroupFromSelection {#creategroupfromselection}

```ts
createGroupFromSelection(): ShapesGroupId;
```

Use the type signature above and the integration guide for the owning capability.

## removeGroup {#removegroup}

```ts
removeGroup(groupId: ShapesGroupId): void;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `groupId` | `ShapesGroupId` | Yes |

## groups {#groups}

```ts
groups(): readonly ShapesGroupId[];
```

Use the type signature above and the integration guide for the owning capability.

## shapesInGroup {#shapesingroup}

```ts
shapesInGroup(groupId: ShapesGroupId): readonly EntityId[];
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `groupId` | `ShapesGroupId` | Yes |

## excludeShapeFromGroup {#excludeshapefromgroup}

```ts
excludeShapeFromGroup(groupId: ShapesGroupId, shapeId: EntityId): void;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `groupId` | `ShapesGroupId` | Yes |
| `shapeId` | `EntityId` | Yes |

## addShapeToGroup {#addshapetogroup}

```ts
addShapeToGroup(groupId: ShapesGroupId, shapeId: EntityId): void;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `groupId` | `ShapesGroupId` | Yes |
| `shapeId` | `EntityId` | Yes |

## availableZOrderOperations {#availablezorderoperations}

```ts
availableZOrderOperations(groupId: ShapesGroupId): AvailableZOrderOperations;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `groupId` | `ShapesGroupId` | Yes |

## bringToFront {#bringtofront}

```ts
bringToFront(groupId: ShapesGroupId): void;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `groupId` | `ShapesGroupId` | Yes |

## sendToBack {#sendtoback}

```ts
sendToBack(groupId: ShapesGroupId): void;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `groupId` | `ShapesGroupId` | Yes |

## bringForward {#bringforward}

```ts
bringForward(groupId: ShapesGroupId): void;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `groupId` | `ShapesGroupId` | Yes |

## sendBackward {#sendbackward}

```ts
sendBackward(groupId: ShapesGroupId): void;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `groupId` | `ShapesGroupId` | Yes |

## insertAfter {#insertafter}

```ts
insertAfter(groupId: ShapesGroupId, target: ShapesGroupId | EntityId): void;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `groupId` | `ShapesGroupId` | Yes |
| `target` | `ShapesGroupId &#124; EntityId` | Yes |

## insertBefore {#insertbefore}

```ts
insertBefore(groupId: ShapesGroupId, target: ShapesGroupId | EntityId): void;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `groupId` | `ShapesGroupId` | Yes |
| `target` | `ShapesGroupId &#124; EntityId` | Yes |

## setGroupVisibility {#setgroupvisibility}

```ts
setGroupVisibility(groupId: ShapesGroupId, value: boolean): void;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `groupId` | `ShapesGroupId` | Yes |
| `value` | `boolean` | Yes |

## groupVisibility {#groupvisibility}

```ts
groupVisibility(groupId: ShapesGroupId): GroupVisibilityState;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `groupId` | `ShapesGroupId` | Yes |

## setGroupLock {#setgrouplock}

```ts
setGroupLock(groupId: ShapesGroupId, value: boolean): void;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `groupId` | `ShapesGroupId` | Yes |
| `value` | `boolean` | Yes |

## groupLock {#grouplock}

```ts
groupLock(groupId: ShapesGroupId): GroupLockState;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `groupId` | `ShapesGroupId` | Yes |

## getGroupName {#getgroupname}

```ts
getGroupName(groupId: ShapesGroupId): string;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `groupId` | `ShapesGroupId` | Yes |

## setGroupName {#setgroupname}

```ts
setGroupName(groupId: ShapesGroupId, name: string): void;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `groupId` | `ShapesGroupId` | Yes |
| `name` | `string` | Yes |

## canBeGroupped {#canbegroupped}

```ts
canBeGroupped(shapes: readonly EntityId[]): boolean;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `shapes` | `readonly EntityId[]` | Yes |

## Related types

- [ShapesGroupId](https://docs.lumencharts.com/charting-library/api/ShapesGroupId)
- [EntityId](https://docs.lumencharts.com/charting-library/api/EntityId)
- [AvailableZOrderOperations](https://docs.lumencharts.com/charting-library/api/AvailableZOrderOperations)
- [GroupVisibilityState](https://docs.lumencharts.com/charting-library/api/GroupVisibilityState)
- [GroupLockState](https://docs.lumencharts.com/charting-library/api/GroupLockState)

---
Documentation page: https://docs.lumencharts.com/charting-library/api/IShapesGroupControllerApi
