d3 / d3-shape

Graphical primitives for visualization, such as lines and areas.
https://d3js.org/d3-shape
ISC License
2.48k stars 310 forks source link

Choose 2nd order derivatives to vanish at monotone curve boundaries #39

Closed ghost closed 9 years ago

ghost commented 9 years ago

Monotone curve slopes at boundary points are now chosen so that the second-order derivatives vanish. This method is given in the paper "A Simple Method for Monotonic Interpolation in One Dimension", section 2.2.

These changes are based on the conversation in pull request #38. The monotone curve looks, subjectively, better at the boundaries that the simplest solution of setting the boundary slopes to 0.

ghost commented 9 years ago

Argh, I didn't intend to merge these to master but to the monotone branch. Is this ok or shall I make another PR?

mbostock commented 9 years ago

Replaced with #40.