@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.
18 lines (17 loc) • 796 B
TypeScript
export interface ProportionalInterval {
readonly fraction: number;
readonly start: number;
readonly end: number;
}
export interface ProportionalIntervalOptions {
/** Start of the allocation extent. Defaults to zero. */
readonly start?: number;
/** End of the allocation extent. Defaults to one. */
readonly end?: number;
/** Empty extent between positive intervals. Defaults to zero. */
readonly gap?: number;
/** Reserve one additional gap after the final positive interval. */
readonly gapAfterLast?: boolean;
}
/** Allocates ordered nonnegative weights into aligned proportional intervals. */
export declare function allocateProportionalIntervals(weights: readonly number[], options?: Readonly<ProportionalIntervalOptions>): ProportionalInterval[];