From 8e9a08d9e12144d2cc7377c7d11919f9efc4dfaa Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Tue, 12 Jun 2012 04:03:48 +0200 Subject: [PATCH] tweak force parameters --- html/force.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/html/force.js b/html/force.js index cd7379e..a6b2f9e 100644 --- a/html/force.js +++ b/html/force.js @@ -185,23 +185,28 @@ vis.append("g").attr("class", "nodes") var linkedByIndex var force = d3.layout.force() - .charge(-100) - .gravity(0.07) - .friction(0.75) - .theta(0.1) + .charge( function (d) { + if (d.flags.client) + return -30 + + return -200 + }) + .gravity(0.035) + .friction(0.73) + .theta(0.8) .size([w, h]) .linkDistance(function (d) { switch (d.type) { - case "vpn": return 150 + case "vpn": return 200 case "client": return 20 default: return 70 } }) .linkStrength(function (d) { switch (d.type) { - case "vpn": return 0.15 + case "vpn": return 0.05 case "client": return 1 - default: return 0.5 + default: return 0.8 } })