import "./line_chart.css"; import type * as React from "react"; import { useRender } from "@base-ui/react/use-render"; import { type StyleProps } from "./style_props"; export interface LineChartPoint { x: string | number; y: number; } export interface LineChartSeries { key: string; /** Its legend entry and accessible name. */ label: string; /** Omit for the next colour in the chart's order. */ color?: string; points: LineChartPoint[]; } /** * A running total, for S-curves. Stop an actual series at the last real period so it ends rather * than dropping to zero. */ export declare function cumulativePoints(points: readonly LineChartPoint[]): LineChartPoint[]; /** * Every counted day is a point on both lines, so they compare at one x. Actual ends at its last * stated day; drawn on, it would flatline and read as a stall. A row with no day is on no point. */ export declare function plannedActualSeries(rows: readonly T[], read: { when: (row: T) => string | null | undefined; planned: (row: T) => number | null | undefined; actual: (row: T) => number | null | undefined; }): { planned: LineChartPoint[]; actual: LineChartPoint[]; }; interface LineChartBaseProps extends StyleProps { /** The chart's height under its legend — the plot and the x labels under it — in px; default 200. The * caller's, because height balances a chart against the card beside it; a picture drawn to a fixed body * passes the body's room, and the chart keeps inside it. */ height?: number; formatNumber?: (n: number) => string; formatXLabel?: (x: string | number) => string; emptyLabel?: string; /** Defaults on for several series, off for one. */ legend?: boolean; testID?: string; ref?: React.Ref; render?: useRender.RenderProp; } /** A union, so passing both or neither fails to compile. */ export type LineChartProps = LineChartBaseProps & ({ points: LineChartPoint[]; series?: undefined; lineColor?: string; } | { series: LineChartSeries[]; points?: undefined; lineColor?: undefined; }); /** * The canonical SVG line chart: `points` for one line, `series` for several on one shared y-scale. * A tiny inline trend is `Sparkline`. */ export declare function LineChart(props: LineChartProps): React.ReactElement>; export {};