chartist
Version:
Simple, responsive charts
30 lines • 1.36 kB
TypeScript
import type { SegmentData } from '../core';
import { SvgPath } from '../svg';
export interface MonotoneCubicInterpolationOptions {
fillHoles?: boolean;
}
/**
* Monotone Cubic spline interpolation produces a smooth curve which preserves monotonicity. Unlike cardinal splines, the curve will not extend beyond the range of y-values of the original data points.
*
* Monotone Cubic splines can only be created if there are more than two data points. If this is not the case this smoothing will fallback to `Chartist.Smoothing.none`.
*
* The x-values of subsequent points must be increasing to fit a Monotone Cubic spline. If this condition is not met for a pair of adjacent points, then there will be a break in the curve between those data points.
*
* All smoothing functions within Chartist are factory functions that accept an options parameter.
*
* @example
* ```ts
* const chart = new LineChart('.ct-chart', {
* labels: [1, 2, 3, 4, 5],
* series: [[1, 2, 8, 1, 7]]
* }, {
* lineSmooth: Interpolation.monotoneCubic({
* fillHoles: false
* })
* });
* ```
*
* @param options The options of the monotoneCubic factory function.
*/
export declare function monotoneCubic(options?: MonotoneCubicInterpolationOptions): (pathCoordinates: number[], valueData: SegmentData[]) => SvgPath;
//# sourceMappingURL=monotoneCubic.d.ts.map