import type { ReactNode } from "react"; /** `Matrix`'s data layer, its own module so a KPI can use the same `matrixTotals` the grid shows. */ export interface MatrixAxisItem { key: string; label: string; /** The mark its name leads with where the row or column is someone or something with a face — a person's * `Avatar`, a linked row's picture; unsized, a line's rung. Every head of the axis holds the slot where one has * a mark: a row's inside `rowLabelWidth`, a column's in its head's width. */ leading?: ReactNode; } /** The host renders its detail underneath. */ export interface MatrixCellRef { row: string; col: string; } export interface MatrixTotalsResult { rowTotals: Map; colTotals: Map; grandTotal: number; /** The heat scale's upper bound. */ max: number; } export type MatrixHeatScale = "linear" | "rank"; export interface MatrixHeatScaleResult { /** Zero and below paints nothing. */ alpha: (value: number) => number; /** The same alphas, sampled across the painted set. */ legend: number[]; } /** `linear` maps by share of the largest cell, honest only for spread values; `rank` maps by position * among distinct values, so smallest is `lo`, largest `hi`, equal cells equal. The legend samples the * same function, so it never shows an unreachable shade. */ export declare function matrixHeatScale(values: number[], scale: MatrixHeatScale, band: [number, number]): MatrixHeatScaleResult; /** Row sums, column sums, grand total and max cell in one pass. */ export declare function matrixTotals(rows: MatrixAxisItem[], cols: MatrixAxisItem[], value: (row: string, col: string) => number): MatrixTotalsResult;