The chart-smoother
module exports a single function, chartSmoother(points, iterations)
, which takes an array of points and the number of smoothing iterations to perform. The function uses the Chaikin's algorithm to smooth the points.
Chaikin's algorithm is an iterative procedure for curve smoothing. Given a set of points, the algorithm successively replaces each straight line segment connecting consecutive points with two new points, offset from the original line by a fraction of the line's length. The result is a smooth curve that approximates the original set of points.
Here's an example of how to use the chart-smoother module: