Documentation menu

Class

Mark

A mark of a FerroPlot.

Properties

id

readonly id: number;

The mark's id, unique in its plot (hits of the same mark have the same id).

kind

readonly kind: MarkKind;

The kind given to addMark.

Methods

append

append(data: MarkData): void;

Appends points (the same columns as the existing data).

applyOptions

applyOptions(options: MarkOptions): void;

Changes options; absent keys keep their value.

options

options(): Required<MarkOptions>;

The current options (every key).

remove

remove(): void;

Removes the mark from the plot.

setData

setData(data: MarkData): void;

Replaces all data. Typed arrays are copied in one memcpy per column. Invalid data (columns of different lengths, non-finite x, category numbers that are not whole numbers) is rejected and the old data kept.

update

update(point: MarkPoint): void;

Replaces the last point (a live value); does not allocate.

Like every object of the API, a Mark holds WebAssembly memory. Objects returned by the chart are freed with it; free() (or using) releases one earlier.