Skip to content

@feds01/graphika


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

default

Methods

draw()
ts
draw(progress): void;

Defined in: core/line.ts:522

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:27

Options for line animation.

Properties

PropertyTypeDefined in
durationnumbercore/line.ts:28
easingEasingAnimationFncore/line.ts:29

LineAreaOptions

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

Defined in: core/line.ts:21

Options for the line area.

Properties

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

PropertyTypeDescriptionDefined in
animation?LineAnimationOptionsOptional animation settings for the line.core/line.ts:57
annotatePointsbooleanWhether to annotate points on the line.core/line.ts:63
area?LineAreaOptionsOptional area settings for the line.core/line.ts:54
colourstringColour of the line.core/line.ts:45
interpolationInterpolationKindInterpolation type for the line.core/line.ts:51
label?stringOptional label for the line.core/line.ts:60
style?stringStyle of the line: 'solid' or 'dashed'.core/line.ts:48

Released under the ISC License.