Overview
The WeaveContextMenuPlugin class that enables custom right-click (context) menus on the canvas. It provides a flexible and modular way to trigger context-aware actions based on where and what the user right-clicks—whether it’s a node, empty space, or selection.
This plugin enhances usability by letting developers define dynamic, context-sensitive options, making the user experience faster, more intuitive, and better organized.
The class extends the WeavePlugin class
TypeScript types
type WeaveStageContextMenuPluginParams = {
config?: WeaveStageContextMenuPluginConfig;
};
type WeaveStageContextMenuPluginConfig = {
xOffset?: number;
yOffset?: number;
};
type WeaveStageContextMenuPluginOnNodeContextMenuEvent = {
selection: WeaveSelection[];
point: Vector2d;
visible: boolean;
};
Parameters
For WeaveStageContextMenuPluginParams:
| Property | Type | Required | Description |
|---|---|---|---|
|
|
Required |
Config parameters for the plugin. |
For WeaveStageContextMenuPluginConfig:
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
|
|
|
X-axis offset of the click point in pixels. |
|
|
|
|
Y-axis offset of the click point in pixes |