import type { Canvas2D } from "../charts/canvas-types"; import type { PlotLayout, PlotRect } from "../layout/plot-layout"; import { type GradientStop } from "../theme/gradient"; import type { Theme } from "../theme/theme"; /** * Render a vertical color gradient legend on the Canvas2D overlay. * Only call when a color column is active. When `colorDomain` crosses * zero the 50% stop (sign pivot) is annotated with a tick + `0` label. * * Per-facet wrapper; computes the anchor from `layout` and delegates * to {@link renderLegendAt}. Facet grids render one shared gradient * legend and pass an explicit rect to `renderLegendAt` directly. */ export declare function renderLegend(canvas: Canvas2D, layout: PlotLayout, colorDomain: { min: number; max: number; label: string; }, stops: GradientStop[], theme: Theme, formatter?: (v: number) => string): void; /** * Render a gradient legend at an explicit canvas-absolute rect. * Used by facet grids that paint one legend for the whole grid and * by single-plot charts through {@link renderLegend}. */ export declare function renderLegendAt(canvas: Canvas2D, rect: PlotRect, colorDomain: { min: number; max: number; label: string; }, stops: GradientStop[], theme: Theme, formatter?: (v: number) => string): void; /** * Render a categorical legend with discrete colored swatches. * Used when split_by or string color columns produce distinct categories. * * The per-facet wrapper; computes the anchor from `layout` and delegates * to {@link renderCategoricalLegendAt}. Facet grids that render one * shared legend pass an explicit rect to `renderCategoricalLegendAt` * directly. */ export declare function renderCategoricalLegend(canvas: Canvas2D, layout: PlotLayout, labels: Map, palette: [number, number, number][], theme: Theme): void; /** * Render a categorical legend at an explicit canvas-absolute rect. * Used by facet grids that paint one legend for the whole grid and by * single-plot charts through {@link renderCategoricalLegend}. */ export declare function renderCategoricalLegendAt(canvas: Canvas2D, rect: PlotRect, labels: Map, palette: [number, number, number][], theme: Theme): void;