Skip to content

@shbernal/pptxgenjs


@shbernal/pptxgenjs / index / ShapeProps

Interface: ShapeProps

Defined in: core-interfaces.ts:1217

Extends

Extended by

Properties

align?

optional align?: HAlign

Defined in: core-interfaces.ts:1222

Horizontal alignment

Default

ts
'left'

altText?

optional altText?: string

Defined in: core-interfaces.ts:807

Alt Text value ("How would you describe this object and its contents to someone who is blind?")

  • serialized to the generated object's p:cNvPr descr attribute
  • PowerPoint: [right-click on the object] > "Edit Alt Text..."

Since

v4.0.0

Example

ts
'Quarterly revenue bar chart'

Inherited from

ObjectNameProps.altText


angleRange?

optional angleRange?: [number, number]

Defined in: core-interfaces.ts:1230

Radius (only for pptx.shapes.PIE, pptx.shapes.ARC, pptx.shapes.BLOCK_ARC)

  • In the case of pptx.shapes.BLOCK_ARC you have to setup the arcThicknessRatio
  • values: [0-359, 0-359]

Since

v3.4.0

Default

ts
[270, 0]

arcThicknessRatio?

optional arcThicknessRatio?: number

Defined in: core-interfaces.ts:1251

Radius (only for pptx.shapes.BLOCK_ARC)

  • You have to setup the angleRange values too
  • values: 0.0-1.0

Since

v3.4.0

Default

ts
0.5

fill?

optional fill?: ShapeFillProps

Defined in: core-interfaces.ts:1258

Shape fill color properties

Examples

ts
{ color:'FF0000' } // hex color (red)
ts
{ color:'0088CC', transparency:50 } // hex color, 50% transparent
ts
{ color:pptx.SchemeColor.accent1 } // Theme color Accent1

flipH?

optional flipH?: boolean

Defined in: core-interfaces.ts:1263

Flip shape horizontally?

Default

ts
false

flipV?

optional flipV?: boolean

Defined in: core-interfaces.ts:1268

Flip shape vertical?

Default

ts
false

h?

optional h?: Coord

Defined in: core-interfaces.ts:47

Height

  • inches or percentage

Examples

ts
10.25 // height in inches
ts
'75%' // height as percentage of slide size

Inherited from

PositionProps.h


optional hyperlink?: HyperlinkProps

Defined in: core-interfaces.ts:1273

Add hyperlink to shape

Example

ts
hyperlink: { url: "https://github.com/gitbrent/pptxgenjs", tooltip: "Visit Homepage" },

line?

optional line?: ShapeLineProps

Defined in: core-interfaces.ts:1277

Line options


lineDash?

optional lineDash?: "dash" | "solid" | "dashDot" | "lgDash" | "lgDashDot" | "lgDashDotDot" | "sysDash" | "sysDot"

Defined in: core-interfaces.ts:1315

Deprecated

v3.3.0


lineHead?

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

Defined in: core-interfaces.ts:1319

Deprecated

v3.3.0


lineSize?

optional lineSize?: number

Defined in: core-interfaces.ts:1311

Deprecated

v3.3.0


lineTail?

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

Defined in: core-interfaces.ts:1323

Deprecated

v3.3.0


objectLock?

optional objectLock?: ObjectLockProps

Defined in: core-interfaces.ts:819

Object lock flags (DrawingML a:spLocks / a:picLocks / a:graphicFrameLocks)

  • restrict how the object can be manipulated in PowerPoint (e.g. prevent moving, resizing, or grouping)
  • each flag maps 1:1 to the OOXML attribute of the same name; only flags set to true are emitted
  • PowerPoint UI: Selection Pane / right-click protections (most locks are honored at edit time, not as a password)
  • flags only apply to the object types that support them (see each flag); flags set on an unsupported object type are ignored with a console warning

Since

v4.0.0

Examples

ts
{ noMove: true, noResize: true } // pin an object in place
ts
{ noGrp: true } // exclude from grouping

Inherited from

ObjectNameProps.objectLock


objectName?

optional objectName?: string

Defined in: core-interfaces.ts:799

Object name

  • used instead of default "Object N" name
  • PowerPoint: Home > Arrange > Selection Pane...

Since

v3.10.0

Default

ts
'Object 1'

Example

ts
'Antenna Design 9'

Inherited from

ObjectNameProps.objectName


points?

optional points?: GeometryPoint[]

Defined in: core-interfaces.ts:1288

Points (only for pptx.shapes.CUSTOM_GEOMETRY)

  • type: 'arc'
  • hR Shape Arc Height Radius
  • wR Shape Arc Width Radius
  • stAng Shape Arc Start Angle
  • swAng Shape Arc Swing Angle

See

http://www.datypic.com/sc/ooxml/e-a_arcTo-1.html

Example

ts
[{ x: 0, y: 0 }, { x: 10, y: 10 }] // draw a line between those two points

rectRadius?

optional rectRadius?: number

Defined in: core-interfaces.ts:1294

Rounded rectangle radius (only for pptx.shapes.ROUNDED_RECTANGLE)

  • values: 0.0 to 1.0

Default

ts
0

rotate?

optional rotate?: number

Defined in: core-interfaces.ts:1301

Rotation (degrees)

  • range: -360 to 360

Default

ts
0

Example

ts
180 // rotate 180 degrees

shadow?

optional shadow?: ShadowProps

Defined in: core-interfaces.ts:1306

Shadow options TODO: need new demo.js entry for shape shadow


shapeAdjust?

optional shapeAdjust?: ShapeAdjustValue | ShapeAdjustValue[]

Defined in: core-interfaces.ts:1243

Preset-geometry adjustment handles (<a:avLst> guides) for any preset shape.

  • Use this to tune adjustment handles that lack a dedicated shortcut option, e.g. chevron/arrow point depth, callout pointer, bevel/frame thickness.
  • Accepts a single guide or an array; each value is a 0.0–1.0 fraction of the handle's range (see ShapeAdjustValue).
  • rectRadius / angleRange remain friendly shortcuts; any shapeAdjust guide that does not collide with a shortcut name is emitted in addition.

Since

v4.0.0

Examples

ts
{ name: 'adj', value: 0.25 } // set the single adjust handle to 25%
ts
[{ name: 'adj1', value: 0.5 }, { name: 'adj2', value: 0.25 }] // two handles

shapeName?

optional shapeName?: string

Defined in: core-interfaces.ts:1328

Shape name (used instead of default "Shape N" name)

Deprecated

v3.10.0 - use objectName


w?

optional w?: Coord

Defined in: core-interfaces.ts:54

Width

  • inches or percentage

Examples

ts
10.25 // width in inches
ts
'75%' // width as percentage of slide size

Inherited from

PositionProps.w


x?

optional x?: Coord

Defined in: core-interfaces.ts:33

Horizontal position

  • inches or percentage

Examples

ts
10.25 // position in inches
ts
'75%' // position as percentage of slide size

Inherited from

PositionProps.x


y?

optional y?: Coord

Defined in: core-interfaces.ts:40

Vertical position

  • inches or percentage

Examples

ts
10.25 // position in inches
ts
'75%' // position as percentage of slide size

Inherited from

PositionProps.y