492215ad42
This generalises the centre of mass formula given in: J. E. Brock, The Inertia Tensor for a Spherical Triangle, J. Applied Mechanics 42, 239 (1975) In addition, centroids of zero-extent features now fall back to the centroid of the feature treated as a lower dimension, i.e. polygons → lines → points. Specifically, if the centroid of a polygon or multipolygon feature is ambiguous, it will treat it as a set of lines. Similarly (but not exactly the same), if a line or set of lines has zero length, it will be treated as a set of points. This also applies to d3.geo.path.centroid, except that the fallback always occurs if the feature has zero extent (area or length). For geographic polygons, it was simpler to fall back if the centroid was undefined, as area is not tracked in a simple fashion. Fixes #1011. Optimised d3_acos, and used d3_asin and d3_acos where appropriate instead of Math.min and Math.max. |
||
---|---|---|
bin | ||
lib | ||
src | ||
test | ||
.gitignore | ||
.gitmodules | ||
.npmignore | ||
.travis.yml | ||
LICENSE | ||
Makefile | ||
README.md | ||
component.json | ||
d3.js | ||
d3.min.js | ||
globals.js | ||
index-browserify.js | ||
index.js | ||
package.json |
README.md
Data-Driven Documents
D3.js is a JavaScript library for manipulating documents based on data. D3 helps you bring data to life using HTML, SVG and CSS. D3’s emphasis on web standards gives you the full capabilities of modern browsers without tying yourself to a proprietary framework, combining powerful visualization components and a data-driven approach to DOM manipulation.
Want to learn more? See the wiki.
For examples, see the gallery and mbostock’s bl.ocks.