From b5c8f9b6bc062d1a672e4f147ba64ef5eecf489e Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Wed, 6 Jun 2012 03:28:35 +0200 Subject: [PATCH] move code around --- html/force.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/html/force.js b/html/force.js index d37654b..962efa8 100644 --- a/html/force.js +++ b/html/force.js @@ -129,6 +129,8 @@ var force = d3.layout.force() .friction(0.75) .theta(0.1) .size([w, h]) + .linkDistance(function (d) { return d.distance; }) + .linkStrength(function (d) { return d.strength; }) force.on("tick", function() { var size = force.size() @@ -175,9 +177,6 @@ force.on("tick", function() { var data d3.json("nodes.json", function(json) { - force.linkDistance(function (d) { return d.distance; }) - .linkStrength(function (d) { return d.strength; }) - json.links.forEach(function(d) { var node, other