| 1 |
export default class LineElement extends Element<import("../types/basic.js").AnyObject, import("../types/basic.js").AnyObject> { |
| 2 |
static id: string; |
| 3 |
/** |
| 4 |
* @type {any} |
| 5 |
*/ |
| 6 |
static defaults: any; |
| 7 |
static descriptors: { |
| 8 |
_scriptable: boolean; |
| 9 |
_indexable: (name: any) => boolean; |
| 10 |
}; |
| 11 |
constructor(cfg: any); |
| 12 |
animated: boolean; |
| 13 |
options: any; |
| 14 |
_chart: any; |
| 15 |
_loop: any; |
| 16 |
_fullLoop: any; |
| 17 |
_path: any; |
| 18 |
_points: any; |
| 19 |
_segments: import("../helpers/helpers.segment.js").Segment[]; |
| 20 |
_decimated: boolean; |
| 21 |
_pointsUpdated: boolean; |
| 22 |
_datasetIndex: any; |
| 23 |
updateControlPoints(chartArea: any, indexAxis: any): void; |
| 24 |
set points(arg: any); |
| 25 |
get points(): any; |
| 26 |
get segments(): import("../helpers/helpers.segment.js").Segment[]; |
| 27 |
/** |
| 28 |
* First non-skipped point on this line |
| 29 |
* @returns {PointElement|undefined} |
| 30 |
*/ |
| 31 |
first(): PointElement | undefined; |
| 32 |
/** |
| 33 |
* Last non-skipped point on this line |
| 34 |
* @returns {PointElement|undefined} |
| 35 |
*/ |
| 36 |
last(): PointElement | undefined; |
| 37 |
/** |
| 38 |
* Interpolate a point in this line at the same value on `property` as |
| 39 |
* the reference `point` provided |
| 40 |
* @param {PointElement} point - the reference point |
| 41 |
* @param {string} property - the property to match on |
| 42 |
* @returns {PointElement|undefined} |
| 43 |
*/ |
| 44 |
interpolate(point: PointElement, property: string): PointElement | undefined; |
| 45 |
/** |
| 46 |
* Append a segment of this line to current path. |
| 47 |
* @param {CanvasRenderingContext2D} ctx |
| 48 |
* @param {object} segment |
| 49 |
* @param {number} segment.start - start index of the segment, referring the points array |
| 50 |
* @param {number} segment.end - end index of the segment, referring the points array |
| 51 |
* @param {boolean} segment.loop - indicates that the segment is a loop |
| 52 |
* @param {object} params |
| 53 |
* @param {boolean} params.move - move to starting point (vs line to it) |
| 54 |
* @param {boolean} params.reverse - path the segment from end to start |
| 55 |
* @param {number} params.start - limit segment to points starting from `start` index |
| 56 |
* @param {number} params.end - limit segment to points ending at `start` + `count` index |
| 57 |
* @returns {undefined|boolean} - true if the segment is a full loop (path should be closed) |
| 58 |
*/ |
| 59 |
pathSegment(ctx: CanvasRenderingContext2D, segment: { |
| 60 |
start: number; |
| 61 |
end: number; |
| 62 |
loop: boolean; |
| 63 |
}, params: { |
| 64 |
move: boolean; |
| 65 |
reverse: boolean; |
| 66 |
start: number; |
| 67 |
end: number; |
| 68 |
}): undefined | boolean; |
| 69 |
/** |
| 70 |
* Append all segments of this line to current path. |
| 71 |
* @param {CanvasRenderingContext2D|Path2D} ctx |
| 72 |
* @param {number} [start] |
| 73 |
* @param {number} [count] |
| 74 |
* @returns {undefined|boolean} - true if line is a full loop (path should be closed) |
| 75 |
*/ |
| 76 |
path(ctx: CanvasRenderingContext2D | Path2D, start?: number, count?: number): undefined | boolean; |
| 77 |
/** |
| 78 |
* Draw |
| 79 |
* @param {CanvasRenderingContext2D} ctx |
| 80 |
* @param {object} chartArea |
| 81 |
* @param {number} [start] |
| 82 |
* @param {number} [count] |
| 83 |
*/ |
| 84 |
draw(ctx: CanvasRenderingContext2D, chartArea: object, start?: number, count?: number): void; |
| 85 |
} |
| 86 |
export type PointElement = import('./element.point.js').default; |
| 87 |
import Element from "../core/core.element.js"; |