Skip to content

linearInterpolation

Read as Markdown

Import from @pibbl/core/viz. Returns an ordinary linear interpolation function.

linearInterpolation() returns (beforeY, afterY, fraction) => number. Pass it as interpolateX’s interpolation function or supply your own synchronous function. It estimates in data space before scales map the result. Inputs and output must be finite.

Returns a plain data-space linear interpolation function.

linearInterpolation: () => HoverInterpolation

Related API: linearInterpolation, HoverInterpolation.

A linear interpolator for values bracketing a sample position. See HoverInterpolation .

HoverInterpolation

View source — packages/core/src/features/viz/lib/hover-queries.ts:159

Interpolates between two y values at a normalized position between samples.

type HoverInterpolation = (
beforeY: number,
afterY: number,
fraction: number,
) => number

Related API: HoverInterpolation.

  • beforeY — Vertical value before the sample position.

  • afterY — Vertical value after the sample position.

  • fraction — Fraction of the distance from the before point to the after point.

The interpolated vertical value.

InterpolateXOptions

linearInterpolation

View source — packages/core/src/features/viz/lib/hover-types.ts:227

Read the Data visualization companion for ownership, adaptation, failure modes, and verification. Agent start provides the version-selection workflow.

Documentation built with @pibbl/core 0.0.2, revision 272a94a. ALPHA — NOT FOR PRODUCTION USE.