From 6ab7e6516bd652aebd2a5d476253bcb198be127a Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Tue, 9 Jul 2024 10:42:23 +0200 Subject: [PATCH] Link distance and node radius updates --- dist/workers/graph.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/workers/graph.js b/dist/workers/graph.js index 486a559bdb..786d4bd419 100644 --- a/dist/workers/graph.js +++ b/dist/workers/graph.js @@ -172,7 +172,7 @@ initForces = () => { simulation.force('link') .links(edges) .distance(link.distance) - .strength(d => d.source.layout == d.target.layout ? 1 : 0.5); + .strength(d => d.source.type == d.target.type ? 1 : 0.5); simulation.force('forceX') .strength(d => d.isOrphan ? forceX.strength : 0) @@ -802,7 +802,7 @@ const getRadius = (d) => { maxEdges = Math.max(maxEdges, e); if (maxEdges > 0) { - k += e / maxEdges; + k += Math.min(1, e / maxEdges); }; return d.radius / transform.k * k;