diff --git a/web/epiphany-graph-viewer/src/lib/EpiphanyGraphViewer.tsx b/web/epiphany-graph-viewer/src/lib/EpiphanyGraphViewer.tsx index e42e034..2fb1270 100644 --- a/web/epiphany-graph-viewer/src/lib/EpiphanyGraphViewer.tsx +++ b/web/epiphany-graph-viewer/src/lib/EpiphanyGraphViewer.tsx @@ -90,6 +90,7 @@ type AdaptiveSimulationBudget = { const PANEL_SURFACE = "rgba(7, 16, 30, 0.76)"; const PANEL_BORDER = "1px solid rgba(148, 163, 184, 0.18)"; +const VIEWPORT_FLIGHT_DURATION_OPTIONS = [1000, 3000] as const; export function EpiphanyGraphViewer({ state, @@ -127,6 +128,7 @@ export function EpiphanyGraphViewer({ const [status, setStatus] = useState<"loading" | "ready" | "error">("loading"); const [errorMessage, setErrorMessage] = useState(null); const [viewportSize, setViewportSize] = useState({ width: 0, height: 0 }); + const [viewportFlightDurationMs, setViewportFlightDurationMs] = useState(3000); const [transforms, setTransforms] = useState>({ architecture: { x: 0, y: 0, scale: 1, userMoved: false }, dataflow: { x: 0, y: 0, scale: 1, userMoved: false }, @@ -566,6 +568,7 @@ export function EpiphanyGraphViewer({ mode: selectionFocusMode, viewportWidth: viewportSize.width, viewportHeight: viewportSize.height, + durationMs: viewportFlightDurationMs, startTransform: wheelStateRef.current.transforms[activeGraphKey], }, viewportFlightRef, @@ -614,6 +617,7 @@ export function EpiphanyGraphViewer({ onViewportTargetComplete, selectedNode, selectionFocusMode, + viewportFlightDurationMs, viewportSize.height, viewportSize.width, ]); @@ -714,6 +718,40 @@ export function EpiphanyGraphViewer({
+ nudgeZoom(activeGraphKey, 1.18, transforms, commitViewTransform)}>+ nudgeZoom(activeGraphKey, 1 / 1.18, transforms, commitViewTransform)}>- , @@ -2142,7 +2181,7 @@ function startViewportFlight( options.viewportHeight, ); const startTime = globalThis.performance.now(); - const durationMs = 3000; + const durationMs = clamp(options.durationMs, 250, 8000); const step = (time: number) => { if (!flightRef.current || flightRef.current.id !== flightId) {