Based on Mike Bostock’s World Map, modified to automatically colour countries such that no adjacent countries share the same colour.
This is done by extracting the topology via TopoJSON and greedily picking colours until the constraint is fulfilled.
See also: Graph coloring on Wikipedia.
Update: Greedily colouring is now performed in a single line, thanks to Mike Bostock!
Modified http://d3js.org/d3.v3.min.js to a secure url
Modified http://d3js.org/d3.geo.projection.v0.min.js to a secure url
Modified http://d3js.org/topojson.v1.min.js to a secure url
https://d3js.org/d3.v3.min.js
https://d3js.org/d3.geo.projection.v0.min.js
https://d3js.org/topojson.v1.min.js