import { AbstractFormatter } from '../Formatter'; import { TypedValue } from '../DataPrimitive'; import { DataSeries } from '../DataSeries'; import { DataPoint } from '../DataPoint'; export interface LerpConfig { outputMin?: number; outputMax?: number; inputMin?: number; inputMax?: number; } /** * Linearly maps numeric values onto a new numeric range. * * Similar to the `gradient` formatter, the input domain is derived from the data (per-series or * DataFrame-wide) and the output is interpolated between the configured output range. * * `outputMin` and `outputMax` default to `[0, 1]` when no config is provided. * `inputMin` and `inputMax` are derived from the input data unless provided. * * ```js * primary | seriesByName("nodeValues")', * nodeSize: '> nodeValues | lerp(nodeSizeConfig)', * }} * dataSources={{ * primary: { * data: { * fields: [{ name: 'nodeValues' }], * columns: [[0, 25, 50, 75, 100]], * }, * }, * }} * /> * ``` * * ## Config Object * * **outputMin**: `number` minimum value of the mapped output range. Defaults to `0`. * * **outputMax**: `number` maximum value of the mapped output range. Defaults to `1`. * * **inputMin**: `number` lower bound of the input domain. Optional. * * **inputMax**: `number` upper bound of the input domain. Optional. * * If the input value is outside of `[inputMin, inputMax]`, the value is clamped to the nearest bound. * * @extends AbstractFormatter<'number', 'number'> */ export declare class Lerp extends AbstractFormatter<'number', 'number'> { readonly config: LerpConfig; readonly outputMin: number; readonly outputMax: number; readonly inputMin?: number; readonly inputMax?: number; constructor(config?: LerpConfig); private interpolate; private static isValidNumber; private resolveSeriesMinMax; private resolveFrameMinMax; format(dataPrimitive: any): any; protected formatTypedValue(p: DataPoint<'number'>, series?: DataSeries): TypedValue<'number'>; }