From 695664913a209333ddf42fdf84ac06ae9cac740d Mon Sep 17 00:00:00 2001 From: Yuri Karamian Date: Mon, 17 Aug 2026 19:28:48 +0200 Subject: [PATCH] fix: make graph state reactive --- src/lib/components/GraphView.svelte | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/components/GraphView.svelte b/src/lib/components/GraphView.svelte index 5191011..dcb5680 100644 --- a/src/lib/components/GraphView.svelte +++ b/src/lib/components/GraphView.svelte @@ -20,12 +20,12 @@ interface GraphEdge { sourceIdx: number; targetIdx: number; bidirectional: boolean; } interface LabelRect { x: number; y: number; w: number; h: number; } - let nodes: GraphNode[] = []; - let edges: GraphEdge[] = []; + let nodes = $state.raw([]); + let edges = $state.raw([]); let nodeIndexMap: Map = new Map(); let connectedSet: Set = new Set(); let nodeDegree: number[] = []; - let searchMatchSet: Set | null = null; + let searchMatchSet = $state.raw | null>(null); let folderColorMap = new Map(); let pan = { x: 0, y: 0 }; @@ -40,7 +40,7 @@ let hoveredNeighborSet: Set = new Set(); let hoveredEdgeSet: Set = new Set(); let glowPhase = 0; - let activeNodeIdx = -1; + let activeNodeIdx = $state(-1); let navigatedFromGraph = false; // Combined animation loop