d3.geom.polygon(…).area() assumes screen pixel coordinates with (0, 0)
at the top left, and y increasing going downwards. This results in a
positive area for counterclockwise coordinates. Howver, the default
centroid calculation was assuming "usual" Cartesian coordinates with y
increasing going upwards, hence the centroid coordinates were
incorrectly multiplied by -1.
This fix won't affect d3.geo.path(…).centroid() as it passes a constant
to d3.geom.centroid.
You can now specify the domain of the quadtree upon construction, such that you
can add points to the quadtree dynamically later. The quadtree example now also
shows how to do a quick rectangular search using the quadtree.
This makes the quadtree implementation more compatible with the force layout.
This change is backwards-compatible; if the points are not specified as x+y
objects, they are assumed to be tuples and converted to objects.
Adds support for contours (d3.geom.contour) and cardinal spline interpolation.
I've extended cardinal spline interpolation to d3.svg.area, and added closed
basis spline interpolation. The spline tension is now set using a named
method, and closed splines can be generated using basis-closed and
cardinal-closed, respectively.
This commit also includes Jeff's nifty clustered force-directed graph example!
The renaming of attributes is totally not worth the hassle of maintaining an
externs file (or using the awkward `foo["bar"]` syntax). The file size
reduction from the advanced optimizations was negligible, besides!