/** * Bubble series (proportional symbols). * * The right mark for **absolute magnitudes**: totals, counts, revenue, population. * A choropleth of those quantities mostly redraws the map of where big areas are, * whereas a bubble is immune to area bias because its size is independent of the * polygon underneath it. * * Three decisions are made for the developer, each because the alternative is * usually a mistake: * * 1. **Square-root sizing** (see `scales/SizeScale`), so circle *area* is * proportional to value. Linear radius overstates large values enormously. * 2. **Largest drawn first**, so small bubbles land on top and stay hoverable. * Painting in data order buries them under their neighbours. * 3. **Positions may come from the data or from geometry.** Explicit `lon`/`lat` * wins; otherwise the datum is joined to a feature and placed at its centroid, * so "revenue by country" needs no coordinates at all. * * @module series/Bubble */ import { Scale } from '../scales/Scale'; import { SizeScale } from '../scales/SizeScale'; import type { JoinResult } from '../data/Join'; import { Viewport } from '../geo/Viewport'; import type { BubbleSeriesOptions, LonLat, MarkItem, NormalizedGeo, SizeLegendEntry, WorldPoint } from '../types'; import type { SymbolSpec } from '../renderers/SvgRenderer'; export interface BubbleItem extends MarkItem { lonLat: LonLat; world: WorldPoint | null; radius: number | null; /** Value driving the optional colour scale, when one is configured. */ colorValue: number | null; } export declare class BubbleSeries { static readonly type: "bubble"; static readonly kind: "symbols"; readonly type: "bubble"; readonly kind: "symbols"; readonly config: BubbleSeriesOptions; readonly index: number; readonly id: string; readonly warnings: string[]; readonly items: BubbleItem[]; readonly sizeScale: SizeScale; readonly colorScale: Scale | null; readonly join: JoinResult | null; /** * Colour classes switched off from the legend. * * A muted class hides its bubbles rather than greying them, for the reason * `series/Arc` gives: a choropleth cannot remove a country so it can only drain * the colour out of it, while a bubble is nothing but the datum. */ readonly mutedClasses: Set; constructor({ config, geo, index, viewport, }: { config: BubbleSeriesOptions; geo: NormalizedGeo; index: number; viewport: Viewport; }); /** Recompute world positions after a projection change. */ reproject(viewport: Viewport): void; itemAt(index: number): BubbleItem | undefined; fillFor(item: BubbleItem): string; /** Whether the legend has switched off the colour class this bubble falls in. */ isMuted(item: BubbleItem): boolean; /** Symbol specs for the renderer, in paint order, skipping unplaceable marks. */ symbols(): SymbolSpec[]; legendTitle(): string | undefined; /** * Reference circles for a nested-circle legend. This is the legend style that * actually lets a reader decode bubble areas, and almost nobody ships it. */ sizeLegend(): SizeLegendEntry[]; /** * Switch a colour class off, or back on. Returns the new muted state. * * Only the colour legend toggles. The nested reference circles beside it are a * size legend, and a size is not a class: there is no set of bubbles a reader * could mean by clicking "50,000". So `sizeLegend` stays non-interactive and * this only ever hears from a `colorScale` section. */ toggleClass(classIndex: number): boolean; legendItems(): never[]; describe(item: BubbleItem): string; advise(): string[]; } //# sourceMappingURL=Bubble.d.ts.map