> ## 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.

# Types: editor: Shapes, pictures and charts

## `ChartPick`

The picked element, by the chart's anchoring character; another chart starts on its area.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `at` | `string` | |
| `part` | `string` | |

## `ChartRef`

A chart reference (`c:f`) and whether it reads numbers (`c:numRef`) or text (`c:strRef`).

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `f` | `string` | |
| `multiLevel?` | `{ across: boolean }` | |
| `numeric` | `boolean` | |

## `ChartRefCache`

`levels` (multi-level only) runs from the leaf out; `points` is the leaf.

Not exported by name. You get it from the API.

```ts theme={null}
type ChartRefCache = ChartRef & { levels?: (string | null)[][]; points: (string | null)[] }
```

## `ChartSeriesData`

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `name` | `string` | |
| `values` | `(number \| null)[]` | |

## `ChartSeriesRefs`

Where one series reads its name, categories (or x values), values and bubble sizes.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `categories?` | `string` | |
| `name?` | `string` | |
| `size?` | `string` | |
| `values` | `string` | |
| `x?` | `string` | |

## `ChartSource`

Every series' references; `numericCategories`: the categories are numbers or dates.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `family` | `"category" \| "scatter" \| "bubble"` | |
| `numericCategories` | `boolean` | |
| `series` | `ChartSeriesRefs[]` | |

## `ChartState`

The chart a picture site paints, for the data pane.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `categories` | `string[]` | |
| `design` | `ChartDesign` | What the Chart Design tab's menus check. |
| `editable` | `boolean` | False for scatter and bubble charts, whose x values the sheet cannot hold. |
| `elements` | `ChartElementView[]` | Every element the Format pane edits, in Word's order, with its current format. |
| `series` | `ChartSeriesData[]` | |
| `title` | `string \| null` | |
| `workbook` | `boolean` | Edit Data opens a workbook: the chart's own, or one laid out from its data. |

## `ChartWorkbook`

What Edit Data opens: the chart's workbook and the references it reads from it. A chart with
no workbook gets one laid out from its own data (`made`); a chart linked to a file outside
the document shows its last values, read-only (`linked` names the file).

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `bytes` | `Uint8Array` | |
| `linked?` | `string` | |
| `made?` | `boolean` | |
| `refs` | `ChartRef[]` | |
| `source?` | `ChartSource` | Present when the series form one block Edit Data can grow. |
| `visibleOnly` | `boolean` | |

## `CollabSnapshot`

`sizes` are the token counts of its streams, which the server checks later changes against.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `bytes` | `Uint8Array` | |
| `seq` | `number` | |
| `sizes?` | `StreamSizes` | |

## `ImageCommand`

Pictures. `insertImage` lands at a collapsed caret; the others act on the
picture the selection spans (its single U+FFFC character), or the picture
right before a collapsed focus.

Not exported by name. You get it from the API.

```ts theme={null}
type ImageCommand = { alt?: string; bytes: Uint8Array; heightPt: number; kind: "insertImage"; mime: SniffedPicture["mime"]; svg?: Uint8Array; widthPt: number } | { chartType: AuthoredChartType; kind: "insertChart" } | { fillColor?: string | null; heightPt?: number; kind: "insertTextBox"; leftPt?: number; lineColor?: string | null; lineWeightPt?: number; text?: string; topPt?: number; vertical?: boolean; widthPt?: number; wordArt?: number } | { geom: string; heightPt?: number; kind: "insertShape"; leftPt?: number; text?: string; topPt?: number; widthPt?: number } | { kind: "imageLayout"; layout: ImageLayout } | { kind: "imageOrder"; to: "forward" | "backward" | "front" | "back" } | { heightPt: number; kind: "imageResize"; widthPt: number } & LiveStep | { alt: string; kind: "imageAlt" } | { kind: "imageAlign" } & ImageAlign | { degrees: number; kind: "imageRotate" } & LiveStep | { kind: "imageMoveWithText"; on: boolean } | { axis: "horizontal" | "vertical"; kind: "imageFlip" } | { dxPt: number; dyPt: number; kind: "imageMove" } & LiveStep | { at: Position; kind: "imageMoveTo" } | { at: Position; kind: "imageMoveAcross"; page?: number; xPt: number; yPt: number } & LiveStep | { handle: number; kind: "shapeAdjust"; xPt: number; yPt: number } & LiveStep | { kind: "shapeAddText" } | { geom: string; kind: "shapeGeometry" } | { end: 0 | 1; kind: "shapeEnd"; xPt: number; yPt: number } & LiveStep | { color: string | null; gradient?: ShapeFillGradient; kind: "shapeFill" } | { kind: "shapeLine"; line: Partial<ShapeLineStyle> | null } | { kind: "imageTransparency"; percent: number } | { crop: Partial<PictureCrop>; kind: "imageCrop" } | { aspect: number; kind: "imageCropFit"; mode: "fill" | "fit" } | { bytes: Uint8Array; kind: "imageChange"; mime: SniffedPicture["mime"]; svg?: Uint8Array } | { kind: "imageReset"; size?: boolean } | { effect: EffectKind; kind: "imageEffect"; preset: string | null } | { kind: "imageRecolor"; recolor: PictureRecolor | null } | { color: string | null; kind: "imageTransparentColor" } | { frame: Partial<Omit<ShapeTextFrame, "insetsPt">> & { insetsPt?: Partial<ShapeInsetsPt> }; kind: "shapeTextFrame" } | { categories: string[]; group?: string; kind: "chartData"; series: ChartSeriesData[] } | { group?: string; kind: "chartTitle"; title: string | null } | { caches: ChartRefCache[]; group?: string; kind: "chartWorkbook"; source?: ChartSource; workbook: Uint8Array } | { group?: string; kind: "chartFormat"; part: string; set: ChartFormatPatch } | { group?: string; kind: "chartDesign"; set: ChartDesignPatch }
```

## `ImageLayout`

Inline sits in the text flow; float anchors to the paragraph and text wraps around it.

Import from `@reductoai/docx-editor`, `@reductoai/docx-editor/model`.

```ts theme={null}
type ImageLayout = { kind: "inline" } | { align?: "left" | "center" | "right"; alignV?: "top" | "center" | "bottom"; behindText?: boolean; kind: "float"; wrap: ImageWrapType; wrapSide?: ImageWrapSide }
```

## `ImageState`

The picture under the selection, for toolbars and context menus.

Import from `@reductoai/docx-editor`, `@reductoai/docx-editor/model`.

| Name | Type | Description |
| - | - | - |
| `alt` | `string` | |
| `chart?` | `ChartState` | Set when the drawing is a chart in the body. |
| `effects?` | `Partial<Record<EffectKind, string \| null>>` | A picture's or shape's effect tiles: null for none; a gallery no tile matches is left out. |
| `geometry?` | `ShapeGeometry` | A drawn shape's preset: its adjust handles, and a connector's ends. |
| `heightPt` | `number` | |
| `layout` | `ImageLayout` | |
| `moveWithText?` | `boolean` | A float whose vertical position follows its paragraph or line (Move with Text). |
| `naturalPx?` | `{ height: number; width: number }` | Intrinsic pixel size when the part is a decodable bitmap. |
| `picture?` | `{ crop: PictureCrop; line: ShapeLineStyle \| null; recolor?: PictureRecolor \| null; shape?: string; transparency: number; transparentColor?: string \| null }` | Set when the drawing is a picture: its outline (`null` for none) and Transparency in percent. |
| `rotationDeg` | `number` | `a:xfrm@rot` in clockwise degrees, in \[0, 360); 0 when the drawing owns no xfrm. |
| `shape?` | `ShapeStyle` | A drawn shape's or text box's fill, outline and text frame. |
| `textbox?` | `true` | Set when the drawing is a text box, whose text is edited as a story of its own. |
| `upright?` | `true` | Set when the drawing has no `a:xfrm` to turn (a chart or diagram); `imageRotate` refuses it. |
| `widthPt` | `number` | |

## `PictureHit`

`rect` is the turned box the flow reserved; `ink` the upright frame the handles sit on, at `deg`.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `at` | `Position` | |
| `chart?` | `true` | A chart: a double-click opens its data. |
| `chartRef?` | `LayoutImageRef` | A chart's laid drawing, whose tagged ink tells which element a click lands on. |
| `deg` | `number` | |
| `image?` | `LayoutImageRef` | The laid drawing, whose painted geometry is what a click grabs. |
| `ink` | `Rect` | |
| `rect` | `Rect` | |
| `run` | `LayoutRun` | |
| `textbox?` | `string` | Set on a text box: the story its text is edited as. |
| `upright?` | `true` | A chart or diagram: Word gives it no rotate handle. |

## `ShapeSelection`

The anchoring character of a float, selected as Word does when the shape itself is clicked.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `owner` | `StoryHit \| undefined` | |
| `selection` | `Selection` | |

## `SnapKind`

Not exported by name. You get it from the API.

```ts theme={null}
type SnapKind = "margin" | "center" | "object" | "column" | "table"
```

## `SnapLine`

One guide: `at` on its axis, spanning `from`..`to` on the other, page-local hmm.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `at` | `number` | |
| `from` | `number` | |
| `kind` | `SnapKind` | |
| `to` | `number` | |

## `SnapTargets`

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `x` | `SnapLine[]` | |
| `y` | `SnapLine[]` | |
