@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.
21 lines (20 loc) • 798 B
TypeScript
import type { ChartKey } from './types.js';
export type StackOrder = 'input' | 'ascending' | 'descending' | 'inside-out' | readonly ChartKey[];
export type StackOffset = 'diverging' | 'normalize' | 'center' | 'wiggle';
export interface StackAnchor {
/** Series whose interval contains the zero anchor. */
series: ChartKey;
/** Position within that interval: zero is its start and one is its end. */
fraction?: number;
}
export interface StackOptions {
order?: StackOrder;
offset?: StackOffset;
reverse?: boolean;
/** Translate each position so a point within one series lands on zero. */
anchor?: StackAnchor;
}
export interface StackLayout extends StackOptions {
readonly type: 'stack';
}
export declare function stack(options?: StackOptions): StackLayout;