Functions

Functions exported by @reincharts/annotations.

import { addShape, fromEdge, indexOf, ... } from "@reincharts/annotations";

addShape

Adds a marker shape of size s centered at (cx, cy) to a path.

function addShape(p: Path2D, shape: AnnotationShape, cx: number, cy: number, s: number): void

fromEdge

Resolves a pixel coordinate: negative values count from the far edge.

function fromEdge(v: number, size: number): number

indexOf

Index of the datum nearest to a data x value, or -1.

function indexOf(engine: ChartEngine, x: DataX): number

logicalOf

Logical x of a data x value (works in index and linear modes, extrapolates beyond the data).

function logicalOf(engine: ChartEngine, x: DataX): number

pixelX

Plot-relative pixel x of a data x value.

function pixelX(engine: ChartEngine, x: DataX): number

svgPath

Parsed (cached) Path2D of an SVG path string.

function svgPath(d: string): Path2D

On this page