Skip to content
pixi-silk
GitHub repository
Function

monotoneX

import { monotoneX } from 'pixi-silk';
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, at most 64 per segment. Points must be sorted by x. Fewer than 3 points come back as a copy.

Parameters#

ParameterTypeDefault value
flatnumber[]undefined
stepnumber2

Returns#

number[]