@feds01/graphika / core/line
core/line
Classes
default
Defined in: core/line.ts:70
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:74
Parameters
| Parameter | Type |
|---|---|
data | number[] | Float64Array<ArrayBufferLike> |
graph | default |
options | LineOptions |
Returns
Methods
draw()
ts
draw(progress): void;Defined in: core/line.ts:522
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:27
Options for line animation.
Properties
| Property | Type | Defined in |
|---|---|---|
duration | number | core/line.ts:28 |
easing | EasingAnimationFn | core/line.ts:29 |
LineAreaOptions
ts
type LineAreaOptions = {
colour?: string;
fill?: boolean;
};Defined in: core/line.ts:21
Options for the line area.
Properties
| Property | Type | Defined in |
|---|---|---|
colour? | string | core/line.ts:23 |
fill? | boolean | core/line.ts:22 |
LineOptions
ts
type LineOptions = {
animation?: LineAnimationOptions;
annotatePoints: boolean;
area?: LineAreaOptions;
colour: string;
interpolation: InterpolationKind;
label?: string;
style?: string;
};Defined in: core/line.ts:43
Options for a line on a graph.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
animation? | LineAnimationOptions | Optional animation settings for the line. | core/line.ts:57 |
annotatePoints | boolean | Whether to annotate points on the line. | core/line.ts:63 |
area? | LineAreaOptions | Optional area settings for the line. | core/line.ts:54 |
colour | string | Colour of the line. | core/line.ts:45 |
interpolation | InterpolationKind | Interpolation type for the line. | core/line.ts:51 |
label? | string | Optional label for the line. | core/line.ts:60 |
style? | string | Style of the line: 'solid' or 'dashed'. | core/line.ts:48 |