import { ReactNode } from 'react'; import { CardLegend, ChartLegendSwatch, ChartLoadingStyle, ChartEmptyState, CategorySelection } from '../types'; import { ChartCardProps } from './chart-card'; import { ObservationPrism } from './prism'; import { CardRange } from './cartesian-card'; export type { ObservationPrism } from './prism'; /** Shared presentation options for observation-based cards. */ export interface ObservationsCardProps extends Omit { title?: string; header?: boolean; data?: readonly Row[]; height?: number; depth?: boolean; color?: string; headline?: number; aggregate?: 'sum' | 'mean' | 'max'; delta?: number; deltaTone?: 'default' | 'inverse' | 'neutral'; range?: string; ranges?: readonly CardRange[]; defaultRange?: string; valueFormat?: Intl.NumberFormatOptions; locale?: string; formatValue?: (value: number) => string; legend?: CardLegend | false; legendSwatch?: ChartLegendSwatch; loading?: boolean; loadingStyle?: ChartLoadingStyle; /** * What the card shows when the period has no data: `dots` (default), the chart's own `shape`, * your own element such as `No visits yet`, or `null` for nothing. */ empty?: ChartEmptyState; onSelectionChange?: (selection: CategorySelection | null) => void; /** Optional consumer-owned readout, also available when the header is hidden. */ renderReadout?: (selection: CategorySelection | null) => ReactNode; } export interface ObservationMark { id: string; label: string; datum: Row | null; value: number | null; x: number; y: number; width: number; height: number; color: string; group?: string; /** Neighbour mark IDs retained when this mark is inspected. */ related?: readonly string[]; text?: string; detail?: string; /** Extra context alongside the formatted numeric value; detail instead replaces it. */ description?: string; shape?: 'dot' | 'bar' | 'tile' | 'prism' | 'point' | 'ribbon'; /** Closed SVG silhouette in local coordinates; also used for exact pointer hit testing. */ ribbon?: string; /** Degrees clockwise about the mark's bottom centre, so a bar can point away from a centre. */ rotate?: number; /** Stacking order where hit areas overlap: higher layers sit in front. */ layer?: number; /** 0 to 1: where the mark falls in the order the chart builds, for entry and skeleton waves. */ wave?: number; /** `grow` rises from the mark's foot; `drop` falls into place from above. */ enter?: 'grow' | 'drop'; /** A square prism seen from above, filling the mark's box: its top sits `lift` above the floor. */ prism?: ObservationPrism; missing?: boolean; future?: boolean; } export interface ObservationScene { marks: ObservationMark[]; /** Keep every segment of an inspected series lit. */ highlightGroup?: boolean; /** A family-specific resting summary, calculated from accepted data. */ headline?: number | null; /** Shapes painted under the marks, in order; `group` mutes with the active mark's group. */ paths?: { id: string; d: string; fill?: string; stroke?: string; group?: string; /** Endpoint IDs: this path stays lit when either endpoint is inspected. */ related?: readonly string[]; /** `rise` grows up from the shape's baseline; `draw` strokes along the path. */ enter?: 'rise' | 'draw'; /** 0 to 1: the order shapes build in. */ wave?: number; /** The shape it grows from on entry, such as a surface laid flat on its floor. */ from?: string; /** 0 lit to 1 in shade, so the placeholder keeps the scene's light. */ shade?: number; }[]; labels?: { x: number; y: number; text: string; anchor?: 'start' | 'middle' | 'end'; }[]; /** All readings, including observations with no visible area or position. */ readings?: { id: string; label: string; value: number | null; detail?: string; description?: string; }[]; groups?: { id: string; label: string; color: string; value: number | null; }[]; note?: string; error?: string; height?: number; width?: number; } export declare const seriesColor: (index: number) => string; export declare const readField: (row: unknown, key: string) => unknown; export declare const readNumber: (row: unknown, key: string) => number | null; /** Private shell: every family uses the same inspection, card and skeleton lifecycle. */ export declare function ObservationsCard({ title, header, data: suppliedData, height, depth, headline, aggregate, delta, deltaTone, range, ranges, defaultRange, valueFormat, locale, formatValue, legend, legendSwatch, loading, loadingStyle, empty: emptyState, onSelectionChange, renderReadout, motion, className, color, layout, placeholder, family, scope, renderControls, ...frame }: ObservationsCardProps & { family: string; scope?: string; renderControls?: (scene: ObservationScene, active: ObservationMark | undefined) => ReactNode; layout: (data: readonly Row[], width: number, height: number) => ObservationScene; placeholder: (width: number, height: number) => ObservationScene; }): import("react/jsx-runtime").JSX.Element;