score:1

The Mister Nester tool you link to is running d3 version 3. From the version 3 docs:

nest.map(array[, mapType])

Applies the nest operator to the specified array, returning an associative array.

That's a plain old javascript object, which does not have a .each method.

The closest to what you want in version 3 is:

 d3.nest()
   .key(function(d) { return d.year; })
   .map(data, d3.map)
   .forEach(function(values, key) { return 0;});

Related Query

More Query from same tag