import type { GridContext } from '../core/grid-context'; import type { CellRange } from '../types/grid.types'; import type { ChartPanelType } from './chart-panel'; import { type ChartAggregation, type ChartModel } from './model/chart-model'; /** Parameters for {@link RangeChartService.createRangeChart}. */ export interface CreateRangeChartParams { /** * Grid cell range the chart is built from. For a single-range selection this * is the range; for a multi-range selection it should be the primary range, * with the full set passed via {@link CreateRangeChartParams.cellRanges}. */ readonly cellRange: CellRange; /** * All selected cell ranges when charting a multi-range (e.g. non-contiguous * column) selection. Their columns are unioned into the candidate pool. When * omitted, only {@link CreateRangeChartParams.cellRange} is used. */ readonly cellRanges?: readonly CellRange[]; /** Chart type. Defaults to the grid's `defaultChartType`, then `column-grouped`. */ readonly chartType?: ChartPanelType; /** Category (x-axis) column id. Auto-detected from the range when omitted. */ readonly categoryColId?: string; /** Series column ids. Auto-detected (numeric columns) when omitted. */ readonly seriesColIds?: readonly string[]; /** Aggregation for rows sharing a category. Defaults to `sum`. */ readonly aggregation?: ChartAggregation; /** When `true`, the floating panel is not opened (headless model only). */ readonly suppressPanel?: boolean; } /** * Owns every range chart in a grid. Seeds serializable {@link ChartModel}s from * cell ranges, constructs a {@link RangeChartController} per chart, routes the * GridApi chart surface, and disposes everything on grid teardown. */ export declare class RangeChartService { private readonly ctx; private readonly charts; private readonly hostEl; private nextId; constructor(ctx: GridContext); /** * Creates a range chart from a cell range and opens its panel. * * @param params - Range, type, and optional column roles. * @returns The new chart id, or an empty string when the range has no numeric * columns to plot. */ createRangeChart(params: CreateRangeChartParams): string; /** Serializable models for every live chart (for save / restore). */ getChartModels(): ChartModel[]; /** Applies a full model to an existing chart, matched by `chartId`. */ updateChart(model: ChartModel): void; /** Recreates a chart from a previously saved model, opening its panel. */ restoreChart(model: ChartModel): string; /** A data-URL image of a chart, or null if unknown. */ getChartImageDataURL(chartId: string, format?: 'png' | 'jpeg'): string | null; /** Triggers a browser download of a chart. */ downloadChart(chartId: string, format?: 'png' | 'jpeg'): void; /** Destroys a single chart. */ destroyChart(chartId: string): void; /** Destroys every chart. Called on grid teardown. */ disposeAll(): void; /** * Builds a default model from the params, auto-detecting the category and * series columns from the selection when the caller didn't specify them. * Collapses one or many cell ranges into a single ordered, de-duplicated pool * of candidate columns. Returns `null` when the selection contains no numeric * column to plot. */ private seedModel; /** * Unions the visible columns spanned by every cell range into a single list in * visible (left-to-right) order, without duplicates. Falls back to all visible * columns when the ranges resolve to an empty span. `O(ranges + columns)`. */ private collectRangeColumns; } //# sourceMappingURL=range-chart-service.d.ts.map