import { Button as WebButton } from "../../atoms/button/button.js"; import { type LayoutStyle } from "../../style/index.js"; import { type ChartSkin } from "../shared/types.js"; import { type GeoMapCluster } from "./geo-map.cluster.js"; export interface GeoMapPoint { /** Stable identity, used as the React key when present. */ id?: string | number; /** Latitude in degrees, north-positive. Clamped to the poles. */ lat: number; /** Longitude in degrees, east-positive. Wrapped onto ±180. */ lng: number; /** The place name, shown in the value flag and folded into the accessible name. */ label: string; /** The magnitude at this place; encodes the bubble's AREA. */ count: number; } export interface GeoMapProps { /** The places to plot; every bubble takes the primary token. */ points: GeoMapPoint[]; /** Optional heading shown above the map. */ title?: string; compact?: boolean; /** Bordered geography panel with individually outlined place bubbles and an inline readout. */ detailed?: boolean; /** Strip the card surface for nesting inside an existing card (mirrors Stats). */ plain?: boolean; /** Formats the flagged and accessible counts (data formatting, not styling). */ formatValue?: (v: number) => string; /** Press-to-inspect: the selected point index (controlled). Pass null for none. */ selected?: number | null; /** Press-to-inspect: the initially selected point (uncontrolled). */ defaultSelected?: number; /** Fired when a press selects a point (or clears it with null). */ onSelect?: (index: number | null) => void; /** * Zoom and pan the map, and aggregate crowded places into one bubble that * splits into its members as the map is driven in. The wheel zooms about the * pointer, two fingers pinch, a drag pans once zoomed, and the zoom controls * and arrow keys give the same reach without a pointer. */ zoomable?: boolean; /** The zoom factor, 1 (the whole world) upward (controlled). Needs `zoomable`. */ zoom?: number; /** The zoom factor the map opens at (uncontrolled). Needs `zoomable`. */ defaultZoom?: number; /** Fired whenever the zoom factor changes, by gesture, control or key. */ onZoomChange?: (zoom: number) => void; /** * Fired alongside `onSelect` with EVERY point index inside the pressed bubble. * A single place reports one index and an aggregated bubble reports all of its * members, so `onSelect`'s own meaning never silently changes. */ onSelectPlaces?: (indices: number[]) => void; /** E2E hook forwarded to the root element. */ testID?: string; /** Composition within a parent only, never a restyle hook and never a width: the parent layout container provides the bounds. */ style?: LayoutStyle; } /** Width / height of the generated viewBox, and so of the rendered map. */ export declare const GEO_MAP_ASPECT: number; import { type GeoMapBubble } from "./geo-map.bubbles.js"; export * from "./geo-map.bubbles.js"; /** * Project every point into the generated viewBox and size its bubble against * the largest count on the map. Pure, and exported for tests: geometry is * provable without a renderer (the chart-math.ts split), and the harness stubs * react-native-svg so nothing about the drawn circles is assertable from a DOM. */ export declare function geoMapBubbles(points: GeoMapPoint[]): GeoMapBubble[]; /** * The bubble under a press, or null for empty ocean. `x`/`y` are px within the * map and `scale` converts a viewBox unit to px, so the test is done in the * units the finger actually landed in. The nearest center wins, which is what * keeps a small bubble drawn over a large one reachable; a bubble smaller than * MIN_HIT still gets a finger-sized target. * * Pure, and exported for tests: the DOM harness cannot drive a real press with * coordinates through the hit layer (the `scrubEvent` precedent). */ export declare function bubbleAt(bubbles: GeoMapBubble[], x: number, y: number, scale: number): number | null; /** * The map's accessible name. A `role="img"` subtree is presentational, so a * screen reader user gets nothing from the bubbles themselves: the biggest * places have to be IN the name. It reads the title, then the top places by * count with their formatted values, then a "+N more" tail so the size of the * unread remainder is never hidden. */ export declare function geoMapAccessibleName(points: GeoMapPoint[], title: string | undefined, formatValue: (v: number) => string, /** The grouping currently DRAWN, when the map is aggregating. Omitted, or with * nothing merged, the name is byte-identical to what it always was. */ clusters?: readonly GeoMapCluster[]): string; /** Build a GeoMap from a platform skin. */ /** * The components a GeoMap draws with that look different per platform. The web * builds are the defaults; the iOS and Android entries pass their own, so the docs' * platform columns render them truthfully (a device resolves them by platform either way). */ export interface GeoMapParts { Button?: typeof WebButton; } export declare function createGeoMap(skin: ChartSkin, parts?: GeoMapParts): (props: GeoMapProps) => import("react").JSX.Element; //# sourceMappingURL=geo-map.shared.d.ts.map