You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
977 B

1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. import type { ChartArea } from '../types/index.js';
  2. export interface SplinePoint {
  3. x: number;
  4. y: number;
  5. skip?: boolean;
  6. cp1x?: number;
  7. cp1y?: number;
  8. cp2x?: number;
  9. cp2y?: number;
  10. }
  11. export declare function splineCurve(firstPoint: SplinePoint, middlePoint: SplinePoint, afterPoint: SplinePoint, t: number): {
  12. previous: SplinePoint;
  13. next: SplinePoint;
  14. };
  15. /**
  16. * This function calculates Bézier control points in a similar way than |splineCurve|,
  17. * but preserves monotonicity of the provided data and ensures no local extremums are added
  18. * between the dataset discrete points due to the interpolation.
  19. * See : https://en.wikipedia.org/wiki/Monotone_cubic_interpolation
  20. */
  21. export declare function splineCurveMonotone(points: SplinePoint[], indexAxis?: 'x' | 'y'): void;
  22. /**
  23. * @private
  24. */
  25. export declare function _updateBezierControlPoints(points: SplinePoint[], options: any, area: ChartArea, loop: boolean, indexAxis: 'x' | 'y'): void;