Show.Line
Show.Line is an object type of the Presentation module (Office.show(iframe)). 70 methods.
Presentation · 10 object types · 586 methods · namespace Show. This reference is generated from the API document artifact (sdk-api-doc.html) produced with the SDK build. Descriptions are the editor's API comments as published. Pin the SDK and Office versions together and regenerate when either changes.
Remarks
- Module: Presentation ·
Office.show(iframe)· namespaceShow - Obtained from: returned as a value by the methods listed in the summary tables of other object types
- Every method returns a
Promise; signatures use TypeScript notation.
Methods
| Method | Description |
|---|---|
align(alignType) | Aligns the shape relative to the slide. |
flip(direction) | Flips the shape vertically or horizontally. |
getEffects() | Returns the effects applied to the shape. |
getFill() | Returns the shape fill. |
getHeadEnd() | Returns the connector's start arrow (headEnd). |
getHeight() | Returns the shape's height. |
getHyperlink() | Returns the hyperlink set on the shape. |
getLineCap() | Returns the line cap. |
getLineColor() | Returns the line color. |
getLineDash() | Returns the line dash type. |
getLineJoin() | Returns the line join type. |
getLineStyle() | Returns the line style. |
getLineWidth() | Returns the line width (pt). |
getPlaceholderType() | Returns the placeholder type of the shape. |
getPresetId() | Returns the shape's OOXML preset id (prst). |
getRotation() | Returns the rotation angle of the shape. |
getTailEnd() | Returns the connector's end arrow (tailEnd). |
getTransform() | Returns the position, size, and rotation of the shape. |
getWidth() | Returns the shape's width. |
getX() | Returns the shape's X coordinate. |
getY() | Returns the shape's Y coordinate. |
getZOrderIndex() | Returns the z-order index of the shape within its parent (the slide, or the group for a group child). |
hasText() | Returns whether the shape contains text. |
isChart() | Checks whether this handle is a Chart (a type guard for union narrowing). |
isControl() | Checks whether this handle is a Control (a type guard for union narrowing). |
isDiagram() | Checks whether this handle is a Diagram (a type guard for union narrowing). |
isFlippedH() | Returns whether the shape is flipped horizontally. |
isFlippedV() | Returns whether the shape is flipped vertically. |
isGroup() | Checks whether this handle is a Group (a type guard for union narrowing). |
isImage() | Checks whether this handle is an Image (a type guard for union narrowing). |
isLine() | Checks whether this handle is a Line (a type guard for union narrowing). |
isOleObject() | Checks whether this handle is an OleObject (a type guard for union narrowing). |
isPlaceholder() | Returns whether the shape is a placeholder (title, body frame, etc.). |
isShape() | Checks whether this handle is a Shape (a type guard for union narrowing). |
isTable() | Checks whether this handle is a Table (a type guard for union narrowing). |
moveBy(distance) | Moves the shape by x, y relative to its current position. |
remove3d() | Removes the shape's 3D effect. |
removeEffect(effectType) | Removes an effect. |
removeFill() | Removes the fill (noFill). |
removeHyperlink() | Removes the shape's hyperlink. |
removeLineColor() | Removes the line color (noFill). |
reorder(order) | Changes the shape's z-order (forward/backward). |
set3d(scene3d, sp3d) | Applies a 3D effect to the shape. |
setEffects(effects) | Applies an effects object returned by getEffects() as is. |
setFill(fill) | Applies a fill object returned by getFill() as is. |
setGlow(glow) | Applies a glow effect. |
setGradientFill(type, stops, angle) | Sets a gradient fill. |
setHeadEnd(lineEnd) | Sets the connector's start arrow (headEnd). |
setHeight(height) | Sets the height of the shape. |
setHyperlink(hyperlink) | Sets a hyperlink on the shape (symmetric with getHyperlink - the returned object can be passed back to copy a hyperlink). |
setImageFill(imageUrl, fillMode, alpha, detail) | Sets an image fill. |
setInnerShadow(shadow) | Applies an inner shadow. |
setLineCap(lineCap) | Sets the line cap. |
setLineColor(color, alpha) | Sets the line color. |
setLineDash(lineDash) | Sets the line style (dash). |
setLineGradient(type, stops, angle) | Sets a gradient fill on the line (border). |
setLineJoin(lineJoin) | Sets the line join type. |
setLineStyle(style) | Applies a line-style object returned by getLineStyle() as-is (symmetric with getLineStyle - shape-to-shape line copy). |
setLineWidth(lineWidth) | Sets the line width. |
setOuterShadow(shadow) | Applies an outer shadow. |
setPatternFill(preset, foreColor, backColor, foreAlpha, backAlpha) | Sets a pattern fill. |
setReflection(reflection) | Applies a reflection effect. |
setRotation(rotation) | Sets the rotation angle of the shape as an absolute value. |
setSoftEdge(softEdge) | Applies a soft edge effect. |
setSolidFill(color, alpha) | Sets the shape fill to a solid color. |
setTailEnd(lineEnd) | Sets the connector's end arrow (tailEnd). |
setTransform(transform) | Sets the position, size, and rotation of the shape in one call. |
setWidth(width) | Sets the width of the shape. |
setX(x) | Sets the X coordinate of the shape as an absolute value. |
setY(y) | Sets the Y coordinate of the shape as an absolute value. |
Method details
align(alignType)
Aligns the shape relative to the slide. Ignored for shapes that cannot be moved. Group children also move relative to the slide, not within the group (same as the editor). If a child moves outside its group, the group grows to contain it.
align(alignType: AlignType): Promise<void>;
Parameters
| Name | Type | Description |
|---|---|---|
alignType | AlignType | Alignment type |
Returns
Promise<void>
flip(direction)
Flips the shape vertically or horizontally. This toggles the current flip state; read whether it is currently flipped with isFlippedH()/isFlippedV(). Ignored for shapes that cannot be rotated. For a rotated shape the angle is mirrored as well (getRotation() becomes 360 - previous angle).
flip(direction: FlipDirection): Promise<void>;
Parameters
| Name | Type | Description |
|---|---|---|
direction | FlipDirection | Flip direction |
Returns
Promise<void>
getEffects()
Returns the effects applied to the shape. Only applied effects are included as keys. Each value has the same shape as the argument of the matching setter (setOuterShadow/setInnerShadow/setGlow/setSoftEdge/setReflection/set3d). alpha of shadows and glow is always included even when opaque (0); lengths (pt) and ratios (%) are rounded to one decimal place. If the document carries both outerShadow and innerShadow, both are included (the setters can set only one).
getEffects(): Promise<Effects | null>;
Returns
Promise<Effects | null> - Effect information. An empty object \{\} if no effect is applied; null if the target shape is gone (e.g. deleted during collaboration)
getFill()
Returns the shape fill. (counterpart of setFill - the returned object can be passed back as is) The per-type setters are setSolidFill/setGradientFill/setImageFill/setPatternFill/removeFill.
getFill(): Promise<Fill | null>;
Returns
Promise<Fill | null> - Fill information. \{ type: FillType.NONE \} for noFill; null if the target shape is gone (e.g. deleted during collaboration)
getHeadEnd()
Returns the connector's start arrow (headEnd). (counterpart of setHeadEnd - the returned object can be passed back as is)
getHeadEnd(): Promise<LineEnd | null>;
Returns
Promise<LineEnd | null> - Start arrow settings. null if the target connector is gone. No arrow is not null but an object whose type is LineEndType.NONE
getHeight()
Returns the shape's height. (Symmetric with setHeight.)
getHeight(): Promise<number | null>;
Returns
Promise<number | null> - Height (px). null if the target shape is gone
getHyperlink()
Returns the hyperlink set on the shape. The returned object can be passed straight to setHyperlink. null if an unsupported kind (run program, macro, etc.) is attached.
getHyperlink(): Promise<Hyperlink | null>;
Returns
Promise<Hyperlink | null> - Hyperlink information. null if there is no hyperlink (action)
getLineCap()
Returns the line cap. (Symmetric with setLineCap.)
getLineCap(): Promise<LineCap | null>;
Returns
Promise<LineCap | null> - Line cap. null if not set or the target shape is gone
getLineColor()
Returns the line color. (Symmetric with setLineColor. Use getLineStyle when you also need transparency.)
getLineColor(): Promise<string | null>;
Returns
Promise<string | null> - Line color (hex "#RRGGBB" - scheme colors are resolved to hex). null if there is no line or the target shape is gone
getLineDash()
Returns the line dash type. (Symmetric with setLineDash.)
getLineDash(): Promise<LineDash | null>;
Returns
Promise<LineDash | null> - Line dash type. null if it is not a LineDash enum value or the target shape is gone
getLineJoin()
Returns the line join type. (Symmetric with setLineJoin.)
getLineJoin(): Promise<LineJoin | null>;
Returns
Promise<LineJoin | null> - Line join (corner) type. null if not set or the target shape is gone
getLineStyle()
Returns the line style. (counterpart of setLineStyle - the returned object can be passed back as is) The individual setters are setLineColor/setLineGradient/setLineWidth/setLineDash/setLineCap/setLineJoin.
getLineStyle(): Promise<LineStyle | null>;
Returns
Promise<LineStyle | null> - Line style. null if the target shape is gone
getLineWidth()
Returns the line width (pt). (Symmetric with setLineWidth.)
getLineWidth(): Promise<number | null>;
Returns
Promise<number | null> - Line width (pt). Returned even when the line is noFill. null if the target shape is gone
getPlaceholderType()
Returns the placeholder type of the shape.
getPlaceholderType(): Promise<PlaceholderType | null>;
Returns
Promise<PlaceholderType | null> - Placeholder type. null if the shape is not a placeholder or the target shape is gone
getPresetId()
Returns the shape's OOXML preset id (prst).
getPresetId(): Promise<string | null>;
Returns
Promise<string | null> - Preset id (prst); null if none
getRotation()
Returns the rotation angle of the shape. (counterpart of setRotation)
getRotation(): Promise<number | null>;
Returns
Promise<number | null> - Rotation angle (degrees). null if the target shape is gone
getTailEnd()
Returns the connector's end arrow (tailEnd). (counterpart of setTailEnd - the returned object can be passed back as is)
getTailEnd(): Promise<LineEnd | null>;
Returns
Promise<LineEnd | null> - End arrow settings. null if the target connector is gone. No arrow is not null but an object whose type is LineEndType.NONE
getTransform()
Returns the position, size, and rotation of the shape. x/y are the top-left corner of the shape regardless of flip, so passing the returned value to another shape's setTransform places both shapes at the same spot. Values are rounded to the editor's input units - size to one decimal place, position to integers. The setters use the same units, so shapes placed more finely (e.g. imported documents) move by that amount when the value is passed back.
getTransform(): Promise<ShapeTransform | null>;
Returns
Promise<ShapeTransform | null> - Position, size, and rotation of the shape. null if the target shape is gone (e.g. deleted during collaboration)
getWidth()
Returns the shape's width. (Symmetric with setWidth.)
getWidth(): Promise<number | null>;
Returns
Promise<number | null> - Width (px). null if the target shape is gone
getX()
Returns the shape's X coordinate. (Symmetric with setX.)
getX(): Promise<number | null>;
Returns
Promise<number | null> - X coordinate (px). null if the target shape is gone
getY()
Returns the shape's Y coordinate. (Symmetric with setY.)
getY(): Promise<number | null>;
Returns
Promise<number | null> - Y coordinate (px). null if the target shape is gone
getZOrderIndex()
Returns the z-order index of the shape within its parent (the slide, or the group for a group child). 0 is the back; larger values are further to the front.
getZOrderIndex(): Promise<number | null>;
Returns
Promise<number | null> - z-order index. null if the target shape is gone
hasText()
Returns whether the shape contains text. Uses the same criterion the editor uses for empty text - true when there is only whitespace or two or more empty paragraphs (only line breaks), false when there is a single empty paragraph. Kinds without shape-level text (table, group, chart) are always false. (query tables per cell)
hasText(): Promise<boolean | null>;
Returns
Promise<boolean | null> - Whether text exists. null if the target shape is gone
isChart()
Checks whether this handle is a Chart (a type guard for union narrowing). Synchronously inspects the SDK handle's internal discriminator - no postMessage round trip, no await needed.
isChart(): Promise<this is Chart>;
Returns
Promise<this is Chart>
isControl()
Checks whether this handle is a Control (a type guard for union narrowing). Synchronously inspects the SDK handle's internal discriminator - no postMessage round trip, no await needed.
isControl(): Promise<this is Control>;
Returns
Promise<this is Control>
isDiagram()
Checks whether this handle is a Diagram (a type guard for union narrowing). Synchronously inspects the SDK handle's internal discriminator - no postMessage round trip, no await needed.
isDiagram(): Promise<this is Diagram>;
Returns
Promise<this is Diagram>
isFlippedH()
Returns whether the shape is flipped horizontally. (calling flip(FlipDirection.HORIZONTAL) toggles this value)
isFlippedH(): Promise<boolean | null>;
Returns
Promise<boolean | null> - Horizontal flip state. null if the target shape is gone
isFlippedV()
Returns whether the shape is flipped vertically. (calling flip(FlipDirection.VERTICAL) toggles this value)
isFlippedV(): Promise<boolean | null>;
Returns
Promise<boolean | null> - Vertical flip state. null if the target shape is gone
isGroup()
Checks whether this handle is a Group (a type guard for union narrowing). Synchronously inspects the SDK handle's internal discriminator - no postMessage round trip, no await needed.
isGroup(): Promise<this is Group>;
Returns
Promise<this is Group>
isImage()
Checks whether this handle is an Image (a type guard for union narrowing). Synchronously inspects the SDK handle's internal discriminator - no postMessage round trip, no await needed.
isImage(): Promise<this is Image>;
Returns
Promise<this is Image>
isLine()
Checks whether this handle is a Line (a type guard for union narrowing). Synchronously inspects the SDK handle's internal discriminator - no postMessage round trip, no await needed.
isLine(): Promise<this is Line>;
Returns
Promise<this is Line>
isOleObject()
Checks whether this handle is an OleObject (a type guard for union narrowing). Synchronously inspects the SDK handle's internal discriminator - no postMessage round trip, no await needed.
isOleObject(): Promise<this is OleObject>;
Returns
Promise<this is OleObject>
isPlaceholder()
Returns whether the shape is a placeholder (title, body frame, etc.).
isPlaceholder(): Promise<boolean | null>;
Returns
Promise<boolean | null> - Placeholder state. null if the target shape is gone
isShape()
Checks whether this handle is a Shape (a type guard for union narrowing). Synchronously inspects the SDK handle's internal discriminator - no postMessage round trip, no await needed.
isShape(): Promise<this is Shape>;
Returns
Promise<this is Shape>
isTable()
Checks whether this handle is a Table (a type guard for union narrowing). Synchronously inspects the SDK handle's internal discriminator - no postMessage round trip, no await needed.
isTable(): Promise<this is Table>;
Returns
Promise<this is Table>
moveBy(distance)
Moves the shape by x, y relative to its current position. (Absolute placement is setX / setY.)
moveBy(distance: ShapeMoveDistance): Promise<void>;
Parameters
| Name | Type | Description |
|---|---|---|
distance | ShapeMoveDistance | Distance to move (px) |
Returns
Promise<void>
remove3d()
Removes the shape's 3D effect.
remove3d(): Promise<void>;
Returns
Promise<void>
removeEffect(effectType)
Removes an effect. Does nothing if that effect is not applied. Only effects the shape holds directly are removed - effects inherited from the shape style (effectRef) cannot be removed, so getEffects() may report an effect that this call leaves untouched.
removeEffect(effectType: EffectType): Promise<void>;
Parameters
| Name | Type | Description |
|---|---|---|
effectType | EffectType | Effect type to remove |
Returns
Promise<void>
removeFill()
Removes the fill (noFill).
removeFill(): Promise<void>;
Returns
Promise<void>
removeHyperlink()
Removes the shape's hyperlink.
removeHyperlink(): Promise<void>;
Returns
Promise<void>
removeLineColor()
Removes the line color (noFill).
removeLineColor(): Promise<void>;
Returns
Promise<void>
reorder(order)
Changes the shape's z-order (forward/backward). Ignored if it is already at the target position.
reorder(order: ShapeZOrder): Promise<void>;
Parameters
| Name | Type | Description |
|---|---|---|
order | ShapeZOrder | Reorder type |
Returns
Promise<void>
set3d(scene3d, sp3d)
Applies a 3D effect to the shape. An omitted scene3d or sp3d argument is not applied.
set3d(scene3d?: Scene3d, sp3d?: Sp3d): Promise<void>;
Parameters
| Name | Type | Description |
|---|---|---|
scene3d (optional) | Scene3d | Camera (rotation) settings. Not applied when omitted |
sp3d (optional) | Sp3d | Extrusion (depth) settings. Not applied when omitted |
Returns
Promise<void>
setEffects(effects)
Applies an effects object returned by getEffects() as is. (counterpart of getEffects - copies effects shape to shape) Only the included effect keys are applied through the matching setters; scene3d/sp3d are passed to set3d together. Existing effects on the target are not cleared - for an exact copy, remove them first with removeEffect/remove3d. Passing both outerShadow and innerShadow is not rejected; they are applied in order and only the later one remains.
setEffects(effects?: Effects): Promise<void>;
Parameters
| Name | Type | Description |
|---|---|---|
effects (optional) | Effects | Value returned by getEffects(). Changes nothing when omitted |
Returns
Promise<void>
setFill(fill)
Applies a fill object returned by getFill() as is. (counterpart of getFill - copies a fill shape to shape) image reuses the embed from the query result, so it is restored only within the same document. An image without embed has no picture to apply and is rejected (use setImageFill for a new image).
setFill(fill?: Fill): Promise<void>;
Parameters
| Name | Type | Description |
|---|---|---|
fill (optional) | Fill | Value returned by getFill(). Changes nothing when omitted |
Returns
Promise<void>
setGlow(glow)
Applies a glow effect. (counterpart of getEffects().glow - the returned object can be passed back as is) Omitted fields are filled with defaults (see Glow for per-field defaults).
setGlow(glow?: Glow): Promise<void>;
Parameters
| Name | Type | Description |
|---|---|---|
glow (optional) | Glow | Glow settings |
Returns
Promise<void>
setGradientFill(type, stops, angle)
Sets a gradient fill.
setGradientFill(
type?: GradientType,
stops?: { color: string; pos?: number; alpha?: number }[],
angle?: number
): Promise<void>;
Parameters
| Name | Type | Description |
|---|---|---|
type (optional) | GradientType | Gradient type (lin/circle/rect/shape) (default: GradientType.LINEAR) |
stops (optional) | { color: string; pos?: number; alpha?: number }[] | Color stops. Distributed evenly when pos is omitted; alpha is transparency (0–100, 0 = opaque) (default: [{ color: "accent1", pos: 0 }, { color: "bg1", pos: 100 }]) |
angle (optional) | number | Gradient angle (used only for lin) (default: 45) |
Returns
Promise<void>
setHeadEnd(lineEnd)
Sets the connector's start arrow (headEnd). (counterpart of getHeadEnd - the returned object can be passed back as is) To remove the arrow, pass LineEndType.NONE as type. When width/length are omitted, the default (MEDIUM) is applied rather than the current size.
setHeadEnd(lineEnd: Partial<LineEnd> & {type: LineEndType}): Promise<void>;
Parameters
| Name | Type | Description |
|---|---|---|
lineEnd | Partial<LineEnd> & {type: LineEndType} | Arrow settings |
Returns
Promise<void>
setHeight(height)
Sets the height of the shape. Ignored for shapes that cannot be resized.
setHeight(height: number): Promise<void>;
Parameters
| Name | Type | Description |
|---|---|---|
height | number | Height (px, rounded to one decimal place) |
Returns
Promise<void>
setHyperlink(hyperlink)
Sets a hyperlink on the shape (symmetric with getHyperlink - the returned object can be passed back to copy a hyperlink). An unsupported kind or an invalid target, such as a deleted slide, is ignored.
setHyperlink(hyperlink: Hyperlink): Promise<void>;
Parameters
| Name | Type | Description |
|---|---|---|
hyperlink | Hyperlink | The same Hyperlink object as returned by getHyperlink(). Ignored if type is missing |
Returns
Promise<void>
setImageFill(imageUrl, fillMode, alpha, detail)
Sets an image fill.
setImageFill(
imageUrl: string,
fillMode?: ImageFillMode,
alpha?: number,
detail?: ImageFillDetail
): Promise<void>;
Parameters
| Name | Type | Description |
|---|---|---|
imageUrl | string | Image URL |
fillMode (optional) | ImageFillMode | Image fill mode (default: ImageFillMode.STRETCH) |
alpha (optional) | number | Transparency (0–100, 0 = opaque) (default: 0) |
detail (optional) | ImageFillDetail | Detail options. offset/scale/mirror/align apply only when fillMode = ImageFillMode.TILE (default: {}) |
Returns
Promise<void> - Resolves once the image is uploaded and the fill is applied. Rejects with SHAPE_NOT_FOUND if the target shape is gone (including deletion during upload)
setInnerShadow(shadow)
Applies an inner shadow. (counterpart of getEffects().innerShadow - the returned object can be passed back as is) Omitted fields are filled with defaults (see InnerShadow for per-field defaults). A shape has one shadow - an existing outer shadow is replaced by the inner shadow.
setInnerShadow(shadow?: InnerShadow): Promise<void>;
Parameters
| Name | Type | Description |
|---|---|---|
shadow (optional) | InnerShadow | Shadow settings |
Returns
Promise<void>
setLineCap(lineCap)
Sets the line cap.
setLineCap(lineCap: LineCap): Promise<void>;
Parameters
| Name | Type | Description |
|---|---|---|
lineCap | LineCap | Line cap |
Returns
Promise<void>
setLineColor(color, alpha)
Sets the line color.
setLineColor(color: string, alpha?: number): Promise<void>;
Parameters
| Name | Type | Description |
|---|---|---|
color | string | hex (#RRGGBB) or scheme color |
alpha (optional) | number | Transparency (0–100, 0 = opaque). Stored to three decimal places (default: keeps the current value) |
Returns
Promise<void>
setLineDash(lineDash)
Sets the line style (dash).
setLineDash(lineDash: LineDash): Promise<void>;
Parameters
| Name | Type | Description |
|---|---|---|
lineDash | LineDash | Line dash style |
Returns
Promise<void>
setLineGradient(type, stops, angle)
Sets a gradient fill on the line (border).
setLineGradient(
type?: GradientType,
stops?: { color: string; pos?: number; alpha?: number }[],
angle?: number
): Promise<void>;
Parameters
| Name | Type | Description |
|---|---|---|
type (optional) | GradientType | Gradient type (lin/circle/rect/shape) (default: GradientType.LINEAR) |
stops (optional) | { color: string; pos?: number; alpha?: number }[] | Color stops. Distributed evenly when pos is omitted; alpha is transparency (0–100, 0 = opaque) (default: [{ color: "accent1", pos: 0 }, { color: "bg1", pos: 100 }]) |
angle (optional) | number | Gradient angle (used only for lin) (default: 45) |
Returns
Promise<void>
setLineJoin(lineJoin)
Sets the line join type.
setLineJoin(lineJoin: LineJoin): Promise<void>;
Parameters
| Name | Type | Description |
|---|---|---|
lineJoin | LineJoin | Line join (corner) type |
Returns
Promise<void>
setLineStyle(style)
Applies a line-style object returned by getLineStyle() as-is (symmetric with getLineStyle - shape-to-shape line copy).
setLineStyle(style?: LineStyle): Promise<void>;
Parameters
| Name | Type | Description |
|---|---|---|
style (optional) | LineStyle | Value returned by getLineStyle(). Changes nothing when omitted |
Returns
Promise<void>
setLineWidth(lineWidth)
Sets the line width.
setLineWidth(lineWidth: number): Promise<void>;
Parameters
| Name | Type | Description |
|---|---|---|
lineWidth | number | Line width (pt) |
Returns
Promise<void>
setOuterShadow(shadow)
Applies an outer shadow. (counterpart of getEffects().outerShadow - the returned object can be passed back as is) Omitted fields are filled with defaults (see OuterShadow for per-field defaults). A shape has one shadow - an existing inner shadow is replaced by the outer shadow.
setOuterShadow(shadow?: OuterShadow): Promise<void>;
Parameters
| Name | Type | Description |
|---|---|---|
shadow (optional) | OuterShadow | Shadow settings |
Returns
Promise<void>
setPatternFill(preset, foreColor, backColor, foreAlpha, backAlpha)
Sets a pattern fill. (round-trip counterpart of getFill)
setPatternFill(
preset: PatternPreset,
foreColor?: string,
backColor?: string,
foreAlpha?: number,
backAlpha?: number
): Promise<void>;
Parameters
| Name | Type | Description |
|---|---|---|
preset | PatternPreset | Pattern preset (apiConstants.PatternPreset) |
foreColor (optional) | string | Foreground color hex (#RRGGBB) or scheme color (defaults to theme accent 1) (default: "accent1") |
backColor (optional) | string | Background color hex (#RRGGBB) or scheme color (defaults to theme background 1) (default: "bg1") |
foreAlpha (optional) | number | Foreground transparency (0–100, 0 = opaque) (default: 0) |
backAlpha (optional) | number | Background transparency (0–100, 0 = opaque) (default: 0) |
Returns
Promise<void>
setReflection(reflection)
Applies a reflection effect. (counterpart of getEffects().reflection - the returned object can be passed back as is) Omitted fields are filled with defaults (see Reflection for per-field defaults).
setReflection(reflection?: Reflection): Promise<void>;
Parameters
| Name | Type | Description |
|---|---|---|
reflection (optional) | Reflection | Reflection settings |
Returns
Promise<void>
setRotation(rotation)
Sets the rotation angle of the shape as an absolute value. Ignored for shapes that cannot be rotated. (counterpart of getRotation)
setRotation(rotation: number): Promise<void>;
Parameters
| Name | Type | Description |
|---|---|---|
rotation | number | Rotation angle (degrees) |
Returns
Promise<void>
setSoftEdge(softEdge)
Applies a soft edge effect. (counterpart of getEffects().softEdge - the returned object can be passed back as is) Omitted fields are filled with defaults (see SoftEdge for per-field defaults).
setSoftEdge(softEdge?: SoftEdge): Promise<void>;
Parameters
| Name | Type | Description |
|---|---|---|
softEdge (optional) | SoftEdge | Soft edge settings |
Returns
Promise<void>
setSolidFill(color, alpha)
Sets the shape fill to a solid color.
setSolidFill(color: string, alpha?: number): Promise<void>;
Parameters
| Name | Type | Description |
|---|---|---|
color | string | hex (#RRGGBB) or scheme color |
alpha (optional) | number | Transparency (0–100, 0 = opaque). Stored to three decimal places (default: keeps the current value) |
Returns
Promise<void>
setTailEnd(lineEnd)
Sets the connector's end arrow (tailEnd). (counterpart of getTailEnd - the returned object can be passed back as is) To remove the arrow, pass LineEndType.NONE as type. When width/length are omitted, the default (MEDIUM) is applied rather than the current size.
setTailEnd(lineEnd: Partial<LineEnd> & {type: LineEndType}): Promise<void>;
Parameters
| Name | Type | Description |
|---|---|---|
lineEnd | Partial<LineEnd> & {type: LineEndType} | Arrow settings |
Returns
Promise<void>
setTransform(transform)
Sets the position, size, and rotation of the shape in one call. The value returned by getTransform() can be passed as is. (counterpart of getTransform) Only the fields given a value are applied, in the order size → position → rotation; omitted fields keep their current value. As with the individual setters, each field is ignored on shapes that do not support that operation (resize/move/rotate).
setTransform(transform?: Partial<ShapeTransform>): Promise<void>;
Parameters
| Name | Type | Description |
|---|---|---|
transform (optional) | Partial<ShapeTransform> | Position/size (px) · rotation (degrees) |
Returns
Promise<void>
setWidth(width)
Sets the width of the shape. Ignored for shapes that cannot be resized.
setWidth(width: number): Promise<void>;
Parameters
| Name | Type | Description |
|---|---|---|
width | number | Width (px, rounded to one decimal place) |
Returns
Promise<void>
setX(x)
Sets the X coordinate of the shape as an absolute value. Ignored for shapes that cannot be moved. (use moveBy for a relative move)
setX(x: number): Promise<void>;
Parameters
| Name | Type | Description |
|---|---|---|
x | number | X coordinate (px, rounded to an integer) |
Returns
Promise<void>
setY(y)
Sets the Y coordinate of the shape as an absolute value. Ignored for shapes that cannot be moved.
setY(y: number): Promise<void>;
Parameters
| Name | Type | Description |
|---|---|---|
y | number | Y coordinate (px, rounded to an integer) |
Returns
Promise<void>