ReferenceAPI
Shapes, charts and tables
The objects on a slide, and what can be changed on each.
The objects on a slide, and what can be changed on each. The same text agents read through help().
shape.frame
Section titled “shape.frame”frame: FrameThe frame in px: its own, or the layout’s when it inherits from a placeholder.
shape.id
Section titled “shape.id”id: stringAgent-facing anchor, e.g. sh_7Q2M4K9A.
shape.name
Section titled “shape.name”name: stringRole name, e.g. “title” or “kpi-value”; shown in inspect() and the selection pane.
shape.options
Section titled “shape.options”options: Readonly<ShapeInit>The options the shape was built from, including any update().
shape.replaceText
Section titled “shape.replaceText”replaceText(find: string | RegExp, replacement: string): numberReplaces text, keeping paragraphs, runs and styles: shape.replaceText("48%", "49%"). A string
matches literally; a RegExp can use $1 references. Returns the number of replacements.
shape.replaceText("48%", "49%")shape.setText
Section titled “shape.setText”setText(text: NonNullable<ShapeOptions["text"]>): thisReplaces the shape’s text (a string, paragraphs or runs), keeping its box and look: shape.setText("Q3 at a glance").
Options: ShapeOptions.
shape.setText("Q3 at a glance")shape.text
Section titled “shape.text”text: stringThe text, one line per paragraph (“” for a shape without text).
shape.update
Section titled “shape.update”update(changes: Partial<ShapeOptions>): thisChanges some options and keeps the rest: shape.update({ frame: { x: 40, y: 80, w: 400, h: 60 } }).
The shape keeps its id; connectors attached to it follow it.
Options: ShapeOptions.
shape.update({ frame: { x: 40, y: 80, w: 400, h: 60 } })chart.id
Section titled “chart.id”id: stringAgent-facing anchor, e.g. ch_7Q2M4K9A.
chart.options
Section titled “chart.options”options: Readonly<ChartOptions>The options the chart was built from, including any update().
chart.type
Section titled “chart.type”type: ChartTypeThe chart type, e.g. “column”, “line” or “pie”.
chart.update
Section titled “chart.update”update(changes: Partial<ChartOptions>): thisChanges some options and keeps the rest, e.g. new series or a title. Axes merge axis by
axis and label or legend objects merge, so { axes: { y: { min: 2 } } } keeps the y format.
Options: ChartOptions.
{ axes: { y: { min: 2 } } }table.id
Section titled “table.id”id: stringAgent-facing anchor, e.g. tb_7Q2M4K9A.
table.options
Section titled “table.options”options: Readonly<TableOptions>The options the table was built from, including any update().
table.update
Section titled “table.update”update(changes: Partial<TableOptions>): thisChanges some options and keeps the rest, e.g. new rows or a frame.
Options: TableOptions.
connector.from
Section titled “connector.from”from: Connectable & { frame?: Frame }The elements it joins.
connector.id
Section titled “connector.id”id: stringAgent-facing anchor, e.g. sh_7Q2M4K9A.
connector.options
Section titled “connector.options”options: ConnectOptionsHow it was drawn: kind, line, arrow and sides.
connector.to
Section titled “connector.to”to: Connectable & { frame?: Frame }The element the arrow points at.
group.children
Section titled “group.children”children: SlideElement[]The members, back to front.
group.id
Section titled “group.id”id: stringAgent-facing anchor, e.g. sh_7Q2M4K9A.
group.name
Section titled “group.name”name: stringRole name for the group.
image.id
Section titled “image.id”id: stringAgent-facing anchor, e.g. im_7Q2M4K9A.
image.options
Section titled “image.options”options: Readonly<ImageOptions>The options the picture was built from, including any update().
image.update
Section titled “image.update”update(changes: Partial<ImageOptions>): thisChanges some options and keeps the rest, e.g. a new source, frame or crop.
Options: ImageOptions.