/** * Arc series: connections between places. * * The mark for airline routes, submarine cables, trade, migration and remittance * flows. Two things make this series either credible or embarrassing, and both are * handled here rather than left to the caller: * * 1. **Geodesics, on by default.** The shortest path between two places is a great * circle, not a straight line on a projected map. A Tokyo to New York route * really does arc over the Arctic, and drawing the straight line misstates both * the path and its length. * 2. **Antimeridian crossings.** A Tokyo to Los Angeles arc must leave the right * edge of the map and re-enter at the left, not streak backwards across the * whole world. Emitting the arc as a lon/lat LineString and letting d3-geo cut * it is what makes that correct for free, in every projection. * * Endpoints may be `[lon, lat]` pairs or geometry keys, so "route network between * these airports" and "trade between these countries" are both one line of config. * * @module series/Arc */ import { Scale } from '../scales/Scale'; import { SizeScale } from '../scales/SizeScale'; import { Viewport } from '../geo/Viewport'; import type { ArcSeriesOptions, LonLat, MarkItem, NormalizedGeo, WorldPoint } from '../types'; import type { PathSpec } from '../renderers/SvgRenderer'; export interface ArcItem extends MarkItem { from: LonLat; to: LonLat; /** Path data in world space, rebuilt whenever the projection changes. */ d: string; width: number; fromLabel?: string; toLabel?: string; } export declare class ArcSeries { static readonly type: "arc"; static readonly kind: "paths"; readonly type: "arc"; readonly kind: "paths"; readonly config: ArcSeriesOptions; readonly index: number; readonly id: string; readonly warnings: string[]; readonly items: ArcItem[]; readonly widthScale: SizeScale; readonly colorScale: Scale | null; /** * Class indices switched off from the legend. * * A muted class hides its routes rather than greying them, which is the * opposite of what a choropleth does with the same click, and for a reason: a * choropleth cannot remove a country, so it can only drain the colour out of * it, while a route is nothing but the datum. Fourteen grey lines left behind * would be the clutter the reader clicked to get rid of. */ readonly mutedClasses: Set; constructor({ config, geo, index, viewport, }: { config: ArcSeriesOptions; geo: NormalizedGeo; index: number; viewport: Viewport; }); /** * Rebuild path data. Called on construction and after any projection change, * because arc geometry is projection-dependent while its endpoints are not. */ reproject(viewport: Viewport): void; itemAt(index: number): ArcItem | undefined; colorFor(item: ArcItem): string; /** Whether the legend has switched off the class this route falls in. */ isMuted(item: ArcItem): boolean; paths(): PathSpec[]; /** Endpoint dots, drawn as screen-space symbols so they keep a constant size. */ endpoints(viewport: Viewport): { key: string; item: number; world: WorldPoint; radius: number; fill: string; }[]; legendTitle(): string | undefined; /** * Switch a legend class off, or back on. Returns the new muted state. * * A series with no `colorScale` has no classes and no swatches, so there is * nothing to toggle and the legend does not offer it. */ toggleClass(classIndex: number): boolean; legendItems(): never[]; describe(item: ArcItem): string; advise(): string[]; /** Resolve an endpoint that may be coordinates or a geometry key. */ private resolveEndpoint; } //# sourceMappingURL=Arc.d.ts.map