import type { Canvas2D, Context2D } from "../canvas-types"; import type { PlotRect } from "../../layout/plot-layout"; import type { GradientStop } from "../../theme/gradient"; import type { Vec3 } from "../../theme/palette"; import type { Theme } from "../../theme/theme"; import type { TreeChartBase } from "./tree-chart"; /** * Click target for one breadcrumb segment. Tree-chart hit-testing * checks `_breadcrumbRegions` first so a click on the trail re-roots * the view to that ancestor. */ export interface BreadcrumbRegion { nodeId: number; x0: number; y0: number; x1: number; y1: number; } /** * Paint the ancestor-path strip across the top of a tree chart and * record per-crumb hit regions on `chart._breadcrumbRegions`. Mirrors * the structure used by both treemap and sunburst — they only differ * in their hover-highlight geometry, so this strip is shared verbatim. */ export declare function renderBreadcrumbs(chart: TreeChartBase & { _breadcrumbRegions: BreadcrumbRegion[]; }, ctx: Context2D, cssWidth: number, fontFamily: string, textColor: string): void; /** * Paint the lazy-tooltip box for a tree-chart node, anchored at * `(cx, cy)`. Returns early when no lines are cached for `nodeId` * (the lazy lookup hasn't resolved yet, or `nodeId` doesn't match the * currently-hovered target). Both treemap (rect-center) and sunburst * (arc-mid) charts only differ in how they compute the anchor. */ export declare function renderTreeTooltip(chart: TreeChartBase, ctx: Context2D, nodeId: number, cx: number, cy: number, cssWidth: number, cssHeight: number, fontFamily: string): void; /** * Paint a color legend (categorical swatches or numeric gradient bar) * for a tree chart. Shared by sunburst + treemap; both consult * `_colorMode` / `_uniqueColorLabels.size` / `_colorMin..max` the same * way. * * `categoricalRect`, when non-null, is used as the explicit rect for * the categorical-swatch variant (sunburst's faceted mode passes * `FacetGrid.legendRect` here). Numeric mode always derives from a * synthetic single-plot `PlotLayout` to match the legacy per-chart * branch — its gradient bar's vertical span doesn't fit the * categorical legend's compact rect. * * Returns silently when the color slot is empty, when categorical mode * has only one label, or when numeric mode has a degenerate * (`min >= max`) extent. */ export declare function renderTreeColorLegend(chart: TreeChartBase, canvas: Canvas2D, palette: Vec3[], stops: GradientStop[], theme: Theme, cssWidth: number, cssHeight: number, categoricalRect?: PlotRect | null): void;