mbostock/d3 — pull request #731 by snoble (2012-07-25 23:51:50+00:00)
Title: Monotone_cubic_interpolation is implemented slightly incorrectly

because the initial slopes were being set to the sum of the slopes of the secants instead of their average you can end up with wobbly line effects like:
https://www.dropbox.com/s/yzrdvux8kmvehzy/original-1.jpg
So with the slope corrected (the 1st commit) you get
https://www.dropbox.com/s/4h3ba09a3c8gxda/corrected.jpg

(note in the data there are only points at [2001,2002,2003,2004,2005,2006])

This implements the Fitsch-Carlson method which has a slight issue where it doesn't respect local minima in the data.
Note how in https://www.dropbox.com/s/4h3ba09a3c8gxda/corrected.jpg the curve falls below 2.0 just before x=2004. in the data the minimum point is at 2004 however the spline does not reflect that.

To resolve this you can set the initial slope to be 0 at local minima and maxima (the second commit)
see: https://www.dropbox.com/s/pep50cy9jsceyck/improved.jpg for the result.