import type { GridContext } from '../core/grid-context'; import type { ChartToolbarItem, ChartToolPanelName } from '../types/grid.types'; import { type ChartPanelHost } from './chart-panel'; import type { ChartRenderOptions } from './chart-renderer'; import { type ChartColumnOption, type ChartToolPanelHost } from './chart-config/chart-tool-panel'; import { type ChartModel, type ChartModelPatch } from './model/chart-model'; /** * Owns a single range chart: its serializable {@link ChartModel}, the floating * {@link ChartPanel} view, the docked {@link ChartToolPanel}, and the grid * subscription that keeps a linked chart in sync with the data. * * Implements both {@link ChartPanelHost} (render options + toolbar actions) and * {@link ChartToolPanelHost} (model + column options for the config tabs), so * the two views can be pure and stateless. */ export declare class RangeChartController implements ChartPanelHost, ChartToolPanelHost { private readonly ctx; private readonly hostEl; private readonly onDestroyed; private model; private readonly panel; private toolPanel; private unsubscribeRows; /** * Unsubscribers for the grid-data events that drive live refresh * (`CELL_VALUE_CHANGED`, `DATA_CHANGED`). Held alongside {@link unsubscribeRows} * so unlink/dispose can release every subscription. */ private eventUnsubscribers; private refreshRaf; private disposed; constructor(ctx: GridContext, hostEl: HTMLElement, model: ChartModel, onDestroyed: (chartId: string) => void); /** Opens the chart and, for a linked chart, subscribes to grid data changes. */ start(): void; /** The current chart model (a frozen snapshot). */ getModel(): ChartModel; /** * Applies a model patch, rebuilds the chart, and notifies listeners. Central * mutation path for every config control and API `updateChart` call. */ updateModel(patch: ChartModelPatch): void; /** Rebuilds chart data from the latest grid rows. No-op when unlinked. */ refreshFromGrid(): void; /** Opens the configuration drawer inside the chart card, optionally on a tab. */ openToolPanel(tab?: ChartToolPanelName): void; /** Detaches the chart from the grid, freezing its current snapshot. */ unlink(): void; /** A data-URL snapshot of the chart. */ getImageDataURL(format?: 'png' | 'jpeg'): string | null; /** Triggers a browser download of the chart. */ downloadImage(format?: 'png' | 'jpeg'): void; /** Tears down the chart, its views, and its subscription. Idempotent. */ dispose(): void; getRenderOptions(size: { width: number; height: number; }): ChartRenderOptions; getToolbarItems(): ChartToolbarItem[]; isUnlinked(): boolean; onEditChart(): void; onAdvancedSettings(): void; onToggleLink(): void; onMove(_rect: DOMRect): void; onClose(): void; getColumnOptions(): ChartColumnOption[]; getPanels(): ChartToolPanelName[]; getDefaultPanel(): ChartToolPanelName; private buildData; /** * Restricts the source rows to the chart's selected cell range, so the chart * plots only the rows the user highlighted — not the entire data set. The * range is positional (indices into the current `visibleRows`), which keeps a * linked chart tracking the same slice as the grid is sorted or filtered. * * @param rows - The current full `visibleRows`. * @returns The rows within the selection's row bounds (inclusive). */ private rowsInRange; private subscribe; private teardownSubscription; /** Coalesces multiple grid updates in a frame into a single rebuild. */ private scheduleRefresh; } //# sourceMappingURL=range-chart-controller.d.ts.map