Skip to main content
100%

Country Centroids on a Map

✓ Published0🌍 Public
CCurran Kelleher
Last edited Jan 21, 2016
Created on Dec 19, 2015

This example plots the centroids of countries on an equirectangular world map using D3 v3, rendering each centroid as a translucent pink circle. The map displays graticules, land masses, and country boundaries, with centroids computed via `d3.geo.path().centroid()` on TopoJSON features from a world-50m dataset. Users can pan and zoom the entire visualization through `d3.behavior.zoom`. The code also includes an unused CSV file of invitation chains, though the map itself only visualizes geographic centroids.

AI-generated description

This example shows one way to plot the centroids of geometies using d3.path.centroid. You can also pan and zoom.

The idea here is to provide a starting point for sized donut charts, or Polar Area Small Diagrams, for all countries, on a map. The centroids however are not quite right. The US looks off-center, skewed I suppose by Alaska.

forked from <a href='http://bl.ocks.org/mbostock/'>mbostock</a>'s block: <a href='http://bl.ocks.org/mbostock/3757119'>Equirectangular (Plate Carrée)</a>

forked from <a href='http://bl.ocks.org/curran/'>curran</a>'s block: <a href='http://bl.ocks.org/curran/6567fb027971588bc779'>Invitations Links Map</a>

Built with blockbuilder.org

<!-- Start of SimpleHitCounter Code --> <div align="center"><a href="http://www.simplehitcounter.com" target="_blank"><img src="http://simplehitcounter.com/hit.php?uid=1991885&f=16777215&b=0" border="0" height="18" width="83" alt="web counter"></a></div> <!-- End of SimpleHitCounter Code -->

Similar vizzes