/** * Choropleth series. * * Fills administrative areas by value. The series owns three decisions that * change what the map says, so all three are explicit and inspectable: * * 1. **The join** (which datum belongs to which feature), delegated to * `data/Join.js` and reported rather than silently failed. * 2. **Normalisation** (`normalizeBy`), because mapping counts across unequal * areas is the most common way to publish a misleading choropleth. When it is * used, the legend title says so. * 3. **Classification**, delegated to `scales/Scale.js` and exposed in the legend. * * @module series/Choropleth */ import { Scale } from '../scales/Scale'; import type { JoinResult } from '../data/Join'; import type { FeaturePaint } from '../renderers/Paint'; import type { ChoroplethSeriesOptions, LegendItem, NormalizedFeature, NormalizedGeo } from '../types'; export declare class ChoroplethSeries { static readonly type: "choropleth"; static readonly kind: "features"; readonly type: "choropleth"; readonly kind: "features"; readonly config: ChoroplethSeriesOptions; readonly geo: NormalizedGeo; readonly index: number; readonly id: string; readonly theme: { palette?: string; }; readonly dark: boolean; readonly warnings: string[]; /** Class indices muted via the legend. */ readonly mutedClasses: Set; readonly join: JoinResult; readonly values: Map; readonly scale: Scale; constructor({ config, geo, index, theme, dark, }: { /** Series config, already merged with defaults. */ config: ChoroplethSeriesOptions; geo: NormalizedGeo; /** Series index, used for the stable series id. */ index: number; theme?: { palette?: string; }; /** Dark mode, already resolved from `theme.mode` (`'auto'` included). */ dark?: boolean; }); private _scaleOptions; /** Resolve one numeric value per feature index, applying `normalizeBy`. */ private _computeValues; valueFor(feature: NormalizedFeature): number | null; datumFor(feature: NormalizedFeature): unknown; /** * Fill for a feature, honouring legend muting. * */ fillFor(feature: NormalizedFeature): string; /** * Texture for a feature, or null to leave it on its flat fill. * * No-data and legend-muted features are never textured. Both are absences, and * a pattern over an absence reads as one more category: the reader would see * six things on a five-class map. */ paintFor(feature: NormalizedFeature): FeaturePaint | null; /** Whether any feature could be textured, which decides how cheap a redraw can be. */ get painted(): boolean; /** Returns the new muted state. */ toggleClass(classIndex: number): boolean; /** * Legend title, made honest automatically: a normalised series says what it is * a rate of, so the reader is never left guessing whether they are looking at * counts or rates. * */ legendTitle(): string | undefined; legendItems(options?: { includeNull?: boolean; format?: (v: number) => string; }): LegendItem[]; /** * Put the class's own tile on its swatch. * * A patterned map with flat swatches tells the reader the texture is decoration, * which is the opposite of the point when the tile is what distinguishes two * classes on a photocopy. Skipped for the no-data entry, which is never textured, * and for a continuous scale, whose legend is a bar rather than swatches. */ private _patternedItem; /** * Cartographic sanity checks, surfaced in dev mode only. * * The count-versus-rate check is the one that matters: it is the difference * between "where are the people" and "where is the phenomenon", and it is the * error that gets published most often. * */ describe(feature: NormalizedFeature): string; advise(): string[]; } //# sourceMappingURL=Choropleth.d.ts.map