/** * Deterministic SVG charts. * * Common chart types are rendered as SVG rather than with a charting library: * no dependency, no network, and byte-identical output. Every chart also emits a * text summary and a data table, so the values are available to assistive * technology and to anyone who cannot read the plot. * * All geometry is rounded to two decimals before it reaches the markup, because * floating-point noise would otherwise break byte-determinism across engines. * * Colour never appears here: shapes carry a series class (`ak-chart-s0` … * `ak-chart-s5`) and the stylesheet maps each class onto the theme accent and * hue rotations of it, so a chart always follows the active preset and colour * scheme and no two series share a colour. * * This module owns the original kinds and the original figure. A chart with * `encoded` set (a later kind, a dataset binding or an overlay) is rendered by * `chart-figure-encoded.ts`, which reuses the bar and line drawing below. */ import { type Frame, type TickBounds } from './chart-scales.js'; import { type NumberFormatter } from './chart-svg-parts.js'; import type { ChartInput, ChartSeries } from './chart-types.js'; import { escapeAttribute } from './escape.js'; export type { ChartInput, ChartSeries } from './chart-types.js'; /** * How a bar or line chart scales and labels its values. The original kinds use * `defaultCartesian`; encoded charts pass their own frame, bounds and format. */ export interface CartesianOptions { frame: Frame; bounds: TickBounds; /** Gridlines and value ticks, already drawn for this frame and bounds. */ grid: string; format: NumberFormatter; title: (label: string, series: ChartSeries, index: number) => string; } /** Fragment-safe id prefix for gradients, derived from the block id. */ export declare function gradientId(input: ChartInput, seriesIndex: number): string; export declare function barChart(input: ChartInput, options?: CartesianOptions): string; export declare function lineChart(input: ChartInput, area: boolean, options?: CartesianOptions): string; /** A sparkline is a trend glyph, so it scales to its own data range, not to zero. */ export declare function sparkline(input: ChartInput): string; export declare function radialChart(input: ChartInput, donut: boolean): string; export declare function progressFrame(rows: number): Frame; export declare function progressChart(input: ChartInput, format?: NumberFormatter): string; /** Render one chart block as a figure containing SVG, a summary, and a table. */ export declare function renderChart(input: ChartInput): string; /** Escape helper re-exported for chart consumers that build their own chart markup. */ export { escapeAttribute }; //# sourceMappingURL=charts.d.ts.map