/** * D3 Axis Polyfill - Lightweight SVG axis generators. * * This is a drop-in replacement for d3-axis, implementing only the methods * used in the Vega chart rendering system: axisBottom and axisLeft. * * @see VD-5022 - [Zero Dependencies] remove d3 dependency */ /** * The domain type for axis scales. */ export declare type AxisDomain = string | number | Date | { valueOf(): number; }; /** * The scale interface required by axis generators. */ export interface AxisScale { (value: Domain): number | undefined; domain(): Domain[]; domain(domain: Domain[]): this; range(): number[]; range(range: number[]): this; ticks?(count?: number): Domain[]; tickFormat?(...args: unknown[]): (d: Domain) => string; bandwidth?(): number; copy?(): AxisScale; } /** * An axis generator that renders tick marks, labels, and a domain line into an SVG element. * Mimics d3's Axis interface with .ticks(), .tickFormat(), and callable behavior. */ export interface Axis { (selection: any): void; ticks(count: number): Axis; tickFormat(formatter: (d: Domain) => string): Axis; } /** * Creates a bottom-oriented axis generator. Mimics d3.axisBottom(). * * @template Domain * @param {AxisScale} scale - The scale to use. * @returns {Axis} An Axis callable that renders into a element. */ export declare function axisBottom(scale: AxisScale): Axis; /** * Creates a left-oriented axis generator. Mimics d3.axisLeft(). * * @template Domain * @param {AxisScale} scale - The scale to use. * @returns {Axis} An Axis callable that renders into a element. */ export declare function axisLeft(scale: AxisScale): Axis;