tweak force parameters
This commit is contained in:
parent
5484c34581
commit
8e9a08d9e1
|
@ -185,23 +185,28 @@ vis.append("g").attr("class", "nodes")
|
||||||
var linkedByIndex
|
var linkedByIndex
|
||||||
|
|
||||||
var force = d3.layout.force()
|
var force = d3.layout.force()
|
||||||
.charge(-100)
|
.charge( function (d) {
|
||||||
.gravity(0.07)
|
if (d.flags.client)
|
||||||
.friction(0.75)
|
return -30
|
||||||
.theta(0.1)
|
|
||||||
|
return -200
|
||||||
|
})
|
||||||
|
.gravity(0.035)
|
||||||
|
.friction(0.73)
|
||||||
|
.theta(0.8)
|
||||||
.size([w, h])
|
.size([w, h])
|
||||||
.linkDistance(function (d) {
|
.linkDistance(function (d) {
|
||||||
switch (d.type) {
|
switch (d.type) {
|
||||||
case "vpn": return 150
|
case "vpn": return 200
|
||||||
case "client": return 20
|
case "client": return 20
|
||||||
default: return 70
|
default: return 70
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.linkStrength(function (d) {
|
.linkStrength(function (d) {
|
||||||
switch (d.type) {
|
switch (d.type) {
|
||||||
case "vpn": return 0.15
|
case "vpn": return 0.05
|
||||||
case "client": return 1
|
case "client": return 1
|
||||||
default: return 0.5
|
default: return 0.8
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue