Appearance
@shbernal/pptxgenjs / index / ShapeProps
Interface: ShapeProps
Defined in: core-interfaces.ts:1202
Extends
Extended by
Properties
align?
optionalalign?:HAlign
Defined in: core-interfaces.ts:1207
Horizontal alignment
Default
ts
'left'altText?
optionalaltText?:string
Defined in: core-interfaces.ts:800
Alt Text value ("How would you describe this object and its contents to someone who is blind?")
- serialized to the generated object's
p:cNvPrdescrattribute - PowerPoint: [right-click on the object] > "Edit Alt Text..."
Example
ts
'Quarterly revenue bar chart'Inherited from
angleRange?
optionalangleRange?: [number,number]
Defined in: core-interfaces.ts:1214
Radius (only for pptx.ShapeType.pie, pptx.ShapeType.arc, pptx.ShapeType.blockArc)
- In the case of pptx.ShapeType.blockArc you have to setup the arcThicknessRatio
- values: [0-359, 0-359]
Default
ts
[270, 0]arcThicknessRatio?
optionalarcThicknessRatio?:number
Defined in: core-interfaces.ts:1233
Radius (only for pptx.ShapeType.blockArc)
- You have to setup the angleRange values too
- values: 0.0-1.0
Default
ts
0.5fill?
optionalfill?:ShapeFillProps
Defined in: core-interfaces.ts:1240
Shape fill color properties
Examples
ts
{ color:'FF0000' } // hex color (red)ts
{ color:'0088CC', transparency:50 } // hex color, 50% transparentts
{ color:pptx.SchemeColor.accent1 } // Theme color Accent1flipH?
optionalflipH?:boolean
Defined in: core-interfaces.ts:1245
Flip shape horizontally?
Default
ts
falseflipV?
optionalflipV?:boolean
Defined in: core-interfaces.ts:1250
Flip shape vertical?
Default
ts
falseh?
optionalh?:Coord
Defined in: core-interfaces.ts:61
Height
- inches or percentage
Examples
ts
10.25 // height in inchests
'75%' // height as percentage of slide sizeInherited from
hyperlink?
optionalhyperlink?:HyperlinkProps
Defined in: core-interfaces.ts:1255
Add hyperlink to shape
Example
ts
hyperlink: { url: "https://example.com", tooltip: "Visit Homepage" },line?
optionalline?:ShapeLineProps
Defined in: core-interfaces.ts:1259
Line options
objectLock?
optionalobjectLock?:ObjectLockProps
Defined in: core-interfaces.ts:811
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
trueare 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
Examples
ts
{ noMove: true, noResize: true } // pin an object in placets
{ noGrp: true } // exclude from groupingInherited from
objectName?
optionalobjectName?:string
Defined in: core-interfaces.ts:793
Object name
- used instead of default "Object N" name
- PowerPoint: Home > Arrange > Selection Pane...
Default
ts
'Object 1'Example
ts
'Antenna Design 9'Inherited from
points?
optionalpoints?:GeometryPoint[]
Defined in: core-interfaces.ts:1270
Points (only for pptx.ShapeType.custGeom)
- type: 'arc'
hRShape Arc Height RadiuswRShape Arc Width RadiusstAngShape Arc Start AngleswAngShape 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 pointsrectRadius?
optionalrectRadius?:number
Defined in: core-interfaces.ts:1276
Rounded rectangle radius (only for pptx.ShapeType.roundRect)
- values: 0.0 to 1.0
Default
ts
0rotate?
optionalrotate?:number
Defined in: core-interfaces.ts:1283
Rotation (degrees)
- range: -360 to 360
Default
ts
0Example
ts
180 // rotate 180 degreesshadow?
optionalshadow?:ShadowProps
Defined in: core-interfaces.ts:1287
Shadow options
shapeAdjust?
optionalshapeAdjust?:ShapeAdjustValue|ShapeAdjustValue[]
Defined in: core-interfaces.ts:1226
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
valueis a0.0–1.0fraction of the handle's range (see ShapeAdjustValue). rectRadius/angleRangeremain friendly shortcuts; anyshapeAdjustguide that does not collide with a shortcut name is emitted in addition.
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 handlesw?
optionalw?:Coord
Defined in: core-interfaces.ts:68
Width
- inches or percentage
Examples
ts
10.25 // width in inchests
'75%' // width as percentage of slide sizeInherited from
x?
optionalx?:Coord
Defined in: core-interfaces.ts:47
Horizontal position
- inches or percentage
Examples
ts
10.25 // position in inchests
'75%' // position as percentage of slide sizeInherited from
y?
optionaly?:Coord
Defined in: core-interfaces.ts:54
Vertical position
- inches or percentage
Examples
ts
10.25 // position in inchests
'75%' // position as percentage of slide size