feat(FN-4129): add wheel pan and modifier-key zoom to dependency graph

Adds wheel-based panning to the dependency graph plugin, separating pan behavior from zoom when the wheel event is horizontal or un修饰, with new tests covering both interactions and updated graph interaction documentation in the plugin README.

Fusion-Task-Id: FN-4129
This commit is contained in:
Fusion
2026-05-12 12:14:09 -07:00
committed by gsxdsm
parent 3d6edb409b
commit db60a65884
5 changed files with 99 additions and 4 deletions

View File

@@ -254,6 +254,15 @@ export function useGraphInteraction() {
}
}, []);
const onWheelPan = useCallback((deltaX: number, deltaY: number, viewportWidth: number, viewportHeight: number) => {
setAnimate(false);
const nextPan = {
x: panRef.current.x - deltaX,
y: panRef.current.y - deltaY,
};
setPan(clampPan(nextPan, viewportWidth, viewportHeight));
}, [clampPan, setAnimate]);
const onWheelZoom = useCallback((
deltaY: number,
point: PointerPoint,
@@ -325,6 +334,7 @@ export function useGraphInteraction() {
onPointerDown,
onPointerMove,
onPointerUp,
onWheelPan,
onWheelZoom,
handleKeyDown,
setGraphBounds,