> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reducto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Shapes and pictures

## `ShapeCollection`

`Excel.ShapeCollection`: the drawing objects of one worksheet, bottom first.

Import from `@reductoai/xlsx/officejs`.

### ShapeCollection properties

| Name | Type | Description |
| - | - | - |
| `items` | `ExcelShape[]` | read-only |

### `ShapeCollection.addGeometricShape()`

```ts theme={null}
addGeometricShape(geometricShapeType: GeometricShapeType): ExcelShape
```

A preset shape at the sheet's top-left, 100 points square.

### `ShapeCollection.addGroup()`

```ts theme={null}
addGroup(values: (string | ExcelShape)[]): ExcelShape
```

One group of two or more top-level shapes, standing where the topmost one stood.

### `ShapeCollection.addImage()`

```ts theme={null}
addImage(base64ImageString: string): ExcelShape
```

A PNG, JPEG or GIF at the sheet's top-left, at its own size.

### `ShapeCollection.addLine()`

```ts theme={null}
addLine(
  startLeft: number,
  startTop: number,
  endLeft: number,
  endTop: number,
  connectorType?: ConnectorType,
): ExcelShape
```

A line from one point to another, in points from the sheet's top-left.

### `ShapeCollection.addTextBox()`

```ts theme={null}
addTextBox(text?: string): ExcelShape
```

### `ShapeCollection.getCount()`

```ts theme={null}
getCount(): ClientResult<number>
```

### `ShapeCollection.getItem()`

```ts theme={null}
getItem(key: string): ExcelShape
```

By name, ignoring case, or by id.

### `ShapeCollection.getItemAt()`

```ts theme={null}
getItemAt(index: number): ExcelShape
```

### `ShapeCollection.getItemOrNullObject()`

```ts theme={null}
getItemOrNullObject(key: string): Nullable<ExcelShape>
```

## `ExcelShape`

`Excel.Shape`: a drawing object on a worksheet, by its `cNvPr` id. Edits apply at once.

Import from `@reductoai/xlsx/officejs`.

### ExcelShape properties

| Name | Type | Description |
| - | - | - |
| `altTextDescription` | `string` | |
| `altTextTitle` | `string` | |
| `connectionSiteCount` | `number` | read-only |
| `displayName` | `string` | read-only |
| `fill` | `ShapeFill` | read-only |
| `geometricShape` | `GeometricShape` | read-only |
| `geometricShapeType` | `GeometricShapeType \| null` | |
| `group` | `ShapeGroup` | read-only |
| `height` | `number` | |
| `id` | `string` | read-only |
| `image` | `ExcelImage` | read-only |
| `left` | `number` | |
| `level` | `number` | read-only |
| `line` | `Line` | read-only |
| `lineFormat` | `ShapeLineFormat` | read-only |
| `lockAspectRatio` | `boolean` | |
| `name` | `string` | |
| `parentGroup` | `ExcelShape` | read-only |
| `placement` | `Placement` | |
| `rotation` | `number` | |
| `textFrame` | `TextFrame` | read-only |
| `top` | `number` | |
| `type` | `ShapeType` | read-only |
| `visible` | `boolean` | |
| `width` | `number` | |
| `zOrderPosition` | `number` | read-only |

### `ExcelShape.copyTo()`

```ts theme={null}
copyTo(destinationSheet?: string | ExcelWorksheet): ExcelShape
```

A copy at the same place, on top; on this sheet unless another is given.

### `ExcelShape.delete()`

```ts theme={null}
delete(): void
```

### `ExcelShape.getAsImage()`

```ts theme={null}
getAsImage(format: string): ClientResult<string>
```

Base64 of the shape as the view paints it, sized to its turned frame at 96 dpi; `Png` or `Jpeg`.

### `ExcelShape.incrementLeft()`

```ts theme={null}
incrementLeft(increment: number): void
```

### `ExcelShape.incrementRotation()`

```ts theme={null}
incrementRotation(increment: number): void
```

### `ExcelShape.incrementTop()`

```ts theme={null}
incrementTop(increment: number): void
```

### `ExcelShape.scaleHeight()`

```ts theme={null}
scaleHeight(factor: number, scaleType: ShapeScaleType, scaleFrom?: ShapeScaleFrom): void
```

### `ExcelShape.scaleWidth()`

```ts theme={null}
scaleWidth(factor: number, scaleType: ShapeScaleType, scaleFrom?: ShapeScaleFrom): void
```

### `ExcelShape.set()`

```ts theme={null}
set(properties: ExcelShape | UpdateData<ExcelShape>, options?: UpdateOptions): void
```

Sets several properties at once.

### `ExcelShape.setZOrder()`

```ts theme={null}
setZOrder(position: ShapeZOrder): void
```

## `ExcelImage`

`Excel.Image`.

Import from `@reductoai/xlsx/officejs`.

### ExcelImage properties

| Name | Type | Description |
| - | - | - |
| `brightness` | `number` | |
| `colorType` | `PictureColorType` | |
| `contrast` | `number` | |
| `cropBottom` | `number` | |
| `cropLeft` | `number` | |
| `cropRight` | `number` | |
| `cropTop` | `number` | |
| `format` | `PictureFormat` | read-only |
| `id` | `string` | read-only |
| `shape` | `ExcelShape` | read-only |

### `ExcelImage.incrementBrightness()`

```ts theme={null}
incrementBrightness(increment: number): void
```

### `ExcelImage.incrementContrast()`

```ts theme={null}
incrementContrast(increment: number): void
```

### `ExcelImage.set()`

```ts theme={null}
set(properties: ExcelImage | UpdateData<ExcelImage>, options?: UpdateOptions): void
```

## `TextFrame`

`Excel.TextFrame`.

Import from `@reductoai/xlsx/officejs`.

### TextFrame properties

| Name | Type | Description |
| - | - | - |
| `autoSizeSetting` | `ShapeAutoSize` | |
| `bottomMargin` | `number` | |
| `hasText` | `boolean` | read-only |
| `horizontalAlignment` | `ShapeTextHorizontalAlignment` | |
| `horizontalOverflow` | `ShapeTextHorizontalOverflow` | |
| `leftMargin` | `number` | |
| `orientation` | `ShapeTextOrientation` | |
| `readingOrder` | `ShapeTextReadingOrder` | |
| `rightMargin` | `number` | |
| `textRange` | `TextRange` | read-only |
| `topMargin` | `number` | |
| `verticalAlignment` | `ShapeTextVerticalAlignment` | |
| `verticalOverflow` | `ShapeTextVerticalOverflow` | |

### `TextFrame.deleteText()`

```ts theme={null}
deleteText(): void
```

### `TextFrame.set()`

```ts theme={null}
set(properties: TextFrame | UpdateData<TextFrame>, options?: UpdateOptions): void
```

## `ShapeFill`

`Excel.ShapeFill`.

Import from `@reductoai/xlsx/officejs`.

### ShapeFill properties

| Name | Type | Description |
| - | - | - |
| `foregroundColor` | `string` | |
| `transparency` | `number \| null` | |
| `type` | `ShapeFillType` | read-only |

### `ShapeFill.clear()`

```ts theme={null}
clear(): void
```

### `ShapeFill.set()`

```ts theme={null}
set(properties: ShapeFill | UpdateData<ShapeFill>, options?: UpdateOptions): void
```

### `ShapeFill.setSolidColor()`

```ts theme={null}
setSolidColor(color: string): void
```

## `ShapeLineFormat`

`Excel.ShapeLineFormat`.

Import from `@reductoai/xlsx/officejs`.

### ShapeLineFormat properties

| Name | Type | Description |
| - | - | - |
| `color` | `string \| null` | |
| `dashStyle` | `ShapeLineDashStyle \| null` | |
| `style` | `ShapeLineStyle \| null` | |
| `transparency` | `number \| null` | |
| `visible` | `boolean` | |
| `weight` | `number \| null` | |

### `ShapeLineFormat.set()`

```ts theme={null}
set(
  properties: ShapeLineFormat | UpdateData<ShapeLineFormat>,
  options?: UpdateOptions,
): void
```
