Overview
The WeavePolygonToolAction class allows users to place a polygon node on the canvas by clicking or touching it.
The shape is selected via a preset — one of the six built-in polygon definitions shipped
with the SDK. The preset can be set at construction time, changed programmatically, or
overridden per-trigger via the presetId trigger parameter.
Each interaction results in the creation of a WeavePolygonNode, added to the shared state and synchronized across all users.
The class extends the WeaveAction class.
Trigger parameters
type WeavePolygonToolActionTriggerParams = {
presetId?: string;
};
| Property | Type | Required | Description |
|---|---|---|---|
|
|
Override the active preset ID for this trigger invocation. |
Events
| Event | Payload | Description |
|---|---|---|
|
|
Fired when the action enters the adding state (user is about to place the polygon). |
|
|
Fired after the polygon node has been placed on the canvas. |