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 a0b014c commit d325ac2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions templates/graph.html
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@
.distance(link => {
// Optionally adjust link distances based on node attributes if required
if (link.type === 'instance') return 4200 + 5 * Math.sqrt(link.source.connectionCount);
else if (link.type === 'user') return 14000 + 2 * Math.sqrt(link.source.followerCount);
else if (link.type === 'followers') return 2100 + 2 * Math.sqrt(link.source.followerCount);
else if (link.type === 'followings') return 1400 + 2 * Math.sqrt(link.source.followerCount);
else return 10000; // Default distance for other or undefined types
Expand Down

0 comments on commit d325ac2

Please sign in to comment.