Overview
The WeaveAlignNodesToolAction class that allows users to align selected nodes vertically or horizontally.
The class extends the WeaveAction class.
TypeScript types
type WeaveAlignNodesToolActionAlignToKeys = keyof typeof ALIGN_NODES_ALIGN_TO;
type WeaveAlignNodesToolActionAlignTo =
(typeof ALIGN_NODES_ALIGN_TO)[WeaveAlignNodesToolActionAlignToKeys];
type WeaveAlignNodesToolActionTriggerParams = {
alignTo: WeaveAlignNodesToolActionAlignTo;
triggerSelectionTool?: boolean;
};
Constants
const ALIGN_NODES_ALIGN_TO = {
["LEFT_HORIZONTAL"]: "left-horizontal",
["CENTER_HORIZONTAL"]: "center-horizontal",
["RIGHT_HORIZONTAL"]: "right-horizontal",
["TOP_VERTICAL"]: "top-vertical",
["CENTER_VERTICAL"]: "center-vertical",
["BOTTOM_VERTICAL"]: "bottom-vertical",
} as const;
Trigger function params
trigger(cancelAction: () => void, params?: WeaveAlignNodesToolActionTriggerParams): void;
For WeaveAlignNodesToolActionTriggerParams:
| Property | Type | Required | Description |
|---|---|---|---|
|
|
Required |
The alignment value for the nodes. |
|
|
Required |
Indicates if the selection tool needs to be triggered when then tool finishes. |