import { LitElement, PropertyValues } from 'lit';
import { Priority } from '../../navigation-instruments/types.js';
/**
 * `<obc-pie-chart>` – A customizable pie chart component for visualizing proportional data as segments, with optional sunburst subsegments and outer labels.
 *
 * This component renders an interactive pie chart powered by Chart.js, displaying data segments as arcs with optional outer labels and a sunburst mode for hierarchical data. It supports customizable colors, percentage or unit display, and adapts its layout based on available space. Labels are hidden when the chart is too small (< 192px height), ensuring clarity at all sizes.
 *
 * ## Features
 * - **Fixed Height ⇒ Fixed Circumference:** The chart's circumference is determined by the `fixedHeight` property (default: 320px). This ensures the donut's circumference remains consistent and matches other radial instruments, regardless of the available browser or container width. The chart does not scale to fill the width; instead, it always uses the specified fixed height to define its size and circumference.
 * - **Layout:**
 *   - Full 360° pie chart layout.
 * - **Outer Labels:**
 *   - Optional labels positioned outside the chart showing segment names and values.
 *   - Supports percentage or custom units (e.g., "kW", "kg", "MB").
 *   - Configurable decimal places and maximum label length (with trimming).
 * - **Sunburst Mode:**
 *   - Enable hierarchical data display with interactive subsegments (children) as an outer ring.
 *   - Click a segment to expand/collapse its children in the sunburst ring.
 * - **Customization:**
 *   - Custom segment colors (with automatic fallback to theme palette).
 *   - Adjustable outer label formatting and units.
 * - **Color Priority:** Set `priority` to `Priority.enhanced` to use the blue/enhanced
 *   color palette instead of the default gray/regular palette (default: `Priority.regular`).
 * - **Responsive Behavior:**
 *   - Automatically hides labels when height < 192px.
 *   - Maintains aspect ratio and adjusts padding for optimal label positioning.
 * - **Theme Integration:**
 *   - Colors update automatically when the `data-obc-theme` attribute changes on the `<html>` element.
 *   - Example:
 *     ```
 *     <html lang="en" data-obc-theme="day"></html>
 *     ```
 *
 * ## Example
 *
 * **Basic Usage**
 * ```html
 * <obc-pie-chart></obc-pie-chart>
 * <script>
 *   document.querySelector('obc-pie-chart').data = [
 *     {label: 'A', value: 50},
 *     {label: 'B', value: 30},
 *     {label: 'C', value: 20}
 *   ];
 * </script>
 * ```
 *
 * **With Sunburst Subsegments**
 * ```html
 * <obc-pie-chart></obc-pie-chart>
 * <script>
 *   const chart = document.querySelector('obc-pie-chart');
 *   chart.sunburst = true;
 *   chart.data = [
 *     {label: 'A', value: 50, children: [
 *       {label: 'A1', value: 30},
 *       {label: 'A2', value: 20}
 *     ]},
 *     {label: 'B', value: 30}
 *   ];
 * </script>
 * ```
 *
 * **Custom Colors and Units**
 * ```html
 * <obc-pie-chart></obc-pie-chart>
 * <script>
 *   const chart = document.querySelector('obc-pie-chart');
 *   chart.showOuterLabels = true;
 *   chart.outerLabelUnit = 'kW';
 *   chart.outerLabelDecimalPlaces = 2;
 *   chart.data = [
 *     {label: 'Critical', value: 20},
 *     {label: 'Warning', value: 35},
 *     {label: 'Normal', value: 45}
 *   ];
 *   chart.colors = ['#e74c3c', '#f39c12', '#2ecc71'];
 * </script>
 * ```
 *
 * @property {Array<{label: string, value: number, children?: Array<{label: string, value: number}>}>} data - Chart data segments with optional children subsegments for sunburst mode (set via JavaScript)
 * @property {string[]} colors - Custom segment colors (set via JavaScript) with fallback to theme palette
 * @property {boolean} showOuterLabels - Show outer labels, default: false
 * @property {boolean} showUnit - Whether to show unit in labels, default: false
 * @property {boolean} sunburst - Enable sunburst mode with interactive children subsegments, default: false
 * @property {string} outerLabelUnit - Unit string to append to outer labels, default: "%"
 * @property {number} outerLabelMaxLength - Maximum character length for labels before trim (0 = no limit), default: 0
 * @property {number} outerLabelDecimalPlaces - Number of decimal places in labels, default: 0
 * @property {boolean} showDebugOverlay - Show debug overlay for development, default: false
 * @property {number} fixedHeight - Fixed height of the chart in pixels (mandatory, determines chart circumference), default: 320. The chart's circumference is always based on this fixed height to match other radial instruments.
 * @property {boolean} legend - Whether to display the legend below the chart, default: false
 */
export declare class ObcPieChart extends LitElement {
    data: {
        label: string;
        value: number;
        children?: {
            label: string;
            value: number;
        }[];
    }[];
    colors: string[];
    priority: Priority;
    showOuterLabels: boolean;
    showUnit: boolean;
    sunburst: boolean;
    outerLabelUnit: string;
    outerLabelMaxLength: number;
    outerLabelDecimalPlaces: number;
    legend: boolean;
    showDebugOverlay: boolean;
    fixedHeight: number;
    /** @internal */
    private total;
    /** @internal - Pre-formatted labels for outer label rendering */
    private formattedLabels;
    /** @internal */
    private activeSegmentIndex;
    /** @internal */
    private canvasEl?;
    /** @internal */
    private legendDiv?;
    /** @internal */
    private chart?;
    /** @internal */
    private themeObserver?;
    /** @internal - ResizeObserver for tracking height threshold crossings */
    private resizeObserver?;
    /** @internal - Track previous state to detect threshold crossing */
    private wasAboveThreshold;
    private hasAnyChanged;
    /**
     * Get layout configuration for canvas calculation
     */
    private getLayoutConfig;
    willUpdate(changed: PropertyValues): void;
    updated(changed: PropertyValues): void;
    firstUpdated(): void;
    disconnectedCallback(): void;
    /**
     * Setup resize observer to detect when fixedHeight property changes programmatically
     * (e.g., via Storybook controls or user code)
     */
    private setupResizeObserver;
    /** @internal */
    private handleCanvasClick;
    private setupSunburstInteraction;
    private removeSunburstInteraction;
    private prepareChartData;
    /**
     * Get Chart.js options using centralized fixed height layout calculation
     */
    private getChartOptions;
    private createOuterLabelPiePlugin;
    private createChart;
    private createSunburstPlugin;
    private updateChart;
    /**
     * Update only chart colors without recreating the entire chart
     * Used by theme observer for efficient theme changes
     */
    private updateChartColors;
    /**
     * Update the legend HTML content
     */
    private updateLegend;
    render(): import('lit-html').TemplateResult<1>;
    static styles: import('lit').CSSResult[];
}
declare global {
    interface HTMLElementTagNameMap {
        'obc-pie-chart': ObcPieChart;
    }
}
//# sourceMappingURL=pie-chart.d.ts.map