import { OptionFactory } from '../echart'; import { BarEChartsOption, BarOptionFactoryInput, BarOptionsInput } from './types'; /** * Builds the **structural** ECharts option for a bar widget — axes, grid, * tooltip styling, themed legend. Intentionally data-agnostic: no series, * no dataset, no `legend.show` (those depend on data and are added by the * option factory's merge phase). This separation is what lets data-side * pipeline transforms (Searcher, RelativeData) drive the rendered chart — * the merge happens at render time inside the Echart bridge. * * Styling matches the v1 `barConfig` look-and-feel: minimal axes (only * min/max y-labels rendered inside the plot via `niceNum`), themed tooltip, * scroll legend, and CARTO color palette. The y-axis min/max + label * formatter and the tooltip formatter are wired here for the no-data case; * {@link createBarOptionFactory} re-derives them at fusion time so reactive * formatter changes (RelativeData) and stack templates (StackToggle) flow * through to the chart. */ export declare function barOptions({ theme, formatter, labelFormatter, }: BarOptionsInput): BarEChartsOption; /** * Returns the bar widget's {@link OptionFactory} — a single closure that * handles BOTH option-construction phases: * * - **Structural phase** (`option == null`) — builds the theme-aware * structural option via {@link barOptions}, optionally merging the * consumer-supplied `optionsOverride` on top. Called once by Provider * to seed `rawOptions` in the store; configTransforms (StackToggle / * ZoomToggle / BrushToggle) then mutate it via the pipeline middleware. * - **Merge phase** (`option != null`) — fuses post-pipeline `state.data` * (`BarWidgetData`) into the option via the dataset API: one dataset * per series, each series referencing its dataset by index, encoded * by `name` (x) and `value` (y). Spreads any series-template fields * already on the incoming option (e.g. `{ stack: 'total' }` from * `addStack`) into every emitted series so configTransforms compose * end-to-end. Reactive `ctx.formatter` / `ctx.labelFormatter` drive * the y-axis min/max-only label and the tooltip formatter at fusion * time so RelativeData's percent formatter flows through without a * structural rebuild. * * Stable identity when the inputs don't change (consumers should wrap the * call in `useMemo` keyed on the same inputs). */ export declare function createBarOptionFactory(options: BarOptionFactoryInput): OptionFactory;