import type { Datum } from "../shared/datumTypes";
import * as React from "react";
import type { StreamOrdinalFrameProps, StreamOrdinalFrameHandle } from "../../stream/ordinalTypes";
import type { LegendInteractionMode } from "../shared/hooks";
import type { BaseChartProps, ChartAccessor, CategoryFormatFn } from "../shared/types";
import { type TooltipProp } from "../../Tooltip/Tooltip";
import type { RealtimeFrameHandle } from "../../realtime/types";
/**
 * LikertChart — visualize Likert scale survey responses.
 *
 * Supports two data formats:
 *
 * **Raw responses** — each row is one respondent's answer:
 * ```
 * [{ question: "Q1", score: 4 }, { question: "Q1", score: 2 }, ...]
 * ```
 * Set `valueAccessor` to the integer score field. Scores are mapped to
 * `levels` by index (score 1 → levels[0], score 2 → levels[1], …).
 *
 * **Pre-aggregated** — each row is a (question, level, count) triple:
 * ```
 * [{ question: "Q1", level: "Agree", count: 45 }, ...]
 * ```
 * Set `levelAccessor` and `countAccessor`.
 *
 * **Orientation:**
 * - `"horizontal"` (default) — diverging bar chart centered at 0%.
 *   Negative levels extend left, positive right. If `levels` has an odd
 *   count, the center level is split 50/50 across the centerline and drawn
 *   in a neutral color. Even counts split cleanly at the midpoint.
 * - `"vertical"` — stacked 100% bar chart, levels stacked bottom-to-top.
 *
 * **Important:** The diverging layout assigns meaning by position in the
 * `levels` array. The first half is treated as "negative", the second half
 * as "positive", and (if odd) the middle entry as "neutral". If your data
 * doesn't follow this low-to-high convention, the chart will misrepresent
 * the polarity.
 */
export interface LikertChartProps<TDatum extends Datum = Datum> extends BaseChartProps {
    data?: TDatum[];
    /** Question / item accessor — the ordinal axis. */
    categoryAccessor?: ChartAccessor<TDatum, string>;
    /**
     * Integer score accessor (raw response mode).
     * Scores are 1-based: score 1 maps to levels[0], score 2 to levels[1], etc.
     * Mutually exclusive with levelAccessor/countAccessor.
     */
    valueAccessor?: ChartAccessor<TDatum, number>;
    /**
     * Level name accessor (pre-aggregated mode).
     * Each value must match an entry in `levels`.
     */
    levelAccessor?: ChartAccessor<TDatum, string>;
    /**
     * Count/frequency accessor (pre-aggregated mode). Defaults to "count".
     */
    countAccessor?: ChartAccessor<TDatum, number>;
    /**
     * Ordered response labels from most negative to most positive.
     * Example (5-point): ["Strongly Disagree", "Disagree", "Neutral", "Agree", "Strongly Agree"]
     * Example (4-point): ["Strongly Disagree", "Disagree", "Agree", "Strongly Agree"]
     *
     * Odd count → center level is neutral. Even count → clean negative/positive split.
     */
    levels?: string[];
    /**
     * "horizontal" (default): diverging bar chart centered at 0%.
     * "vertical": stacked 100% bar chart.
     */
    orientation?: "horizontal" | "vertical";
    /**
     * One color per level. Should match the length of `levels`.
     * For diverging orientation, use a diverging palette (red→neutral→blue).
     */
    colorScheme?: string[];
    categoryLabel?: string;
    valueLabel?: string;
    valueFormat?: (d: number | string) => string;
    barPadding?: number;
    enableHover?: boolean;
    showGrid?: boolean;
    showCategoryTicks?: boolean;
    showLegend?: boolean;
    legendInteraction?: LegendInteractionMode;
    legendPosition?: "right" | "left" | "top" | "bottom";
    tooltip?: TooltipProp;
    annotations?: Datum[];
    /** Custom formatter for category tick labels */
    categoryFormat?: CategoryFormatFn;
    /** Fixed value-axis domain `[min, max]`. Either bound may be `undefined` to leave that side data-derived. Likert is normally pinned to symmetric proportions; pass `valueExtent` to override. */
    valueExtent?: [number | undefined, number | undefined] | [number];
    frameProps?: Partial<Omit<StreamOrdinalFrameProps, "data" | "size">>;
}
export interface LikertChartHandle extends RealtimeFrameHandle {
    getScales(): ReturnType<NonNullable<StreamOrdinalFrameHandle["getScales"]>>;
}
/**
 * LikertChart - Diverging stacked bars for ordered survey responses.
 *
 * Each category (question) gets a horizontal bar where positive responses
 * extend right and negative responses extend left, centered on the
 * midpoint of the `levels` ordering. Best for 5-point or 7-point Likert
 * scales where you want to see net sentiment at a glance.
 *
 * Two data shapes are supported: pre-aggregated (one row per
 * category × level via `levelAccessor` + `countAccessor`) or raw
 * observations (one row per response via `valueAccessor`).
 *
 * @example
 * ```tsx
 * // Pre-aggregated: question × level × count
 * <LikertChart
 *   data={[
 *     { question: "Easy to use", level: "Strongly Agree", count: 12 },
 *     { question: "Easy to use", level: "Agree",          count: 30 },
 *     { question: "Easy to use", level: "Neutral",        count: 8 },
 *     { question: "Easy to use", level: "Disagree",       count: 4 },
 *     { question: "Easy to use", level: "Strongly Disagree", count: 1 },
 *   ]}
 *   categoryAccessor="question"
 *   levelAccessor="level"
 *   countAccessor="count"
 *   levels={["Strongly Disagree", "Disagree", "Neutral", "Agree", "Strongly Agree"]}
 * />
 * ```
 *
 * @example
 * ```tsx
 * // Raw observations: one row per response
 * <LikertChart
 *   data={surveyResponses}
 *   categoryAccessor="question"
 *   valueAccessor="response"
 *   levels={["Never", "Rarely", "Sometimes", "Often", "Always"]}
 *   colorScheme="RdYlGn"
 * />
 * ```
 */
export declare const LikertChart: {
    <TDatum extends Datum = Datum>(props: LikertChartProps<TDatum> & React.RefAttributes<LikertChartHandle>): React.ReactElement | null;
    displayName?: string;
};
