1+ /* eslint-disable @typescript-eslint/no-use-before-define */
12import { _angleBetween , _angleDiff , _isBetween , _normalizeAngle } from './helpers.math.js' ;
23import { createContext } from './helpers.options.js' ;
34import type { LineElement , LineOptions , PointElement , Segment , SegmentStyle , SegmentBounds } from '../types/index.js' ;
@@ -58,17 +59,6 @@ function getSegment(segment: Segment, points: Point[], bounds: SegmentBounds) {
5859
5960/**
6061 * Returns the sub-segment(s) of a line segment that fall in the given bounds
61- * @param {object } segment
62- * @param {number } segment.start - start index of the segment, referring the points array
63- * @param {number } segment.end - end index of the segment, referring the points array
64- * @param {boolean } segment.loop - indicates that the segment is a loop
65- * @param {object } [segment.style] - segment style
66- * @param {PointElement[] } points - the points that this segment refers to
67- * @param {object } [bounds]
68- * @param {string } bounds.property - the property of a `PointElement` we are bounding. `x`, `y` or `angle`.
69- * @param {number } bounds.start - start value of the property
70- * @param {number } bounds.end - end value of the property
71- * @private
7262 **/
7363// eslint-disable-next-line max-statements, complexity
7464export function _boundSegment ( segment : Segment , points : PointElement [ ] , bounds : SegmentBounds ) {
@@ -128,12 +118,6 @@ export function _boundSegment(segment: Segment, points: PointElement[], bounds:
128118
129119/**
130120 * Returns the segments of the line that are inside given bounds
131- * @param {LineElement } line
132- * @param {object } [bounds]
133- * @param {string } bounds.property - the property we are bounding with. `x`, `y` or `angle`.
134- * @param {number } bounds.start - start value of the `property`
135- * @param {number } bounds.end - end value of the `property`
136- * @private
137121 */
138122export function _boundSegments ( line : LineElement , bounds : SegmentBounds ) {
139123 const result = [ ] ;
@@ -187,10 +171,6 @@ function findStartAndEnd(points: PointElement[], count: number, loop: boolean, s
187171
188172/**
189173 * Compute solid segments from Points, when spanGaps === false
190- * @param {PointElement[] } points - the points
191- * @param {number } start - start index
192- * @param {number } max - max index (can go past count on a loop)
193- * @param {boolean } loop - boolean indicating that this would be a loop if no gaps are found
194174 */
195175function solidSegments ( points : PointElement [ ] , start : number , max : number , loop : boolean ) {
196176 const count = points . length ;
@@ -227,10 +207,6 @@ function solidSegments(points: PointElement[], start: number, max: number, loop:
227207/**
228208 * Compute the continuous segments that define the whole line
229209 * There can be skipped points within a segment, if spanGaps is true.
230- * @param {LineElement } line
231- * @param {object } [segmentOptions]
232- * @return {Segment[] }
233- * @private
234210 */
235211export function _computeSegments ( line : LineElement , segmentOptions : AnyObject ) {
236212 const points = line . points ;
@@ -253,26 +229,13 @@ export function _computeSegments(line: LineElement, segmentOptions: AnyObject) {
253229 return splitByStyles ( line , solidSegments ( points , start , max , completeLoop ) , points , segmentOptions ) ;
254230}
255231
256- /**
257- * @param {Segment[] } segments
258- * @param {PointElement[] } points
259- * @param {object } [segmentOptions]
260- * @return {Segment[] }
261- */
262232function splitByStyles ( line : LineElement , segments : Segment [ ] , points : PointElement [ ] , segmentOptions : AnyObject ) {
263233 if ( ! segmentOptions || ! segmentOptions . setContext || ! points ) {
264234 return segments ;
265235 }
266236 return doSplitByStyles ( line , segments , points , segmentOptions ) ;
267237}
268238
269- /**
270- * @param {LineElement } line
271- * @param {Segment[] } segments
272- * @param {PointElement[] } points
273- * @param {object } [segmentOptions]
274- * @return {Segment[] }
275- */
276239function doSplitByStyles ( line : LineElement , segments : Segment [ ] , points : PointElement [ ] , segmentOptions : AnyObject ) {
277240 const chartContext = line . _chart . getContext ( ) ;
278241 const baseStyle = readStyle ( line . options ) ;
0 commit comments