From 7956ed3adbce5f184e4c7e87f4534c5aa92fc297 Mon Sep 17 00:00:00 2001 From: Scobiform Date: Sat, 20 Apr 2024 18:32:54 +0200 Subject: [PATCH] Adjust d3 forces #15 --- templates/graph.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/graph.html b/templates/graph.html index 9335efa..124f14d 100644 --- a/templates/graph.html +++ b/templates/graph.html @@ -275,7 +275,7 @@ // # Add forces to the graph // Dynamic collision radius based on node type - Graph.d3Force('collide', d3.forceCollide().radius(node => node.type === 'instance' ? 60 : 42)) + Graph.d3Force('collide', d3.forceCollide().radius(node => node.type === 'instance' ? instanceSizeMultiplier : avatarSizeMultiplier / 2 + 7 * Math.sqrt(node.connectionCount)) // Increased repulsive force .d3Force('charge', d3.forceManyBody().strength(-42000)) // Increased distance and adjusted strength for links