Overview
The WeaveExportStageToolAction class that enables users to export the entire canvas (Stage) as an image file—typically in PNG format. This action captures everything visible on the canvas, including all nodes, layers, and plugin-rendered visuals, and converts it into a high-fidelity static image.
It’s particularly useful for sharing snapshots, archiving work, or generating thumbnails from collaborative visual tools.
The class extends the WeaveAction class.
TypeScript types
const WEAVE_EXPORT_FORMATS: {
readonly PNG: "image/png";
readonly JPEG: "image/jpeg";
};
type WeaveExportNodeOptions = {
format?: typeof WEAVE_EXPORT_FORMATS.PNG;
padding?: number;
pixelRatio?: number;
backgroundColor?: string;
quality?: number;
};
type WeaveExportStageActionParams = {
boundingNodes?: (nodes: Konva.Node[]) => Konva.Node[];
options?: WeaveExportNodesOptions;
};
Trigger function params
trigger(cancelAction: () => void, params?: WeaveExportStageActionParams): Promise<void>;
For WeaveExportStageActionParams:
| Property | Type | Required | Description |
|---|---|---|---|
|
|
A function that defines the bounding node |
|
|
|
The exported image options. |
For WeaveExportNodeOptions:
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
|
|
Required |
|
The format of the image to export. |
|
|
|
The padding to add to the image to export. In pixels. |
|
|
|
|
The pixel ratio to use on the image to export. For example 2 on a image of 400x400 generates a image of 800x800 pixels. |
|
|
|
|
The background color to use on the image to export. Is a CCS color value. |
|
|
|
|
The quality of the image to export. From 0 to 1. |