Class: DragState
Encapsulate logic for dragging mechanism. Right now only nodes are supposed to be dragged.
Constructors
constructor
• new DragState(selectionState, callbacks)
Parameters
| Name | Type |
|---|---|
selectionState | SelectionState |
callbacks | Callbacks |
Accessors
isActive
• get isActive(): boolean
Returns
boolean
Methods
dragBy
▸ dragBy(delta): void
Drag by a difference between previous coordinate and current
Parameters
| Name | Type | Description |
|---|---|---|
delta | Point | vector to drag by which takes into account diagram zoom |
Returns
void
startDragging
▸ startDragging(nodeToDrag): boolean
Parameters
| Name | Type |
|---|---|
nodeToDrag | NodeState |
Returns
boolean
stopDragging
▸ stopDragging(): void
Returns
void