Skip to content
GitHub repository
Function

monotoneX

function monotoneX(flat: number[], step?: number): number[];

Monotone cubic interpolation in x (Steffen’s method, same family as d3’s monotoneX). Never overshoots the data: peaks stay at the data points, flat runs stay flat. step is the target spacing of the output samples in local units.

Parameters#

ParameterTypeDefault value
flatnumber[]undefined
stepnumber2

Returns#

number[]