import { AreamapChartDataOptions, BoxplotChartDataOptions, CalendarHeatmapChartDataOptions, CartesianChartDataOptions, CategoricalChartDataOptions, IndicatorChartDataOptions, KpiChartDataOptions, KpiComparison, PivotTableDataOptions, SankeyChartDataOptions, ScatterChartDataOptions, ScattermapChartDataOptions, TableDataOptionsInternal } from '../../../../domains/visualizations/core/chart-data-options/types.js'; import { Panel } from '../../../../domains/widgets/components/widget-by-id/types.js'; import type { GenericDataOptions } from '../../../../types.js'; import { ScattermapStyleOptions } from '../../../../types.js'; /** * Builds DTO panels for a line chart widget. The category panel is named `x-axis`, * matching the Fusion convention for line/area charts. * * @param dataOptions - Cartesian chart data options from the WidgetModel * @returns Fusion panels: x-axis, values, break by * @internal */ export declare function toLinePanels(dataOptions: CartesianChartDataOptions): Panel[]; /** * Builds DTO panels for an area chart widget. The category panel is named `x-axis`, * matching the Fusion convention for line/area charts. * * @param dataOptions - Cartesian chart data options from the WidgetModel * @returns Fusion panels: x-axis, values, break by * @internal */ export declare function toAreaPanels(dataOptions: CartesianChartDataOptions): Panel[]; /** * Builds DTO panels for a bar chart widget. The category panel is named `categories`. * * @param dataOptions - Cartesian chart data options from the WidgetModel * @returns Fusion panels: categories, values, break by * @internal */ export declare function toBarPanels(dataOptions: CartesianChartDataOptions): Panel[]; /** * Builds DTO panels for a column chart widget. The category panel is named `categories`. * * @param dataOptions - Cartesian chart data options from the WidgetModel * @returns Fusion panels: categories, values, break by * @internal */ export declare function toColumnPanels(dataOptions: CartesianChartDataOptions): Panel[]; /** * Builds DTO panels for a polar chart widget. The category panel is named `categories`. * * @param dataOptions - Cartesian chart data options from the WidgetModel * @returns Fusion panels: categories, values, break by * @internal */ export declare function toPolarPanels(dataOptions: CartesianChartDataOptions): Panel[]; /** * Builds the single `columns` panel for a table widget. Attributes are emitted first, * then measure columns, preserving the order produced by {@link getTableAttributesAndMeasures}. * * @param dataOptions - Internal table data options from the WidgetModel * @returns Single-element array with the `columns` panel * @internal */ export declare function toTablePanels(dataOptions: TableDataOptionsInternal): Panel[]; /** * Builds DTO panels for an indicator widget. Emits `value`, `min`, `max`, and `secondary` * panels in that order; a panel is emitted even when its backing list is empty so that * the DTO panel order is stable across widgets. * * @param dataOptions - Indicator chart data options from the WidgetModel * @returns Fusion panels: value, min, max, secondary * @internal */ export declare function toIndicatorPanels(dataOptions: IndicatorChartDataOptions): Panel[]; /** * Builds DTO panels for a pie chart widget. Category items carry `format.members` when * a flat `seriesToColorMap` is present so per-slice colors round-trip. * * @param dataOptions - Categorical chart data options from the WidgetModel * @returns Fusion panels: categories, values * @internal */ export declare function toPiePanels(dataOptions: CategoricalChartDataOptions): Panel[]; /** * Builds DTO panels for a funnel chart widget. Category items carry `format.members` when * a flat `seriesToColorMap` is present so per-step colors round-trip. * * @param dataOptions - Categorical chart data options from the WidgetModel * @returns Fusion panels: categories, values * @internal */ export declare function toFunnelPanels(dataOptions: CategoricalChartDataOptions): Panel[]; /** * Builds DTO panels for a sunburst chart widget. Each category item carries the nested * `format.members` entry matching its column title so per-level colors round-trip. * * @param dataOptions - Categorical chart data options from the WidgetModel * @returns Fusion panels: categories, values * @internal */ export declare function toSunburstPanels(dataOptions: CategoricalChartDataOptions): Panel[]; /** * Builds DTO panels for a treemap chart widget. The measures panel is renamed to `size` * and an extra `color` panel is emitted (see {@link toTreemapColorPanel}) so Fusion can * restore the per-value color assignments. * * @param dataOptions - Categorical chart data options from the WidgetModel * @returns Fusion panels: categories, size, color * @internal */ export declare function toTreemapPanels(dataOptions: CategoricalChartDataOptions): Panel[]; /** * Builds DTO panels for a scatter chart widget. All panels declared by the Fusion * scatter manifest are always emitted (in this exact order: x-axis, y-axis, point, * Break By / Color, size), even when no column is configured — Fusion's renderer * accesses panels by name and throws "the panel '' was not found" when a * declared panel is missing. Slots without a column are emitted with `items: []`. * * Slot names are remapped to Fusion's conventions: `x`→`x-axis`, `y`→`y-axis`, * `breakByPoint`→`point`, `breakByColor`→`Break By / Color`, `size`→`size`. * * When a flat `seriesToColorMap` is present and `breakByColor` has a column, its * entries are attached to the `Break By / Color` item as `format.members` so * Fusion restores the per-series colors on round-trip. * * @param dataOptions - Scatter chart data options from the WidgetModel * @returns Fusion panels in fixed order; every declared panel is always present * @internal */ export declare function toScatterPanels(dataOptions: ScatterChartDataOptions): Panel[]; /** * Builds DTO panels for a pivot table widget: `rows`, `columns`, and `values` (in that * order). Rows and columns are treated as attributes; values as measures. Grand totals * live on the style in the DTO and are written separately by * {@link toPivotTableWidgetStyle}. * * @param dataOptions - Pivot table data options from the WidgetModel * @returns Fusion panels: rows, columns, values * @internal */ export declare function toPivotTablePanels(dataOptions: PivotTableDataOptions): Panel[]; /** * Builds DTO panels for a scattermap chart widget. All panels declared by the * Fusion scattermap manifest are always emitted (in this exact order: `geo`, * `color`, `size`, `details`), even when a slot has no column — Fusion's * renderer accesses panels by name and throws "the panel '' was not found" * when a declared panel is missing. Slots without a column are emitted with * `items: []`. * * Each geo item carries its `geoLevel` when the styled column supplies one so * the country/state/city level round-trips. `color` holds a single measure * (range-colored in Fusion), `size` holds a single measure, `details` holds a * single attribute or measure. * * The size panel item additionally carries `format.size = { min, max }` when * marker-size options are provided. Fusion reads `items[0].format.size.min/max` at widget load and overwrites * `style.markers.size.min/max`, so this item-level format is the source of truth * for rendered marker sizes — emitting the style alone is not enough. * * @param dataOptions - Scattermap chart data options from the WidgetModel * @param markerSize - Optional marker-size options from WidgetModel.styleOptions.markers.size * @returns Fusion panels in fixed order; every declared panel is always present * @internal */ export declare function toScattermapPanels(dataOptions: ScattermapChartDataOptions, markerSize?: NonNullable['size']): Panel[]; /** * Builds DTO panels for an areamap chart widget. All panels declared by the * Fusion areamap manifest are always emitted (in this exact order: `geo`, * `color`), even when a slot has no column — Fusion's renderer accesses panels * by name and throws "the panel '' was not found" when a declared panel * is missing. Slots without a column are emitted with `items: []`. * * The geo slot is a single attribute (country/state). The color slot is a * single measure; Fusion's manifest range-colors it at render time. * * @param dataOptions - Areamap chart data options from the WidgetModel * @returns Fusion panels in fixed order; every declared panel is always present * @internal */ export declare function toAreamapPanels(dataOptions: AreamapChartDataOptions): Panel[]; /** * Builds DTO panels for a boxplot chart widget. Emits `category` (0 or 1 attribute) * and `value` (the single target numeric attribute, treated as an attribute — not a * measure — to match the inverse read in `extractBoxplotChartDataOptions`). The * derived box/whisker measures live on `style.whisker` rather than on panels, so * they are written by {@link toBoxplotWidgetStyle} instead. * * @param dataOptions - Boxplot chart data options from the WidgetModel * @returns Fusion panels in fixed order: category, value * @internal */ export declare function toBoxplotPanels(dataOptions: BoxplotChartDataOptions): Panel[]; /** * Builds DTO panels for a sankey chart widget. The Fusion sankey manifest declares * `category` (2+ attributes) and `value` (single measure) panels — both are always * emitted, matching the inverse read in {@link extractSankeyChartDataOptions}. * * @param dataOptions - Sankey chart data options from the WidgetModel * @returns Fusion panels in fixed order: category, value * @internal */ export declare function toSankeyPanels(dataOptions: SankeyChartDataOptions): Panel[]; /** * Builds DTO panels for a kpi widget: `value` (always), `category` (when set), and a * comparison panel driven by `dataOptions.comparison.type`: * - `'target'` → a `target` panel, from either a measure column or a fixed number * (see {@link toFixedTargetPanelItem}) * - `'delta'` → a `comparisonValue` panel * - `'previous-period'` → no panel; the `kpi/previous-period` subtype carries it on its own, * with the baseline read from the `category` panel's preceding bucket * - `'value'` → the same `comparisonValue` panel; `kpi/value` distinguishes it from `'delta'` * * Inverse of {@link extractKpiChartDataOptions} / {@link extractKpiComparison}. * * @param dataOptions - Kpi chart data options from the WidgetModel * @returns Panels for the `kpi` widget DTO * @internal */ /** * Whether a `'target'` comparison can be written to a Fusion `target` panel. * * A measure column always can. A number can only when it is finite: `NaN` and `Infinity` * have no valid constant-formula form, and writing `{ formula: 'NaN' }` would produce a panel * the query engine rejects — worse than the old behaviour of dropping it. Callers that place * the panel and callers that pick the `kpi/goal` subtype must agree, so both ask this rather * than re-deriving the rule. * * @param comparison - The kpi comparison from the widget model's data options * @returns true when a `target` panel should be emitted * @internal */ export declare function isSerializableKpiTarget(comparison: KpiChartDataOptions['comparison']): comparison is Extract; export declare function toKpiPanels(dataOptions: KpiChartDataOptions): Panel[]; /** * Builds DTO panels for a calendar-heatmap widget. The Fusion `heatmap` manifest declares * `date` (single attribute) and `color` (single measure) panels — both are always emitted, * matching the inverse read in {@link extractCaledarHeatmapChartDataOptions}: an empty * `items: []` array is written when a slot has no column so Fusion's renderer can locate * each declared panel by name. * * Note: the DTO panel name for the measure slot is `color`, not `value` — the SDK's * {@link CalendarHeatmapChartDataOptions.value} is read from / written to the panel named * `color`. * * @param dataOptions - Calendar heatmap chart data options from the WidgetModel * @returns Fusion panels: date, color * @internal */ export declare function toCalendarHeatmapPanels(dataOptions: CalendarHeatmapChartDataOptions): Panel[]; /** * Builds DTO panels for a plugin / custom widget. Each key in {@link GenericDataOptions} * becomes one panel; every Column is normalised then converted to a JAQL panel item via * the same helper chart widgets use, so the DTO round-trips through `fromWidgetDto` * without further translation. The `filters` key is reserved by the DTO schema and * emitted separately from `widgetModel.filters`, so it is skipped here. * * @param dataOptions - Generic data options keyed by the plugin's input names * @returns One Fusion panel per declared input * @internal */ export declare function toCustomWidgetPanels(dataOptions: GenericDataOptions | undefined): Panel[];