Skip to content

ActionStateManager

Internal manager for temporary state during ongoing user actions. Tracks the state of interactive operations like resizing, linking, rotating, and dragging until the action completes.

For application code, use NgDiagramService.actionState signal instead. This class is exposed primarily for middleware development where you can access it via context.actionStateManager.

const middleware: Middleware = {
name: 'resize-validator',
execute: (context, next, cancel) => {
const resizeState = context.actionStateManager.resize;
if (resizeState) {
console.log('Currently resizing node:', resizeState.nodeId);
}
next();
}
};

get copyPaste(): undefined | CopyPasteActionState

Gets the current copy/paste action state.

undefined | CopyPasteActionState

The copy/paste state if a copy/paste operation is in progress, undefined otherwise

set copyPaste(value): void

Sets the copy/paste action state.

The copy/paste state to set, or undefined to clear

undefined | CopyPasteActionState

void


get dragging(): undefined | DraggingActionState

Gets the current dragging action state.

undefined | DraggingActionState

The dragging state if nodes are being dragged, undefined otherwise

set dragging(value): void

Sets the dragging action state.

The dragging state to set, or undefined to clear

undefined | DraggingActionState

void


get highlightGroup(): undefined | HighlightGroupActionState

Gets the current highlight group action state.

undefined | HighlightGroupActionState

The highlight group state if a group is being highlighted, undefined otherwise

set highlightGroup(value): void

Sets the highlight group action state.

The highlight group state to set, or undefined to clear

undefined | HighlightGroupActionState

void


get linking(): undefined | LinkingActionState

Gets the current linking action state.

undefined | LinkingActionState

The linking state if a link is being created, undefined otherwise

set linking(value): void

Sets the linking action state.

The linking state to set, or undefined to clear

undefined | LinkingActionState

void


get resize(): undefined | ResizeActionState

Gets the current resize action state.

undefined | ResizeActionState

The resize state if a resize is in progress, undefined otherwise

set resize(value): void

Sets the resize action state.

The resize state to set, or undefined to clear

undefined | ResizeActionState

void


get rotation(): undefined | RotationActionState

Gets the current rotation action state.

undefined | RotationActionState

The rotation state if a rotation is in progress, undefined otherwise

set rotation(value): void

Sets the rotation action state.

The rotation state to set, or undefined to clear

undefined | RotationActionState

void

clearCopyPaste(): void

Clears the copy/paste action state.

void


clearDragging(): void

Clears the dragging action state.

void


clearHighlightGroup(): void

Clears the highlight group action state.

void


clearLinking(): void

Clears the linking action state.

void


clearResize(): void

Clears the resize action state.

void


clearRotation(): void

Clears the rotation action state.

void


getState(): Readonly<ActionState>

Gets the current action state (readonly).

Readonly<ActionState>

The complete action state object


isDragging(): boolean

Checks if a dragging operation is currently in progress.

boolean


isLinking(): boolean

Checks if a linking operation is currently in progress.

boolean


isResizing(): boolean

Checks if a resize operation is currently in progress.

boolean


isRotating(): boolean

Checks if a rotation operation is currently in progress.

boolean