Question

I am trying to use and understand the D3 visualization library (http://mbostock.github.com/d3/), and I am looking at their force directed code and it seems they are using a quadtree to calculate the force on a particle. The code is

      var k = kc * quad.count * dn * dn;
      node.px -= dx * k;
      node.py -= dy * k;

where it seems thay quad.count is the number of particles in the quadtree node. But looking at their quadtree code in https://github.com/mbostock/d3/blob/master/d3.geom.js#L696, I can't find any reference to count, and how it is being calculated. I ask because I want to modify some things to perhaps change the "weight" or "charge" of each node.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top