All examples By author By category About

git-ashish

Weighted Centroid of the world largest cities

1692 largest cities in the world, weighted by their population sizes. Where does the centroid lie on the surface of the Earth?

d3.geoCentroid() doesn’t account for different weights on Points. Here the spherical centroid of the largest cities in the world, both not-weighted (in blue), and weighted by their populations (in salmon).

Original work by Philippe Rivière for Visionscarto.net. Comments and variants very welcome!

Using d3-annotation() and d3-voronoi find(). Double-click to enter edit mode.

For performance, the map itself is drawn on a <canvas> element; the annotations are displayed on a SVG overlay.