Skip to content

@shbernal/ts-pptx


@shbernal/ts-pptx / index / ConnectorProps

Interface: ConnectorProps

Defined in: src/types/style.ts:241

A connector is a line drawn between two points, emitted as a PowerPoint connector (<p:cxnSp>) so the app treats it as a connector (selectable/reroutable) rather than a plain line shape. Endpoints are given directly; the bounding box and flip flags are derived.

Properties

adj?

optional adj?: number | number[]

Defined in: src/types/style.ts:267

Bend position(s) as a percent of the connector box (0100), one value per bend. A single number sets the sole jog of a one-bend elbow / curved; an array sets each jog of a multi-bend connector and its length must equal bends. Values outside 0100 are allowed (they place the bend beyond the endpoint box, as PowerPoint itself does when endpoints flip). When omitted, PowerPoint uses the preset default (50%).

Emitted as <a:gd name="adj1…" fmla="val …"/> adjust guides (OOXML 1000ths-of-a-percent).


altText?

optional altText?: string

Defined in: src/types/style.ts:319

Accessibility alt text


beginArrowType?

optional beginArrowType?: "none" | "triangle" | "diamond" | "arrow" | "oval" | "stealth"

Defined in: src/types/style.ts:313

Arrowhead at the start point


bends?

optional bends?: 2 | 1 | 3

Defined in: src/types/style.ts:257

Number of adjustable bends (jogs) for an elbow / curved connector. Selects the preset variant and how many adj values it accepts:

  • 1bentConnector3 / curvedConnector3 (one jog) — the default
  • 2bentConnector4 / curvedConnector4 (two jogs)
  • 3bentConnector5 / curvedConnector5 (three jogs)

Ignored for type: 'straight' (a straight connector has no bends).

Default

ts
1

color?

optional color?: string

Defined in: src/types/style.ts:304

Line color (6-digit hex, no #)

Default

ts
'000000'

dashType?

optional dashType?: "dash" | "dashDot" | "lgDash" | "lgDashDot" | "lgDashDotDot" | "solid" | "sysDash" | "sysDot" | "dot" | "sysDashDot" | "sysDashDotDot"

Defined in: src/types/style.ts:311

Dash style


endArrowType?

optional endArrowType?: "none" | "triangle" | "diamond" | "arrow" | "oval" | "stealth"

Defined in: src/types/style.ts:315

Arrowhead at the end point


endShape?

optional endShape?: string

Defined in: src/types/style.ts:286

Bind the connector's end point to a shape on the same slide (by objectName). Emits <a:endCxn>. See startShape.


endShapeIdx?

optional endShapeIdx?: number

Defined in: src/types/style.ts:291

Connection-site index on endShape. Ignored without endShape.

Default

ts
0

objectName?

optional objectName?: string

Defined in: src/types/style.ts:317

Selection Pane object name


startShape?

optional startShape?: string

Defined in: src/types/style.ts:278

Bind the connector's start point to a shape on the same slide, referenced by that shape's objectName. Emits <a:stCxn id=… idx=…>, so PowerPoint treats the endpoint as attached: it reroutes when the shape moves and its elbow auto-router can engage. The shape's objectName must be set and unique on the slide. x1/y1 remain the static fallback geometry (and are used if the name can't be resolved).

A shape inside a group is a valid target — group children are named on the same slide — though the connector itself cannot be a group child (see Slide.addGroup).


startShapeIdx?

optional startShapeIdx?: number

Defined in: src/types/style.ts:284

Connection-site index on startShape (0-based; the valid range is preset-dependent — a shape's <a:cxnLst> enumerates its sites). Ignored without startShape.

Default

ts
0

type?

optional type?: ConnectorType

Defined in: src/types/style.ts:246

Routing style

Default

ts
'straight'

width?

optional width?: number

Defined in: src/types/style.ts:309

Line width (pt)

Default

ts
1

x1

x1: Coord

Defined in: src/types/style.ts:293

Start point X — inches, or a Coord such as '50%' / '2in'


x2

x2: Coord

Defined in: src/types/style.ts:297

End point X


y1

y1: Coord

Defined in: src/types/style.ts:295

Start point Y


y2

y2: Coord

Defined in: src/types/style.ts:299

End point Y