import { OptionFactory } from '../echart'; import { HistogramEChartsOption, HistogramOptionFactoryInput, HistogramOptionsInput } from './types'; /** * Builds the **structural** ECharts option for a histogram widget — axes, * grid, tooltip, value-axis label formatter, themed legend. Mirrors * {@link import('../bar/options').barOptions} so the two widgets share v1 * look-and-feel: themed dark tooltip with positioner, CARTO color palette, * structural legend (`show` toggled by the merger based on series count), * y-axis labels rendered inside the plot via the `niceNum` closure pattern. * * Intentional deviations from bar (histogram-specific): * - **No `xAxis.axisLabel.formatter`.** Bin labels are pre-formatted in * the merger via `formatNumber(lo)–formatNumber(hi)` and optionally * the consumer's `labelFormatter`. The strings on the axis are * already display-ready, so there's nothing to post-format here. * - **Tooltip formatter reads the array-tuple row shape.** The dataset * uses positional `encode: { x: 0, y: 1 }`, so `item.value` comes in * as `[binLabel, count]` rather than bar's `{ name, value }` object. * * Intentionally data-agnostic: no series, no dataset, no x-axis category * data (those depend on data + ticks and are added by the option factory's * merge phase via {@link createHistogramOptionFactory}). */ export declare function histogramOptions({ theme, formatter, }: HistogramOptionsInput): HistogramEChartsOption; /** * Returns the histogram widget's {@link OptionFactory} — one closure that * owns BOTH phases of option construction: * * - **Structural phase** (`option == null`) — builds the theme-aware * structural option via {@link histogramOptions}, optionally merging * the consumer-supplied `optionsOverride`. Called once by Provider to * seed `rawOptions` in the store. * - **Merge phase** (`option != null`) — fuses post-pipeline `state.data` * (`HistogramWidgetData` — `number[][]`) into the option via the * dataset API. Each series gets its own dataset of `[binLabel, count]` * pairs derived from `ticks`; series reference their dataset by * `datasetIndex` and are encoded by column position. Reactive * `ctx.formatter` (driven by RelativeData → `%`) plus `niceMin`/`niceMax` * are re-derived here so the y-axis label formatter and the tooltip * pick up live store values, mirroring bar. */ export declare function createHistogramOptionFactory(options: HistogramOptionFactoryInput): OptionFactory;