/** * Flow: what turns a connection into a direction. * * An arc says two places are related. It does not say which way anything moves, * and on a hub map every route leaves the same airport, so the reader cannot even * infer it. Beads travelling along the path say it without a legend, an arrowhead * or a second encoding. * * The mechanism is one dashed companion path per route, animated on * `stroke-dashoffset`, and the reason it is that rather than a dot moved from * JavaScript is arithmetic: a dash pattern only has to advance by one period to * loop seamlessly, so the duration is `spacing / speed` and the route's own * length never enters into it. Every route then travels at the same speed with no * measurement, which matters because measuring would mean `getTotalLength`, and * that exists in a browser but not in jsdom or on a server. * * Three consequences worth knowing: * * - The phase is a pure function of time, so panning and zooming cannot disturb * it. A dot driven per frame from a projected position has to be recomputed as * the camera moves, and any disagreement with the path underneath shows up as * drift along a 1px line. * - The dots ride `vector-effect: non-scaling-stroke` along with the route, so * their size and spacing stay constant in screen pixels at every zoom. * - `stroke-dashoffset` restarts the pattern at each subpath, and d3-geo cuts a * trans-Pacific arc in two at the antimeridian. The dots keep travelling in the * right direction across the seam, but not in step across it. That is the one * thing this approach cannot do and a per-frame dot can. * * An export catches the beads where they were: the pattern and the offset are both * ordinary stroke properties, so `export/Exporter` reads them off the live element * along with everything else, and a PNG of a travelling map matches the screen it * was taken from. * * @module series/flow */ import type { FlowOptions } from '../types'; import type { FlowSpec } from '../renderers/SvgRenderer'; /** * Resolve a series' `flow` option against one route. * * Returns undefined when flow is off, so a caller can spread the result into a * path spec and let the absence mean "no companion path". */ export declare function resolveFlow(flow: boolean | FlowOptions | undefined, { key, width, color }: { key: string; width: number; color: string; }): FlowSpec | undefined; //# sourceMappingURL=flow.d.ts.map