import { ChartConfig, ChartEventListener, ChartEventName, ChartMode, ChartUnsubscribe, DataRepresentation, MultiDatasetFormat, PartialChartConfig, ProcessedDataPoint, RawChartData } from '../types'; /** * Main StackedAreaChart class with fluent API */ export declare class StackedAreaChart { private config; private renderer; private currentData; private currentEnergySources; private currentColors; private containerId; private containerElement; private multiDataset; private emitter; private resizeObserver; private windowResizeHandler; private controlInputs; private destroyed; private readonly onControlChange; constructor(containerId: string, config: PartialChartConfig); /** * Setup chart structure with embedded controls */ private setupChartStructure; /** * Get the chart container element */ private getChartContainer; /** * Setup embedded controls */ private setupEmbeddedControls; /** * Attach event listeners to embedded controls */ private attachControlEventListeners; /** * Handle embedded control changes */ private handleControlChange; /** * Apply a mode/representation change, reload data, re-render and notify listeners * * The single committed-transition path. Both the embedded controls and * switchDataSource() route through it, which is what makes the trigger * discriminator on view.changed trustworthy. */ private applyView; /** * Report an error that occurred outside of a public method call * * Rethrows when the host has not subscribed, so behaviour is unchanged from * 2.0.0 for consumers that do not opt in. */ private emitError; /** * Register listeners supplied through configuration * Keep in sync with ChartEventMap when adding events */ private registerConfiguredListeners; /** * Load data for current settings from stored multi-dataset */ private loadDataForCurrentSettings; /** * Calculate container width automatically */ private calculateContainerWidth; /** * Calculate optimal height automatically */ private calculateOptimalHeight; /** * Setup responsive behavior for automatic resizing */ private setupResponsiveBehavior; /** * Update chart container width to match configuration */ private updateChartContainerWidth; /** * Set chart width */ width(value: number): this; /** * Set chart height */ height(value: number): this; /** * Set chart data - accepts either multi-dataset format or single array (backward compatibility) */ data(value: MultiDatasetFormat | RawChartData): this; /** * Check if data is in multi-dataset format */ private isMultiDatasetFormat; /** * Set chart mode (fuel or sector) */ mode(value: ChartMode): this; /** * Set data representation (fractional, perCapita, total) */ representation(value: DataRepresentation): this; /** * Update chart configuration */ configure(newConfig: PartialChartConfig): this; /** * Render the chart */ render(): this; /** * Update chart with new data */ update(): this; /** * Update data and re-render */ updateData(newData: MultiDatasetFormat | RawChartData): this; /** * Switch to different data source (synchronous - uses stored multi-dataset) */ switchDataSource(mode: ChartMode, representation: DataRepresentation): this; /** * Resize chart */ resize(width?: number, height?: number): this; /** * Destroy chart and clean up */ /** * Subscribe to a chart event * Returns an unsubscribe function, which is idempotent */ on(event: K, listener: ChartEventListener): ChartUnsubscribe; /** * Subscribe to a chart event for a single invocation * Returns a function that cancels it before it fires */ once(event: K, listener: ChartEventListener): ChartUnsubscribe; /** * Unsubscribe a listener, or all listeners for the event when none is given */ off(event: K, listener?: ChartEventListener): this; destroy(): void; /** * Get current configuration */ getConfig(): ChartConfig; /** * Get current processed data */ getData(): ProcessedDataPoint[]; /** * Get current energy sources */ getEnergySources(): string[]; /** * Get SVG element */ getSVG(): SVGSVGElement | null; /** * Check if chart has data */ hasData(): boolean; /** * Process raw data and store processed results */ private processAndStoreData; /** * Merge configurations with deep merge for nested objects */ private mergeConfig; } //# sourceMappingURL=StackedAreaChart.d.ts.map