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