chartist
Version:
Simple, responsive charts
29 lines • 1.36 kB
TypeScript
import type { Segment, SegmentData } from '../types';
/**
* Splits a list of coordinates and associated values into segments. Each returned segment contains a pathCoordinates
* valueData property describing the segment.
*
* With the default options, segments consist of contiguous sets of points that do not have an undefined value. Any
* points with undefined values are discarded.
*
* **Options**
* The following options are used to determine how segments are formed
* ```javascript
* var options = {
* // If fillHoles is true, undefined values are simply discarded without creating a new segment. Assuming other options are default, this returns single segment.
* fillHoles: false,
* // If increasingX is true, the coordinates in all segments have strictly increasing x-values.
* increasingX: false
* };
* ```
*
* @param pathCoordinates List of point coordinates to be split in the form [x1, y1, x2, y2 ... xn, yn]
* @param valueData List of associated point values in the form [v1, v2 .. vn]
* @param options Options set by user
* @return List of segments, each containing a pathCoordinates and valueData property.
*/
export declare function splitIntoSegments(pathCoordinates: number[], valueData: SegmentData[], options?: {
increasingX?: boolean;
fillHoles?: boolean;
}): Segment[];
//# sourceMappingURL=segments.d.ts.map