Skip to content

Commit

Permalink
Adjust d3 forces #15
Browse files Browse the repository at this point in the history
  • Loading branch information
Scobiform committed Apr 20, 2024
1 parent 6956d99 commit c0402c0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion templates/graph.html
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,10 @@
// # Add forces to the graph
// Dynamic collision radius based on node type
Graph.d3Force('collide', d3.forceCollide().radius(node => {
return node.type === 'instance' ? instanceSizeMultiplier : avatarSizeMultiplier / 2 + 7 * Math.sqrt(node.connectionCount);
if (node.type === 'instance') {
return instanceSizeMultiplier;
}
return avatarSizeMultiplier / 2 + 7 * Math.sqrt(node.connectionCount);
}))
// Increased charge strength for better separation
.d3Force('charge', d3.forceManyBody().strength(-42000))
Expand Down

0 comments on commit c0402c0

Please sign in to comment.