I can’t understand why I get this error for the life of me (using the power layout). It started when I switched to reading my nodes from a json file. If I uncomment the lines below, this will not result in an error. If I stay as it is, I get "Can't call the push method from undefined." I am not sure what the problem is. Did I miss something?
<html>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<script>
d3.json("http://katejustin.com/autosys1.json", function(data) {
var width = 200,
height = 200;
var svg = d3.select("body").append("svg:svg")
.attr("width", width)
.attr("height", height);
var force = d3.layout.force()
.nodes(data.nodes)
.links(data.links)
.size([width, height])
.distance(100)
.charge(-1000)
.start();
});
</script>
</html>
source
share