MiroFish/frontend
666ghj 085aa6bbe6 fix(GraphPanel): optimize force graph drag behavior to prevent simulation restart on click
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
2026-01-18 22:35:24 +08:00
..
public Remove outdated README.md and update favicon in index.html 2025-12-16 20:58:48 +08:00
src fix(GraphPanel): optimize force graph drag behavior to prevent simulation restart on click 2026-01-18 22:35:24 +08:00
.gitignore Add project status report and frontend documentation 2025-12-10 14:49:11 +08:00
index.html Update font styles across the application to include 'Noto Sans SC' for improved typography consistency. 2025-12-26 17:35:09 +08:00
package-lock.json Initialize project with version 0.1.0 and update package configurations 2025-12-18 18:30:29 +08:00
package.json Initialize project with version 0.1.0 and update package configurations 2025-12-18 18:30:29 +08:00
vite.config.js Add project status report and frontend documentation 2025-12-10 14:49:11 +08:00