Mike
On Jul 9, 2011, at 9:25 AM, Mike Bostock wrote:
> This is usually the quadtree recursing infinitely because one of the node positions is NaN. We could change the quadtree to ignore these nodes, but that would just cause a different error (the node being positioned in the top-left corner and an SVG parse error). Are you applying any custom forces or initializing node positions?
I can think of two things that we changed.
We added:
.friction(.1)
And in looking to stroke the path and fill it we did this but we only were able to stroke the path. We ended up solving the fill as well but not yet implemented.
Do you think this is where the problem might be?
var node = vis.selectAll("path")
.data(json.nodes)
.enter().append("svg:path")//.append("svg:circle")
.attr("transform", function(d) { return "translate(" + d.x + "," + d.y + ")"; })
.attr("d", d3.svg.symbol()
.size(function(d) { return d.size? d.size :200; })
.type(function(d) { return d.type? d.type:"circle"; }))
.style("fill", function(d) {return d.color? d3.rgb(d.color) :fill(d.group); })
.style("stroke", function(d) {return d.fullAccess?"black":"white";})
.style("stroke-width", function(d) {return d.fullAccess?"2px":"1.5px";})
.call(force.drag);
/* .attr("class", "node")
.attr("cx", function(d) { return d.x; })
.attr("cy", function(d) { return d.y; })
.attr("r", function(d) {return d.size? d.size :5; })
.style("fill", function(d) {return d.color? d3.rgb(d.color) :fill(d.group); })
.call(force.drag); */
Generally, stack overflow errors and quadtrees mean that you're adding an element outside of the quadtree's extent. Are you sure you're calculating the x_scale domain and range correctly, so that all your x values will be within the range you're using for the extent? – AmeliaBR May 8 '14 at 4:41