linearInterpolation
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.
API details from source
Section titled “API details from source”
linearInterpolation
Section titled “linearInterpolation”Returns a plain data-space linear interpolation function.
linearInterpolation: () => HoverInterpolationRelated API: linearInterpolation, HoverInterpolation.
Returns
Section titled “Returns”A linear interpolator for values bracketing a sample position. See HoverInterpolation .
See also
Section titled “See also”View source — packages/core/src/features/viz/lib/hover-queries.ts:159
HoverInterpolation
Section titled “HoverInterpolation”Interpolates between two y values at a normalized position between samples.
type HoverInterpolation = ( beforeY: number, afterY: number, fraction: number,) => numberRelated API: HoverInterpolation.
Parameters
Section titled “Parameters”-
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.
Returns
Section titled “Returns”The interpolated vertical value.
See also
Section titled “See also”View source — packages/core/src/features/viz/lib/hover-types.ts:227
Implementation guidance for agents
Section titled “Implementation guidance for agents”Read the Data visualization companion for ownership, adaptation, failure modes, and verification. Agent start provides the version-selection workflow.
Complete minimal examples
Section titled “Complete minimal examples”- Hover query helpers: Run closest-point, closest-x, and interpolated-x queries against a scale context. Plain source
Documentation version
Section titled “Documentation version”Documentation built with @pibbl/core 0.0.2, revision 2dccb19. ALPHA — NOT FOR PRODUCTION USE.