You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/components/canvas-graph-component.md
+110-1Lines changed: 110 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,7 @@ classDiagram
14
14
GraphComponent <|-- Connection
15
15
GraphComponent -- HitBox
16
16
GraphComponent -- Camera
17
+
GraphComponent -- DragService
17
18
18
19
class EventedComponent {
19
20
+props: TComponentProps
@@ -29,11 +30,15 @@ classDiagram
29
30
+getHitBox()
30
31
+isVisible()
31
32
+onDrag()
33
+
+isDraggable()
34
+
+handleDragStart()
35
+
+handleDrag()
36
+
+handleDragEnd()
32
37
+subscribeSignal()
33
38
}
34
39
```
35
40
36
-
## The Four Core Capabilities
41
+
## The Core Capabilities
37
42
38
43
### 1. Spatial Awareness with HitBox and R-tree
39
44
@@ -187,6 +192,110 @@ onDragUpdate: (diff: {
187
192
- Use `diffX`/`diffY` when you need to calculate position relative to drag start (e.g., `initialPosition + diffX`)
188
193
- Use `deltaX`/`deltaY` when you need frame-to-frame movement (e.g., `currentPosition + deltaX`)
189
194
195
+
### 3.1 DragService Integration
196
+
197
+
For components that need to participate in the centralized drag system (multi-selection drag, autopanning, etc.), GraphComponent provides lifecycle methods that integrate with [DragService](../system/drag-system.md).
198
+
199
+
> **Note:** The `onDrag()` method is for simple, self-contained drag behavior. For components that need to work with multi-selection and the centralized drag system, override the `isDraggable()` and `handleDrag*()` methods instead.
0 commit comments