move code around
This commit is contained in:
parent
1effc65b00
commit
b5c8f9b6bc
|
@ -129,6 +129,8 @@ var force = d3.layout.force()
|
||||||
.friction(0.75)
|
.friction(0.75)
|
||||||
.theta(0.1)
|
.theta(0.1)
|
||||||
.size([w, h])
|
.size([w, h])
|
||||||
|
.linkDistance(function (d) { return d.distance; })
|
||||||
|
.linkStrength(function (d) { return d.strength; })
|
||||||
|
|
||||||
force.on("tick", function() {
|
force.on("tick", function() {
|
||||||
var size = force.size()
|
var size = force.size()
|
||||||
|
@ -175,9 +177,6 @@ force.on("tick", function() {
|
||||||
var data
|
var data
|
||||||
|
|
||||||
d3.json("nodes.json", function(json) {
|
d3.json("nodes.json", function(json) {
|
||||||
force.linkDistance(function (d) { return d.distance; })
|
|
||||||
.linkStrength(function (d) { return d.strength; })
|
|
||||||
|
|
||||||
json.links.forEach(function(d) {
|
json.links.forEach(function(d) {
|
||||||
var node, other
|
var node, other
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue