Skip to main content

Class: DragState

Encapsulate logic for dragging mechanism. Right now only nodes are supposed to be dragged.

Constructors

constructor

new DragState(selectionState, callbacks)

Parameters

NameType
selectionStateSelectionState
callbacksCallbacks

Accessors

isActive

get isActive(): boolean

Returns

boolean

Methods

dragBy

dragBy(delta): void

Drag by a difference between previous coordinate and current

Parameters

NameTypeDescription
deltaPointvector to drag by which takes into account diagram zoom

Returns

void


startDragging

startDragging(nodeToDrag): boolean

Parameters

NameType
nodeToDragNodeState

Returns

boolean


stopDragging

stopDragging(): void

Returns

void