import { type Vec2 } from '../../math'; import type { AxisConfig, ScaleType } from '../core/types'; export interface HistogramSeries { id?: string | number; values: readonly number[]; label?: string; color?: string; visible?: boolean; legend_group?: string; x_axis?: `x1` | `x2`; y_axis?: `y1` | `y2`; } export interface LegacyHistogramSeries extends Omit { values?: readonly number[]; y?: readonly number[]; x?: readonly number[]; line_style?: { stroke?: string; [key: string]: unknown; }; } export type HistogramSeriesInput = HistogramSeries | LegacyHistogramSeries; export declare const to_histogram_series: (input: HistogramSeriesInput) => HistogramSeries; type RangeLimit = [number | null, number | null]; export type HistogramNormalize = `count` | `probability` | `density`; export interface HistogramBin { x0: number; x1: number; count: number; value: number; } export interface BinnedSeries { id: string | number; series_idx: number; label: string; color: string; bins: HistogramBin[]; x_axis?: `x1` | `x2`; y_axis?: `y1` | `y2`; max_value: number; min_value: number; } export declare function log_safe_range(axis: Pick): RangeLimit; export declare function bin_values(values: ArrayLike, domain: Vec2, n_bins: number, scale_type?: ScaleType): { edges: Float64Array; counts: Uint32Array; }; export declare function normalize_counts(edges: Float64Array, counts: Uint32Array, normalize: HistogramNormalize): HistogramBin[]; interface HistogramBinConfig { x_domain: Vec2; x2_domain: Vec2; x_scale_type?: ScaleType; x2_scale_type?: ScaleType; bins: number; normalize?: HistogramNormalize; series_color: (series_data: HistogramSeries, series_idx: number) => string; } export declare function compute_histogram_bins(entries: readonly { series_data: HistogramSeries; series_idx: number; }[], config: HistogramBinConfig): BinnedSeries[]; export declare function compute_count_range(histograms: readonly Pick[], { scale_type, y_limit, range_padding, }: { scale_type: ScaleType; y_limit: RangeLimit; range_padding: number; }): Vec2; export {};