Debian Codegraph @

vendor/static/chart.js/dist/helpers/helpers.segment.d.ts

raw
1 /**
2 * Returns the sub-segment(s) of a line segment that fall in the given bounds
3 * @param {object} segment
4 * @param {number} segment.start - start index of the segment, referring the points array
5 * @param {number} segment.end - end index of the segment, referring the points array
6 * @param {boolean} segment.loop - indicates that the segment is a loop
7 * @param {object} [segment.style] - segment style
8 * @param {PointElement[]} points - the points that this segment refers to
9 * @param {object} [bounds]
10 * @param {string} bounds.property - the property of a `PointElement` we are bounding. `x`, `y` or `angle`.
11 * @param {number} bounds.start - start value of the property
12 * @param {number} bounds.end - end value of the property
13 * @private
14 **/
15 export function _boundSegment(segment: {
16 start: number;
17 end: number;
18 loop: boolean;
19 style?: object;
20 }, points: PointElement[], bounds?: {
21 property: string;
22 start: number;
23 end: number;
24 }): {
25 start: number;
26 end: number;
27 loop: boolean;
28 style?: object;
29 }[];
30 /**
31 * Returns the segments of the line that are inside given bounds
32 * @param {LineElement} line
33 * @param {object} [bounds]
34 * @param {string} bounds.property - the property we are bounding with. `x`, `y` or `angle`.
35 * @param {number} bounds.start - start value of the `property`
36 * @param {number} bounds.end - end value of the `property`
37 * @private
38 */
39 export function _boundSegments(line: LineElement, bounds?: {
40 property: string;
41 start: number;
42 end: number;
43 }): {
44 start: number;
45 end: number;
46 loop: boolean;
47 style?: object;
48 }[];
49 /**
50 * Compute the continuous segments that define the whole line
51 * There can be skipped points within a segment, if spanGaps is true.
52 * @param {LineElement} line
53 * @param {object} [segmentOptions]
54 * @return {Segment[]}
55 * @private
56 */
57 export function _computeSegments(line: LineElement, segmentOptions?: object): Segment[];
58 export type LineElement = import('../elements/element.line.js').default;
59 export type PointElement = import('../elements/element.point.js').default;
60 export type Segment = {
61 start: number;
62 end: number;
63 loop: boolean;
64 style?: any;
65 };