Conversation
|
@danburzo if you'd like to review? |
|
I think I'd like to revisit the boundary conditions (section 2.2 in the Steffen paper). It seems we're duplicating the slopes at either ends by adding the reflection of |
|
See also d3/d3-shape#118 #52 #67 |
|
I had a chance to give the cited paper another look. The previous implementation in culori, and by extension, in this PR, is using the one-sided finite differences for boundary points, which is a valid approach outlined in the paper (Section 2.2). In (In the image above, the FD versions refer to 'one-sided finite differences') In particular, the finite-differences approach (blue stroke in the image below) produces curves that are closer to a linear interpolation; the new implementation (red stroke) tends to squeeze the colors at either end of the interpolation into a narrower portion: So I'm not 100% convinced the new approach produces better results... |


cubic Hermite splines ; will be useful for d3/d3-scale-chromatic#28
The difference with interpolateBasis is that this interpolator returns the exact values at the control points; with n = values.length we have:
Code adapted from https://github.com/Evercoder/culori (see Evercoder/culori#91 )