Optionalmodifier: ShapeModifierCurrent rotation angle in degrees (0 if no Angle cell is set).
true if this shape is a Group (i.e. it can contain nested child shapes).
Use shape.getChildren() to retrieve those children.
The shape's Type attribute — 'Group' for group shapes, 'Shape' (or undefined
normalised to 'Shape') for regular shapes.
Add a connection point to this shape. Returns the zero-based index (IX) of the newly added point.
Optionaldescription: stringApply a document-level stylesheet to this shape.
Create styles via doc.createStyle() and pass the returned id.
The stylesheet ID to apply.
'all' (default) applies to line, fill, and text;
'line', 'fill', or 'text' applies to only that category.
OptionalbeginArrow: stringOptionalendArrow: stringOptionalstyle: ConnectorStyleOptionalfromPort: ConnectionTargetOptionaltoPort: ConnectionTargetFlip the shape horizontally. Pass false to un-flip.
Flip the shape vertically. Pass false to un-flip.
Return the direct child shapes of this group. Returns an empty array for non-group shapes or groups with no children.
Only direct children are returned — grandchildren are accessible by calling
getChildren() on the child shape.
const group = await page.addShape({ text: 'G', x: 5, y: 5, width: 4, height: 4, type: 'Group' });
await page.addShape({ text: 'Child A', x: 1, y: 1, width: 1, height: 1 }, group.id);
await page.addShape({ text: 'Child B', x: 2, y: 1, width: 1, height: 1 }, group.id);
group.getChildren(); // → [Shape('Child A'), Shape('Child B')]
Read back all hyperlinks attached to this shape.
Read back the layer indices this shape is assigned to. Returns an empty array if the shape has no layer assignment.
Read back all custom property (shape data) entries written to this shape. Returns a map of property key → ShapeData. Values are coerced to the declared Visio type (Number, Boolean, Date, or String).
Optionaldescription: stringResize the shape to the given width and height (in inches). Updates LocPinX/LocPinY to keep the centre-pin at width/2, height/2.
Rotate the shape to an absolute angle (degrees, clockwise). Replaces any existing rotation.
Adds an internal link to another page. Shows up in the right-click menu in Visio.
The Page object to link to
Optionaldescription: stringText to show in the menu
Adds an external hyperlink to the shape. Shows up in the right-click menu in Visio.
External URL (e.g. https://google.com)
Optionaldescription: stringText to show in the menu
A handle to a single shape on a Visio page.
Obtain instances via Page.addShape, Page.getShapes, Page.getShapeById, or Page.findShapes.
Example