I can't figure out why I'm getting this error for the life of me (using a force layout). It started when I switched over to reading my nodes from a json file. If I uncomment the lines below it doesn't throw an error. If I leave as is, I get "Cannot call method 'push' of undefined". I'm not sure what the issue is. Am I missing anything?
<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 nodes = {};
//data.links.forEach(function(link) {
// link.source = nodes[link.source] || (nodes[link.source] = {name: link.source});
// link.target = nodes[link.target] || (nodes[link.target] = {name: link.target}); });
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(d3.values(nodes))
.nodes(data.nodes)
.links(data.links)
.size([width, height])
.distance(100)
.charge(-1000)
.start();
});
</script>
</html>