block by renecnielsen d44783b9a0a12f3ccc3a

Napoleon's March with d3.svg.ribbon

Full Screen

An example of d3.svg.ribbon using Napoleon’s March through Russia made famous by Minard’s map. Dataset comes from Ben Schmidt’s use of it in his excellent d3.trail layout.

The pattern for using d3.svg.ribbon with geodata is simply to factor the projection into the accessors:

projection = d3.geo.equirectangular().translate([-3300,7800]).scale(8000);
sizeScale = d3.scale.linear().domain([6000,340000]).range([1,10])

ribbon = d3.svg.ribbon()
  .x(function(d) {return projection([d.lon, d.lat])[0]})
  .y(function(d) {return projection([d.lon, d.lat])[1]})
  .r(function(d) {return sizeScale(d.size)});

forked from emeeks‘s block: Napoleon’s March with d3.svg.ribbon

index.html

d3.svg.ribbon.js