Skip to content

@feds01/graphika


@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
ParameterType
datanumber[] | Float64Array<ArrayBufferLike>
graphdefault
optionsLineOptions
Returns

default

Methods

draw()
ts
draw(progress?): void;

Defined in: core/line.ts:630

Parameters
ParameterTypeDefault valueDescription
progressnumber1Value 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

PropertyTypeDefined in
durationnumbercore/line.ts:33
easingEasingAnimationFncore/line.ts:34

LineAreaOptions

ts
type LineAreaOptions = {
  colour?: string;
  fill?: boolean;
};

Defined in: core/line.ts:26

Options for the line area.

Properties

PropertyTypeDefined in
colour?stringcore/line.ts:28
fill?booleancore/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

PropertyTypeDescriptionDefined in
animation?LineAnimationOptionsOptional animation settings for the line.core/line.ts:62
annotatePointsbooleanWhether to annotate points on the line.core/line.ts:68
area?LineAreaOptionsOptional area settings for the line.core/line.ts:59
colourstringColour of the line.core/line.ts:50
interpolationInterpolationKindInterpolation type for the line.core/line.ts:56
label?stringOptional label for the line.core/line.ts:65
style?stringStyle of the line: 'solid' or 'dashed'.core/line.ts:53

Released under the ISC License.