import { Datum } from '../options'; export interface DataTransitionOptions { /** What makes a row the same row across the update; without it rows go by position. */ key?: string | ((datum: Datum, index: number) => unknown); /** * Fields the chart reads as values — the ones a bar takes its height from. * A row entering starts with these at zero and grows; a row leaving sinks * back to zero and is gone. Fields nobody named are set straight away: a * category or an x coordinate has no base to grow from. */ valueFields?: readonly string[]; } /** A frame of an update: the rows to draw, and how much room each of them takes. */ export interface TransitionFrame { data: Datum[]; /** * How much of a band each row takes, 0..1, row by row. A row that stayed * takes a whole one; one arriving grows into its own, one leaving gives its * own up — so the categories around it spread rather than snap. */ weights: number[]; } /** The frame at factor 0..1; at 1 the new data itself, at full width. */ export type DataTransition = (t: number) => TransitionFrame; /** * The frames between two sets of rows, or nothing when there is no way to draw * one: no key to match rows by and a different number of them, or no rows at * all on either end. */ export declare function planDataTransition(from: readonly Datum[], to: readonly Datum[], options?: DataTransitionOptions): DataTransition | undefined; /** Linear interpolation of the numeric fields between two rows. */ export declare function lerpDatum(from: Datum, to: Datum, t: number): Datum;