@feds01/graphika / core/line
core/line
Classes
default
Defined in: core/line.ts:75
Line class that represent the drawing mechanisms of each line that is drawn on a graph.
Constructors
Constructor
ts
new default(
data,
graph,
options): default;Defined in: core/line.ts:79
Parameters
| Parameter | Type |
|---|---|
data | number[] | Float64Array<ArrayBufferLike> |
graph | default |
options | LineOptions |
Returns
Methods
draw()
ts
draw(progress?): void;Defined in: core/line.ts:630
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
progress | number | 1 | Value from 0 to 1 indicating how much of the line to draw. Defaults to 1 (full line). |
Returns
void
Since
v1.0.0
Function that can be called by a graph to draw the graph including the line style and the line fill (if enabled).
Type Aliases
LineAnimationOptions
ts
type LineAnimationOptions = {
duration: number;
easing: EasingAnimationFn;
};Defined in: core/line.ts:32
Options for line animation.
Properties
| Property | Type | Defined in |
|---|---|---|
duration | number | core/line.ts:33 |
easing | EasingAnimationFn | core/line.ts:34 |
LineAreaOptions
ts
type LineAreaOptions = {
colour?: string;
fill?: boolean;
};Defined in: core/line.ts:26
Options for the line area.
Properties
| Property | Type | Defined in |
|---|---|---|
colour? | string | core/line.ts:28 |
fill? | boolean | core/line.ts:27 |
LineOptions
ts
type LineOptions = {
animation?: LineAnimationOptions;
annotatePoints: boolean;
area?: LineAreaOptions;
colour: string;
interpolation: InterpolationKind;
label?: string;
style?: string;
};Defined in: core/line.ts:48
Options for a line on a graph.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
animation? | LineAnimationOptions | Optional animation settings for the line. | core/line.ts:62 |
annotatePoints | boolean | Whether to annotate points on the line. | core/line.ts:68 |
area? | LineAreaOptions | Optional area settings for the line. | core/line.ts:59 |
colour | string | Colour of the line. | core/line.ts:50 |
interpolation | InterpolationKind | Interpolation type for the line. | core/line.ts:56 |
label? | string | Optional label for the line. | core/line.ts:65 |
style? | string | Style of the line: 'solid' or 'dashed'. | core/line.ts:53 |