Service Composition
Key Services
GraphStateManager
Central state container for all rendering-related state. All services read from and write to this single source of truth. Prevents reference bugs during refactoring.OverlayFilterService
Most complex service - handles all visibility filtering:- Node type visibility (hide/show by type)
- Edge type visibility
- Selection depth expansion (BFS algorithm)
- Members-only mode
- Namespace filtering
- Position synchronization between allNodes and graphData
InstancedNodeRenderer
GPU-instanced rendering for performance with large graphs:- Instance matrices for node positions
- Color attributes per instance
- Visibility masking
- Selection highlighting
CameraControlService
Camera manipulation:- Zoom in/out with configurable speed
- Focus on node (fly-to animation)
- Reset view to fit all nodes
- Pan controls
NodeRenderingService
Node visual properties:- Colors based on type or overlay
- Sizes based on type or overlay
- Labels (visibility, size, content)
- Opacity
LinkRenderingService
Edge visual properties:- Colors
- Widths
- Curvature
- Visibility
Service Responsibilities
| Service | Responsibility |
|---|---|
| GraphStateManager | Central state container for all rendering-related state |
| OverlayFilterService | All visibility filtering: type filters, BFS depth, namespace filters |
| InstancedNodeRenderer | GPU-instanced rendering for large graphs |
| CameraControlService | Zoom, pan, focus, reset view |
| NodeRenderingService | Node colors, sizes, labels, opacity |
| LinkRenderingService | Link colors, widths, curvature |
| GraphLifecycleService | Init, resize, destroy, data loading |
| NamespaceForceService | Namespace blob rendering and physics |
File Quick Reference
| Need to… | Look in… |
|---|---|
| Add new UI state | AppContext.jsx |
| Modify selection behavior | App.jsx, SelectionHistoryManager.js |
| Change filtering logic | OverlayFilterService.js |
| Add camera controls | CameraControlService.js |
| Modify node appearance | NodeRenderingService.js, InstancedNodeRenderer.js |
| Add keyboard shortcuts | App.jsx (useEffect with keydown listener) |
| Add toolbar button | Toolbar.jsx or SelectionToolbar.jsx |
| Add API endpoint call | ApiService.js |