@tanstack/charts
Version:
A chart grammar for TypeScript and JavaScript. Marks consume your data directly, channels describe visual encodings, and the engine compiles them into a renderer-neutral keyed scene. TanStack's compact scales cover common numeric and categorical mappings.
27 lines (26 loc) • 1.38 kB
TypeScript
import type { Channel, ChannelOutput, ChartKey, ChartMark, ChartMarkMotionOptions, ChartValue, VisualChannel } from './types.js';
export interface VoronoiOptions<TDatum> extends ChartMarkMotionOptions<never> {
id?: string;
x: Channel<TDatum, ChartValue | null | undefined>;
y: Channel<TDatum, ChartValue | null | undefined>;
/** Builds a separate full-extent tessellation for each non-null group. */
z?: Channel<TDatum, ChartKey | null | undefined>;
key?: Channel<TDatum, ChartKey>;
color?: Channel<TDatum, ChartKey | null | undefined>;
fill?: VisualChannel<TDatum, string>;
fillOpacity?: number;
stroke?: VisualChannel<TDatum, string>;
strokeOpacity?: number;
strokeWidth?: number;
strokeDasharray?: string;
opacity?: number;
}
type VoronoiXOutput<TDatum, TOptions> = ChannelOutput<TDatum, TOptions extends {
x: infer TChannel;
} ? TChannel : never, number>;
type VoronoiYOutput<TDatum, TOptions> = ChannelOutput<TDatum, TOptions extends {
y: infer TChannel;
} ? TChannel : never, number>;
/** Draws final-screen Voronoi cells without adding focus candidates. */
export declare function voronoi<TDatum, const TOptions extends VoronoiOptions<NoInfer<TDatum>>>(source: Iterable<TDatum>, options: TOptions): ChartMark<never, never, never, VoronoiXOutput<TDatum, TOptions>, VoronoiYOutput<TDatum, TOptions>>;
export {};