@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.
22 lines (21 loc) • 953 B
TypeScript
import type { ChartScene, ChartValue, StaticChartDefinition } from './types.js';
export interface ChartAdapterLayoutOptions {
width?: number;
height?: number;
initialWidth?: number;
aspectRatio?: number;
}
export interface ChartAdapterLayout {
aspectRatio?: number;
initialWidth: number;
initialHeight: number;
}
export interface ChartAdapter<TOptions, TDatum = unknown, TXValue extends ChartValue = ChartValue, TYValue extends ChartValue = ChartValue> {
prerender: () => string;
mount: (container: HTMLElement) => void;
update: (options: TOptions) => void;
getScene: () => ChartScene<TDatum, TXValue, TYValue> | undefined;
destroy: () => void;
}
export declare function resolveChartAdapterLayout(options: ChartAdapterLayoutOptions): ChartAdapterLayout;
export declare function resolveChartHostTabIndex(definition: Pick<StaticChartDefinition, 'cursor' | 'focus' | 'keyboard'>, tabIndex?: number): number;