tweak force parameters

alfred-data
Nils Schneider 2012-06-12 04:03:48 +02:00
parent 5484c34581
commit 8e9a08d9e1
1 changed files with 12 additions and 7 deletions

View File

@ -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
}
})