/** * Classification methods for choropleth maps. * * `'quantile'` puts an equal *count* of features in each class — good when the * data is skewed and you want every class populated. `'equal-interval'` splits * the *value range* evenly — good when the numbers themselves are the story and * empty classes are meaningful. Choosing wrongly is the most common way a * choropleth misleads, so the method is always explicit, never inferred. */ export type MapClassifyMethod = 'quantile' | 'equal-interval'; export interface MapClass { /** Inclusive lower bound. */ min: number; /** Upper bound: exclusive, except on the last class where it is inclusive. */ max: number; /** Zero-based position, used to index into the color ramp. */ index: number; } /** * Splits values into `steps` classes. * * Returns fewer classes than requested when the data cannot support more — a * single distinct value yields one class rather than a stack of empty * degenerate ranges. Non-finite values are ignored, and an empty input yields * no classes at all (the caller should then paint everything as "no data"). */ export declare function classifyValues(values: number[], steps: number, method?: MapClassifyMethod): MapClass[]; /** Index of the class a value belongs to, or `-1` when it belongs to none. */ export declare function classIndexOf(value: number, classes: MapClass[]): number; /** * Interpolates a ramp of `count` colors through the given stops. * * Choropleth ramps are declared as two or three tokens (`['--chart-2', '--destructive']`) * but need one color per class, so the intermediate shades are mixed here rather * than asking the consumer to name every step. */ export declare function interpolateRamp(stops: string[], count: number): string[]; /** Default label for a class, e.g. `"12 – 48"`. */ export declare function formatClassLabel(mapClass: MapClass, digits?: number): string;