fix(graphrag): graph view rendered blank — measure container after load

The ResizeObserver/size effect ran once on mount with [] deps while loading=true, so containerRef was null (the graph container isn't in the DOM yet) and size.width stayed 0, gating out ForceGraph2D (blank canvas) even though the data loaded. Re-run the measure effect on [loading, data.nodes.length] so it attaches + measures once the container actually mounts.
This commit is contained in:
Alex committed 2026-06-23 08:46:03 +01:00
1 parent 7e7f34ee9c
commit 91d17694b3
1 file changed
+1 -1
+1 -1
View File
@@ -78,7 +78,7 @@ const GraphView: React.FC<GraphViewProps> = ({
observer.observe(element);
setSize({ width: element.clientWidth, height: 480 });
return () => observer.disconnect();
}, []);
}, [loading, data.nodes.length]);
const maxNodeDegree = useMemo(() => maxDegree(data.nodes), [data.nodes]);