Bring data to life with SVG, Canvas and HTML. 📊📈🎉
Перейти к файлу
Jason Davies 492215ad42 Add area-weighted geographic polygon centroids.
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.
2013-06-02 10:52:43 +01:00
bin Custom UglifyJS script to warn about leaking globals. 2013-05-24 20:37:58 +01:00
lib Merge branch 'master' of https://github.com/ilyabo/d3 into 3.1.0 2013-03-20 21:34:12 -07:00
src Add area-weighted geographic polygon centroids. 2013-06-02 10:52:43 +01:00
test Add area-weighted geographic polygon centroids. 2013-06-02 10:52:43 +01:00
.gitignore Add .DS_Store to .gitignore. 2011-11-03 09:06:04 -07:00
.gitmodules Replace submodule with package.json. 2011-08-18 10:10:16 -07:00
.npmignore Add .npmignore. 2011-11-18 16:52:35 -08:00
.travis.yml use node 0.10 for travis 2013-04-11 23:10:08 +08:00
LICENSE Update copyright year. 2013-03-13 11:50:05 -07:00
Makefile Custom UglifyJS script to warn about leaking globals. 2013-05-24 20:37:58 +01:00
README.md README.md: Point hyperlinks at github explicitly 2013-01-07 06:16:37 -08:00
component.json Merge branch '3.1.10' 2013-05-28 15:59:53 -07:00
d3.js Add area-weighted geographic polygon centroids. 2013-06-02 10:52:43 +01:00
d3.min.js Add area-weighted geographic polygon centroids. 2013-06-02 10:52:43 +01:00
globals.js Use captured references for document and window. 2013-01-31 15:11:40 -08:00
index-browserify.js Move edits to src/component.js. 2013-04-03 10:46:15 -07:00
index.js Use captured references for document and window. 2013-01-31 15:11:40 -08:00
package.json Update UglifyJS to 2.3.6. 2013-05-29 16:24:16 +01:00

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. D3s 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 mbostocks bl.ocks.