import type { TransformLineage, TransformValue, TransformValueOutput } from './transform.js'; import type { ChartValue } from './types.js'; export interface MosaicOptions = TransformValue, TY extends TransformValue = TransformValue, TValue extends TransformValue = TransformValue> { /** Categorical horizontal channel. */ readonly x: TX; /** Categorical vertical channel. */ readonly y: TY; /** Nonnegative aggregate represented by this x/y pair. */ readonly value: TValue; /** Horizontal category order. Unobserved categories do not create rows. */ readonly xOrder?: readonly ChartValue[]; /** Vertical category order. Unobserved categories do not create rows. */ readonly yOrder?: readonly ChartValue[]; } type MosaicDerivedField = keyof TransformLineage | 'xValue' | 'yValue' | 'value' | 'total' | 'x' | 'x1' | 'x2' | 'y' | 'y1' | 'y2'; type MosaicDatumBase = Omit & TransformLineage & { readonly xValue: TXValue; readonly yValue: TYValue; readonly value: number; readonly total: number; readonly x: number; readonly x1: number; readonly x2: number; readonly y: number; readonly y1: number; readonly y2: number; }; export type MosaicYDatum = MosaicDatumBase & { /** Sum of values in this cell's horizontal category. */ readonly xTotal: number; }; export type MosaicXDatum = MosaicDatumBase & { /** Sum of values in this cell's vertical category. */ readonly yTotal: number; }; /** * Allocates horizontal category totals into widths, then normalizes vertical * categories independently within each horizontal category. */ export declare function mosaicY, const TY extends TransformValue, const TValue extends TransformValue>(source: Iterable, options: MosaicOptions): MosaicYDatum, ChartValue>, Extract, ChartValue>>[]; /** * Allocates vertical category totals into heights, then normalizes horizontal * categories independently within each vertical category. */ export declare function mosaicX, const TY extends TransformValue, const TValue extends TransformValue>(source: Iterable, options: MosaicOptions): MosaicXDatum, ChartValue>, Extract, ChartValue>>[]; export {};