import type { Marker, MarkerGroupBadge } from "../types"; import type { ProjectedMarker } from "./markers"; /** * Resolved {@link LiveChartProps.markerCluster} config (see `resolveMarkerCluster`). */ export interface ResolvedMarkerCluster { /** `"anchored"` = no collision handling (glyphs overlap). `"stacked"` = fan + * collapse co-located markers. */ mode: "anchored" | "stacked"; /** `"horizontal"` fans co-located glyphs sideways into an overlapping row; * `"vertical"` piles them into a column growing away from the line in each * glyph's `side` direction. */ direction: "horizontal" | "vertical"; /** Fraction (0–1) that adjacent co-located glyphs overlap when fanned. The fan * step is `glyphHeight * (1 - overlap)`; `glyphHeight` is a slightly generous * primitive estimate, so the *visible* overlap runs a touch lower. */ overlap: number; /** Extra px between a sided glyph and its anchor. */ gap: number; /** Collapse a co-located run to a single count badge once it exceeds this many. */ maxBeforeGroup: number; /** Cap a `"vertical"` column at this many glyphs: the newest overflow is * hidden instead of the column growing unbounded. */ maxVisible: number; /** What a collapsed group draws: `"count"` = the round count badge (default); * `"marker"` = the representative marker's own glyph; a {@link MarkerGroupBadge} * = a dedicated badge (custom image/icon) independent of the members. */ groupBadge: "count" | "marker" | MarkerGroupBadge; /** With `groupBadge: "marker"` or a dedicated badge, also stamp the member count * in the glyph's top-right corner. Ignored for `"count"`. */ showGroupCount: boolean; } export interface ClusterMarkersOpts { config: ResolvedMarkerCluster; /** Canvas-space y bounds (typically `0` / canvas height). When set, a * `"vertical"` column is additionally capped where the next glyph would * cross a bound, so a tall stack can't climb off the chart when its anchor * is already near the edge. The base slot always draws. */ minY?: number; maxY?: number; } /** * Estimated vertical (≈ horizontal) footprint of a marker glyph in px. Derived * from primitives only (no font metrics / atlas), so the hit-test hook and the * overlays compute identical offsets from identical inputs — keeping the drawn * and hit-tested positions in sync. Not pixel-exact with the atlas cell; the * generous default `markerHitRadius` absorbs the small difference. */ export declare function glyphHeight(m: Marker): number; /** * Collision pass over projected markers, mutating `proj` in place. * * `"anchored"` mode only applies each marker's {@link Marker.side} offset (a lone * glyph sitting above/below its anchor); it does no bucketing, so charts that * don't use `side` are untouched. `"stacked"` mode additionally buckets * co-located markers (same side, overlapping x/y) and fans or collapses them. * * Runs every frame on the UI thread, so grouping is zoom/scroll-reactive. Reads * the *raw* projected positions from `projectMarkers` and overwrites them. */ export declare function clusterMarkers(markers: Marker[], proj: ProjectedMarker[], opts: ClusterMarkersOpts): void; /** * Markers belonging to the collapsed cluster whose representative is `repIndex` * (ordered by time). Call after {@link clusterMarkers} has populated `proj`. */ export declare function clusterMembers(markers: Marker[], proj: ProjectedMarker[], repIndex: number): Marker[]; //# sourceMappingURL=markerCluster.d.ts.map