import { default as React } from 'react'; import { ColorPalette } from '../../types.js'; /** * Co-located helpers shared by the Cartesian time-series charts (Line, Area). * * These extract the heavier inline logic that previously lived inside the chart * components — the clickable/drill dot renderer, the comparison-mode tick and * label formatters, and the series-key → measure-field resolution — so the * component bodies stay focused on chart composition. Pure extraction: no * behaviour change. */ export interface DataPointClickPayload { dataPoint: any; clickedField: string; xValue: any; position: { x: number; y: number; }; nativeEvent: React.MouseEvent; } interface DrillDotOptions { /** Recharts dot props (cx, cy, payload, key). */ props: any; color: string; drillEnabled?: boolean; originalField?: string; seriesKey: string; onDataPointClick?: (payload: DataPointClickPayload) => void; } /** * Render a single data-point dot. When drill is enabled and a click handler is * present, renders a larger clickable dot with a surface-coloured backing * circle to mask grid lines; otherwise a small plain dot. Returns null when the * point has no coordinates. * * `renderPlain` controls whether a small non-interactive dot is drawn when * drill is disabled (Line draws one; Area returns nothing). */ export declare function renderDrillDot({ props, color, drillEnabled, originalField, seriesKey, onDataPointClick, renderPlain }: DrillDotOptions & { renderPlain: boolean; }): React.ReactElement | null; /** * Build the comparison-mode X-axis tick formatter for time-series charts. * Returns undefined when not in comparison mode (no custom formatting). */ export declare function makeComparisonTickFormatter(hasComparisonData: boolean, chartData: any[], queryObject: any, xAxisField: string): ((value: string | number, index: number) => string) | undefined; /** * Build the comparison-mode tooltip label formatter for time-series charts. * Returns undefined when not in comparison mode (no custom formatting). */ export declare function makeComparisonLabelFormatter(hasComparisonData: boolean, queryObject: any, xAxisField: string): ((label: any, payload: any) => string) | undefined; /** * Resolve effective stacking for the Area chart from `stackType` (new) / * `stacked` (legacy), disabling stacking when a right axis is present (areas on * different axes can't be stacked). */ export declare function resolveAreaStacking(displayConfig: { stackType?: string; stacked?: boolean; } | undefined, hasRightAxis: boolean): { effectiveShouldStack: boolean; effectiveIsPercentStack: boolean; stackOffset: 'expand' | undefined; }; /** Build a map from series display label to original measure field name. */ export declare function buildSeriesKeyToFieldMap(yAxisFields: string[], getFieldLabel: (field: string) => string): Record; /** * Resolve a series key back to its original measure field, handling comparison * suffixes like "(Current)" / "(Prior)" and dimension prefixes ("Dim - Label"). */ export declare function makeSeriesKeyResolver(seriesKeyToField: Record): (seriesKey: string) => string | undefined; /** Pick a series colour by index, preferring the palette then the defaults. */ export declare function getSeriesColor(colorPalette: ColorPalette | undefined, index: number): string; interface LineSeriesOptions { seriesKeys: string[]; colorPalette?: ColorPalette; resolveField: (seriesKey: string) => string | undefined; yAxisAssignment: Record; hoveredLegend: string | null; connectNulls: boolean; drillEnabled?: boolean; onDataPointClick?: (payload: DataPointClickPayload) => void; /** Comparison styling (omit/false → standard series). */ hasComparisonData?: boolean; periodLabels?: string[]; priorPeriodStyle?: 'solid' | 'dashed' | 'dotted'; priorPeriodOpacity?: number; } /** Render all line series for the Line chart. */ export declare function renderLineSeries(opts: LineSeriesOptions): React.ReactElement[]; interface AreaSeriesOptions { seriesKeys: string[]; colorPalette?: ColorPalette; seriesKeyToField: Record; yAxisAssignment: Record; hoveredLegend: string | null; connectNulls: boolean; shouldStack: boolean; drillEnabled?: boolean; onDataPointClick?: (payload: DataPointClickPayload) => void; } /** Render all area series for the Area chart. */ export declare function renderAreaSeries(opts: AreaSeriesOptions): React.ReactElement[]; export interface TimeSeriesShape { chartData: any[]; seriesKeys: string[]; effectiveXAxisKey: string; hasComparisonData: boolean; periodLabels: string[]; } /** * Shape raw rows for a Cartesian time-series chart. In comparison mode this * uses the overlay transform (aligned by period day index); otherwise the * standard series transform. Centralises the branch so the chart body stays * flat. */ export declare function buildTimeSeriesData(args: { data: any[]; xAxisField: string; yAxisFields: string[]; seriesFields: string[]; queryObject: any; getFieldLabel: (field: string) => string; }): TimeSeriesShape; export {};