/** * SVG fragments every chart kind shares: gridlines and ticks, category * labels, hover value labels and axis titles. Colour never appears here; * shapes carry classes and the stylesheet maps them onto tokens. */ import { type Frame, type TickBounds } from './chart-scales.js'; import type { ChartSeries, KindRender } from './chart-types.js'; export type NumberFormatter = (value: number) => string; /** Horizontal gridlines with value ticks; the zero line reads as the axis. */ export declare function gridAndTicks(bounds: TickBounds, frame: Frame, format?: NumberFormatter): string; /** * Gridlines for an encoded axis whose author bounds need not land on a step: * ticks stop at the last step inside the bounds, and the plot floor is drawn * as the axis when zero is outside the range. */ export declare function boundedGridAndTicks(bounds: TickBounds, frame: Frame, format: NumberFormatter): string; /** Vertical gridlines and tick labels for a numeric x axis. */ export declare function numericXTicks(bounds: TickBounds, frame: Frame, format: NumberFormatter, ticks?: readonly number[]): string; /** * At most about eight evenly spaced label positions. The first and the last * category are always labelled, so a series never reads as ending early; when * the last would crowd the previous kept label, that one gives way. */ export declare function thinnedLabelIndexes(count: number): number[]; export declare function categoryLabels(labels: string[], position: (index: number) => number, frame: Frame): string; export declare function pointTitle(label: string, series: ChartSeries, index: number): string; /** * A value label drawn directly after its mark. The stylesheet reveals it while * the mark is hovered or focused (`mark:hover + .ak-chart-value`), so the exact * number is one pointer move away without a tooltip script. */ export declare function valueLabel(x: number, y: number, value: number): string; /** * A hover value label with preformatted text. `halo` outlines it in the * surface colour, for labels drawn over a filled mark. */ export declare function textValueLabel(x: number, y: number, text: string, halo?: boolean): string; /** Axis titles: the y title above the value ticks, the x title centred under the categories. */ export declare function axisTitles(frame: Frame, x: string | undefined, y: string | undefined): string; /** A rectangle as a path, so golden tests can pin its geometry in one attribute. */ export declare function rectPath(x: number, y: number, width: number, height: number): string; /** Bars wider than this read as slabs rather than marks. */ export declare const MAX_BAR_WIDTH = 56; /** The index of a category label, or undefined when the axis has no such category. */ export declare function categoryIndex(labels: readonly string[], x: string | number): number | undefined; /** Overlay coordinates for a cartesian plot. */ export declare function plotFor(frame: Frame, bounds: TickBounds, xAt: (x: string | number) => number | undefined): NonNullable; /** Shorten text to `max` characters with an ellipsis. */ export declare function clipText(text: string, max: number): string; //# sourceMappingURL=chart-svg-parts.d.ts.map