Background: - With many nodes, D3 force simulation tick callback updates all nodes/edges/labels every frame - Original implementation called simulation.restart() in drag start event on mousedown - Even after simulation converged, clicking a node to view details would restart simulation, causing lag Solution: - Distinguish between "click" and "drag" using 3px movement threshold - On drag start: only record initial position, do not restart simulation - On drag event: detect movement exceeding threshold before marking as actual drag and restarting simulation - Pure click operations no longer trigger simulation restart, keeping graph static Bug fix: - Fixed issue where nodes became undraggable after initial optimization - Cause: incorrectly used if(!event.active) check in drag event - event.active equals 1 during drag event, causing restart() to never execute - Removed that condition, using custom _isDragging flag to control logic instead |
||
|---|---|---|
| .. | ||
| api | ||
| assets/logo | ||
| components | ||
| router | ||
| store | ||
| views | ||
| App.vue | ||
| main.js | ||