ws.smartArt
WorksheetSmartArt
18 methods
add
→ Promise<string>add(config: SmartArtConfig): Promise<string>;| Parameter | Type | Required |
|---|---|---|
| config | SmartArtConfig | required |
Add a SmartArt diagram to the sheet. Returns the object ID.
get
→ Promise<SmartArtDiagram | null>get(objectId: string): Promise<SmartArtDiagram | null>;| Parameter | Type | Required |
|---|---|---|
| objectId | string | required |
Get a SmartArt diagram by object ID, or null if not found.
remove
→ Promise<void>remove(objectId: string): Promise<void>;| Parameter | Type | Required |
|---|---|---|
| objectId | string | required |
Remove a SmartArt diagram by object ID.
list
→ Promise<SmartArtDiagram[]>list(): Promise<SmartArtDiagram[]>;List all SmartArt diagrams on the sheet.
duplicate
→ Promise<string>duplicate(objectId: string): Promise<string>;| Parameter | Type | Required |
|---|---|---|
| objectId | string | required |
Duplicate a SmartArt diagram. Returns the new object ID.
addNode
→ NodeId | Promise<NodeId>addNode(
objectId: string,
text: string,
position: NodePosition,
referenceNodeId: NodeId | null,
): NodeId | Promise<NodeId>;| Parameter | Type | Required |
|---|---|---|
| objectId | string | required |
| text | string | required |
| position | NodePosition | required |
| referenceNodeId | NodeId | null | required |
Add a node to a diagram. Returns the new node ID.
removeNode
→ void | Promise<void>removeNode(objectId: string, nodeId: NodeId): void | Promise<void>;| Parameter | Type | Required |
|---|---|---|
| objectId | string | required |
| nodeId | NodeId | required |
Remove a node from a diagram.
updateNode
→ void | Promise<void>updateNode(
objectId: string,
nodeId: NodeId,
updates: Partial<SmartArtNode>,
): void | Promise<void>;| Parameter | Type | Required |
|---|---|---|
| objectId | string | required |
| nodeId | NodeId | required |
| updates | Partial<SmartArtNode> | required |
Update a node's properties.
moveNode
→ void | Promise<void>moveNode(objectId: string, nodeId: NodeId, direction: NodeMoveDirection): void | Promise<void>;| Parameter | Type | Required |
|---|---|---|
| objectId | string | required |
| nodeId | NodeId | required |
| direction | NodeMoveDirection | required |
Move a node in the hierarchy.
getNode
→ SmartArtNode | undefined | Promise<SmartArtNode | undefined>getNode(
objectId: string,
nodeId: NodeId,
): SmartArtNode | undefined | Promise<SmartArtNode | undefined>;| Parameter | Type | Required |
|---|---|---|
| objectId | string | required |
| nodeId | NodeId | required |
Get a node by ID.
getDiagram
→ SmartArtDiagram | undefined | Promise<SmartArtDiagram | undefined>getDiagram(objectId: string): SmartArtDiagram | undefined | Promise<SmartArtDiagram | undefined>;| Parameter | Type | Required |
|---|---|---|
| objectId | string | required |
Get a diagram by object ID.
getDiagramsOnSheet
→ SmartArtDiagram[] | Promise<SmartArtDiagram[]>getDiagramsOnSheet(): SmartArtDiagram[] | Promise<SmartArtDiagram[]>;Get all diagrams on this sheet.
changeLayout
→ void | Promise<void>changeLayout(objectId: string, newLayoutId: string): void | Promise<void>;| Parameter | Type | Required |
|---|---|---|
| objectId | string | required |
| newLayoutId | string | required |
Change the diagram layout.
changeQuickStyle
→ void | Promise<void>changeQuickStyle(objectId: string, quickStyleId: string): void | Promise<void>;| Parameter | Type | Required |
|---|---|---|
| objectId | string | required |
| quickStyleId | string | required |
Change the quick style.
changeColorTheme
→ void | Promise<void>changeColorTheme(objectId: string, colorThemeId: string): void | Promise<void>;| Parameter | Type | Required |
|---|---|---|
| objectId | string | required |
| colorThemeId | string | required |
Change the color theme.
getComputedLayout
→ ComputedLayout | undefined | Promise<ComputedLayout | undefined>getComputedLayout(
objectId: string,
): ComputedLayout | undefined | Promise<ComputedLayout | undefined>;| Parameter | Type | Required |
|---|---|---|
| objectId | string | required |
Get the computed layout for a diagram. Returns cached result if valid.
invalidateLayout
→ voidinvalidateLayout(objectId: string): void;| Parameter | Type | Required |
|---|---|---|
| objectId | string | required |
Invalidate the cached layout for a diagram.
invalidateAllLayouts
→ voidinvalidateAllLayouts(): void;Invalidate all cached layouts.