# Grouping Type documentation

## TypeScript declaration

### [Grouping](<https://github.com/siemens/element/blob/main/projects/maps-ng/src/components/si-map/models/grouping.model.ts#L11-L62>)

**Kind:** class

```
import { Grouping } from '@siemens/maps-ng';
```

Class for grouping functionality

```
undecorated_class Grouping
```

#### Constructor

##### constructor

[Source for constructor](<https://github.com/siemens/element/blob/main/projects/maps-ng/src/components/si-map/models/grouping.model.ts#L15-L38>)

```
constructor(groupColors?: Record<number, string> | ColorPalette = 'status'): Grouping
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [groupColors](<https://github.com/siemens/element/blob/main/projects/maps-ng/src/components/si-map/models/grouping.model.ts#L15-L15>) (optional) | `Record<number, string> \| ColorPalette` | `'status'` |  |

**Returns:** [Grouping](<index.html#t:Grouping>)

#### Accessors

| Name | Type | Description |
| --- | --- | --- |
| [colors](<https://github.com/siemens/element/blob/main/projects/maps-ng/src/components/si-map/models/grouping.model.ts#L40-L42>) (readonly) | `string[]` |  |
| [length](<https://github.com/siemens/element/blob/main/projects/maps-ng/src/components/si-map/models/grouping.model.ts#L48-L50>) (readonly) | `number` |  |
| [palette](<https://github.com/siemens/element/blob/main/projects/maps-ng/src/components/si-map/models/grouping.model.ts#L44-L46>) (readonly) | `string \| undefined` |  |

#### Methods

##### getColor

[Source for getColor](<https://github.com/siemens/element/blob/main/projects/maps-ng/src/components/si-map/models/grouping.model.ts#L52-L61>)

```
getColor(groupId: number): string
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [groupId](<https://github.com/siemens/element/blob/main/projects/maps-ng/src/components/si-map/models/grouping.model.ts#L52-L52>) | `number` |  |  |

**Returns:** [string](<https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String>)

### Types Documentation

### [ColorPalette](<https://github.com/siemens/element/blob/main/projects/maps-ng/src/components/si-map/models/color-palette.type.ts#L6-L6>)

**Kind:** type alias

```
import type { ColorPalette } from '@siemens/maps-ng';
```

```
type ColorPalette = 'status' | 'element'
```
