The visual demo above is based on the function curve editor widget. If fewer than 5 knots are defined, a fallback to natural cubic spline interpolation (3 or 4 knots) and linear interpolation (2 knots) is used.
Source code: github.com/chdh/commons-math-interpolation
NPM package: commons-math-interpolation
Theory: A New Method of Interpolation and Smooth Curve Fitting Based on Local Procedures, by Hiroshi Akima
Author: Christian d'Heureuse (www.source-code.biz, www.inventec.ch/chdh)