diff --git a/modules/rnetwork/components/folk-graph-viewer.ts b/modules/rnetwork/components/folk-graph-viewer.ts index a5c12a3..85ab17b 100644 --- a/modules/rnetwork/components/folk-graph-viewer.ts +++ b/modules/rnetwork/components/folk-graph-viewer.ts @@ -983,6 +983,15 @@ class FolkGraphViewer extends HTMLElement { return link.type === "delegates_to" ? 0.15 : 0; }) .linkCurveRotation("rotation") + .linkVisibility((link: any) => { + // Hide links whose endpoints haven't been positioned yet + // (prevents TubeGeometry NaN errors during force warmup) + const s = link.source, t = link.target; + if (!s || !t) return false; + const sx = typeof s === "object" ? s.x : undefined; + const tx = typeof t === "object" ? t.x : undefined; + return sx != null && !isNaN(sx) && tx != null && !isNaN(tx); + }) .linkOpacity(0.6) .linkDirectionalArrowLength((link: GraphEdge) => { if (link.type === "cross_layer_flow") return 3; @@ -1040,7 +1049,7 @@ class FolkGraphViewer extends HTMLElement { }) .d3AlphaDecay(0.02) .d3VelocityDecay(0.3) - .warmupTicks(50) + .warmupTicks(100) .cooldownTicks(150); this.graph = graph;