import { EChartsOption } from 'echarts'; export type ChartType = "line" | "area" | "bar" | "scatter" | "bubble" | "pie" | "donut" | "gauge" | "radar" | "heatmap" | "histogram" | "gantt" | "candlestick" | "boxplot" | "treemap" | "sunburst" | "funnel" | "sankey" | "waterfall" | "rose"; export type ChartTheme = "astro-dark" | "astro-light" | "purple-hue"; export interface DataPoint { /** X-axis value (time, category, or number) */ x: number | string | Date; /** Y-axis value */ y: number; /** Optional label */ label?: string; /** Optional category for grouping */ category?: string; /** Optional color for this data point (used in scatter/pie/donut/histogram charts) */ color?: string; /** Optional metadata */ meta?: Record; } export interface TimeSeriesPoint { /** Timestamp (Unix ms or Date) */ time: number | Date; /** Value */ value: number; /** Optional metadata */ meta?: Record; } export interface SeriesData { /** Unique series identifier */ id: string; /** Display name */ name: string; /** Data points (heatmap uses [x, y, value][]) */ data: DataPoint[] | TimeSeriesPoint[] | number[] | [number, number][] | [number, number, number][]; /** Series type override */ type?: ChartType; /** Series color (uses theme palette if not specified) */ color?: string; /** Y-axis index for dual-axis charts */ yAxisIndex?: number; /** Line style options */ lineStyle?: LineStyleOptions; /** Area style options */ areaStyle?: AreaStyleOptions; /** Symbol/marker options */ symbol?: SymbolOptions; /** Whether to show in legend */ showInLegend?: boolean; /** Stack group name (for stacked charts) */ stack?: string; /** Smooth line */ smooth?: boolean | number; /** * Property key for auto-configuration (e.g., 'temperature', 'battery') * Auto-provides icon, unit, and thresholds from PROPERTY_PRESETS */ property?: string; /** * Icon name to display in legend and tooltips * Overrides property preset icon */ icon?: string; /** * Unit of measurement (e.g., '°C', 'W', '%') * Overrides property preset unit */ unit?: string; /** * Status thresholds for auto-deriving status from latest value * Overrides property preset thresholds */ thresholds?: { /** Value at or above which status becomes 'critical' */ critical?: number; /** Value at or above which status becomes 'serious' */ serious?: number; /** Value at or above which status becomes 'caution' */ caution?: number; /** Value at or below which status becomes 'caution' */ cautionLow?: number; /** Value at or below which status becomes 'critical' */ criticalLow?: number; }; /** * Override status (bypasses auto-derivation) */ status?: "off" | "standby" | "normal" | "caution" | "serious" | "critical"; } export interface LineStyleOptions { width?: number; type?: "solid" | "dashed" | "dotted"; opacity?: number; dashOffset?: number; } export interface AreaStyleOptions { opacity?: number; color?: string | GradientOptions; } export interface GradientOptions { type: "linear" | "radial"; colorStops: Array<{ offset: number; color: string; }>; direction?: "vertical" | "horizontal"; } export interface SymbolOptions { type?: "circle" | "rect" | "roundRect" | "triangle" | "diamond" | "pin" | "arrow" | "none"; size?: number | [number, number]; color?: string; borderColor?: string; borderWidth?: number; } export interface AxisOptions { /** Axis type */ type?: "value" | "category" | "time" | "log"; /** Axis name/label */ name?: string; /** Name location */ nameLocation?: "start" | "middle" | "end"; /** Minimum value (auto if not specified) */ min?: number | "auto" | "dataMin"; /** Maximum value (auto if not specified) */ max?: number | "auto" | "dataMax"; /** Axis position */ position?: "left" | "right" | "top" | "bottom"; /** Show grid lines */ showGrid?: boolean; /** Show axis line */ showLine?: boolean; /** Show axis labels */ showLabels?: boolean; /** Label formatter */ labelFormatter?: (value: number | string) => string; /** Split number (approximate tick count) */ splitNumber?: number; /** Inverse axis direction */ inverse?: boolean; /** Unit suffix for labels */ unit?: string; /** Split line (grid) options */ splitLine?: { show?: boolean; }; } export interface ZoomOptions { /** Enable zoom */ enabled?: boolean; /** Zoom type */ type?: "inside" | "slider" | "both"; /** Zoom axis */ axis?: "x" | "y" | "both"; /** Initial zoom range (0-100) */ start?: number; end?: number; /** Minimum zoom span */ minSpan?: number; /** Maximum zoom span */ maxSpan?: number; } export interface TooltipOptions { /** Enable tooltip */ enabled?: boolean; /** Trigger type */ trigger?: "item" | "axis" | "none"; /** Show crosshair */ crosshair?: boolean | "x" | "y" | "both"; /** Custom formatter */ formatter?: (params: unknown) => string; /** Confine tooltip to chart area */ confine?: boolean; } export interface LegendOptions { /** Show legend */ show?: boolean; /** Legend position */ position?: "top" | "bottom" | "left" | "right"; /** Legend orientation */ orient?: "horizontal" | "vertical"; /** Allow clicking to toggle series */ interactive?: boolean; /** Maximum items per row/column */ itemsPerLine?: number; } export interface BrushOptions { /** Enable brush selection */ enabled?: boolean; /** Brush type */ type?: "rect" | "polygon" | "lineX" | "lineY"; /** Brush mode */ mode?: "single" | "multiple"; } export interface MarkLineOptions { /** Mark line data */ data: Array<{ /** Line type */ type?: "min" | "max" | "average" | "median"; /** Fixed Y value */ yAxis?: number; /** Fixed X value */ xAxis?: number | string; /** Label */ label?: string; /** Line style */ lineStyle?: LineStyleOptions; /** Line color */ color?: string; }>; } export interface MarkAreaOptions { /** Mark area data */ data: Array<[ { xAxis?: number | string; yAxis?: number; name?: string; }, { xAxis?: number | string; yAxis?: number; } ]>; /** Area style */ itemStyle?: { color?: string; opacity?: number; }; } export interface AnnotationOptions { /** Mark lines (thresholds, averages) */ markLines?: MarkLineOptions; /** Mark areas (regions, events) */ markAreas?: MarkAreaOptions; /** Mark points */ markPoints?: Array<{ coord: [number | string, number]; name?: string; symbol?: string; symbolSize?: number; itemStyle?: { color?: string; }; }>; } export interface RealTimeOptions { /** Enable real-time mode */ enabled?: boolean; /** Maximum data points to keep */ maxPoints?: number; /** Time window in milliseconds */ timeWindow?: number; /** Animation duration for updates */ animationDuration?: number; /** Whether to shift data (sliding window) */ shift?: boolean; } /** Context passed to getExportFileName for dynamic filename generation */ export interface ExportFileNameContext { /** Chart title */ title?: string; /** Chart subtitle */ subtitle?: string; /** Series display names in order */ seriesNames: string[]; /** Chart type (line, area, bar, etc.) */ chartType: string; } export interface ExportOptions { /** Enable export button */ enabled?: boolean; /** Export formats (png, jpeg, svg for image; csv, json for data) */ formats?: ("png" | "jpeg" | "jpg" | "svg" | "csv" | "json")[]; /** Static file name prefix (overridden by getExportFileName if provided) */ fileName?: string; /** Dynamic filename from chart title, series names, and type */ getExportFileName?: (context: ExportFileNameContext) => string; /** Image scale factor */ pixelRatio?: number; /** Background color for export */ backgroundColor?: string; } /** * Info tooltip configuration for chart header * Shows an info icon (ⓘ) in top-right corner that reveals helpful information */ export interface InfoTooltipOptions { /** Tooltip content - can be string or React node */ content: string | React.ReactNode; /** Custom icon (defaults to info circle) */ icon?: React.ReactNode; /** Tooltip position */ position?: "top" | "bottom" | "left" | "right"; /** Maximum width of tooltip content */ maxWidth?: number; } /** Status types for chart header icon */ export type ChartStatus = "off" | "standby" | "normal" | "caution" | "serious" | "critical"; export interface AstroChartProps { /** Chart type */ type: ChartType; /** Series data */ series: SeriesData[]; /** Chart title */ title?: string; /** Chart subtitle */ subtitle?: string; /** * Icon name to display in chart header (uses AstroIcon) * Shows before the chart title */ icon?: string; /** * Status for the header icon (shows as colored dot) * Uses AstroUXDS status colors */ iconStatus?: ChartStatus; /** * Status message shown on hover over the status icon */ statusMessage?: string; /** * Show status badge in header (for bold/minimal themes) * Displays status label text alongside the accent line * @default false */ showStatusBadge?: boolean; /** Chart width (default: 100%) */ width?: number | string; /** Chart height (default: 400px) */ height?: number | string; /** X-axis options */ xAxis?: AxisOptions; /** Y-axis options (single or array for dual axis) */ yAxis?: AxisOptions | AxisOptions[]; /** Tooltip options */ tooltip?: TooltipOptions; /** Legend options */ legend?: LegendOptions; /** Zoom/pan options */ zoom?: ZoomOptions; /** Brush selection options */ brush?: BrushOptions; /** Annotations (mark lines, areas, points) */ annotations?: AnnotationOptions; /** Real-time streaming options */ realTime?: RealTimeOptions; /** Export options */ export?: ExportOptions; /** Loading state */ loading?: boolean; /** Empty state message */ emptyMessage?: string; /** Theme override */ theme?: ChartTheme; /** * Info tooltip shown as ⓘ icon in top-right corner * SDK developers can define this to provide contextual help */ infoTooltip?: InfoTooltipOptions; /** * Hide chart axes (useful for pie, donut, gauge, radar) * When true, removes axis lines, labels, and grid */ hideAxes?: boolean; /** * Compact axis mode - hides axis name labels by default for more chart space. * Axis names are shown on hover tooltip instead. * Set to false to always show axis name labels. * @default true */ compactAxes?: boolean; /** Custom ECharts options (advanced) */ echartsOptions?: Partial; /** * ECharts renderer: 'svg' gives sharper text (recommended); 'canvas' can be faster for very large datasets. * @default 'svg' */ renderer?: "canvas" | "svg"; /** Chart instance ref callback */ onChartReady?: (chart: unknown) => void; /** Click handler */ onClick?: (params: ChartEventParams) => void; /** Hover handler */ onHover?: (params: ChartEventParams) => void; /** Zoom change handler */ onZoomChange?: (params: ZoomEventParams) => void; /** Brush selection handler */ onBrushSelect?: (params: BrushEventParams) => void; /** Custom CSS class */ className?: string; /** Custom inline styles */ style?: React.CSSProperties; /** ARIA label for accessibility */ ariaLabel?: string; } export interface ChartEventParams { /** Event type */ type: string; /** Series index */ seriesIndex?: number; /** Series name */ seriesName?: string; /** Data index */ dataIndex?: number; /** Data value */ value?: number | string | number[]; /** Data name */ name?: string; /** Original event */ event?: MouseEvent; } export interface ZoomEventParams { /** Start percentage (0-100) */ start: number; /** End percentage (0-100) */ end: number; /** Start value */ startValue?: number | string; /** End value */ endValue?: number | string; } export interface BrushEventParams { /** Selected areas */ areas: Array<{ coordRange: [number, number][]; coordRanges: [number, number][][]; }>; /** Selected series data */ selected: Array<{ seriesIndex: number; dataIndex: number[]; }>; } export interface ChartPreset { /** Preset name */ name: string; /** Base chart type */ type: ChartType; /** Default options */ defaults: Partial; /** Series transformer */ transformSeries?: (series: SeriesData[]) => SeriesData[]; /** Options transformer */ transformOptions?: (options: EChartsOption) => EChartsOption; } /** Power system chart data */ export interface PowerChartData { time: number; solarPower: number; batteryPercent: number; netPower: number; consumption: number; eclipse?: boolean; voltage?: number; } /** Attitude chart data */ export interface AttitudeChartData { time: number; roll: number; pitch: number; yaw: number; pointingError?: number; angularVelocity?: number; } /** Thermal chart data */ export interface ThermalChartData { time: number; zones: Record; averageTemp?: number; } /** Link budget chart data */ export interface LinkBudgetChartData { time: number; signalStrength: number; noiseFloor: number; margin: number; elevation?: number; } /** Telemetry stream point */ export interface TelemetryStreamPoint { timestamp: number; parameter: string; value: number; unit?: string; /** Status using AstroUXDS terminology */ status?: "normal" | "caution" | "serious" | "critical"; } /** Contact window / pass data (Gantt-style) */ export interface ContactWindowData { /** Ground station or asset ID */ id: string; /** Display name */ name: string; /** Contact windows */ windows: { start: number; end: number; elevation?: number; signalQuality?: "good" | "marginal" | "poor"; label?: string; }[]; } /** Spectrum / waterfall data point */ export interface SpectrumDataPoint { /** Frequency bin (Hz or normalized) */ frequency: number; /** Power/amplitude (dBm or dB) */ power: number; /** Timestamp for waterfall */ time?: number; } /** Maneuver / delta-V budget data */ export interface ManeuverBudgetData { /** Maneuver name */ name: string; /** Delta-V (m/s) */ deltaV: number; /** Type category */ type: "planned" | "executed" | "remaining" | "margin"; /** Optional date */ date?: number; } /** Eclipse / sunlight timeline data */ export interface EclipseTimelineData { /** Start time (ms) */ start: number; /** End time (ms) */ end: number; /** Eclipse type */ type: "umbra" | "penumbra" | "sunlight"; /** Orbit number */ orbitNumber?: number; } /** Bubble chart data point */ export interface BubbleDataPoint { /** X value */ x: number | string | Date; /** Y value */ y: number; /** Bubble size */ size: number; /** Optional color category */ category?: string; /** Label */ label?: string; } /** Rose diagram data (polar histogram for directional data) */ export interface RoseDiagramData { /** Direction/angle (degrees, 0-360) */ direction: number; /** Magnitude/frequency */ magnitude: number; /** Optional category label */ category?: string; } /** Heliocentric orbit data */ export interface HeliocentricOrbitData { /** Body/spacecraft name */ name: string; /** X coordinate (AU or km) */ x: number; /** Y coordinate (AU or km) */ y: number; /** Z coordinate (AU or km) - for 3D visualization */ z?: number; /** Orbit path points (for ellipse) - 2D or 3D */ orbitPath?: { x: number; y: number; z?: number; }[]; /** Body type */ type?: "planet" | "spacecraft" | "comet" | "asteroid" | "satellite" | "station" | "probe" | "debris"; /** Optional color */ color?: string; /** Optional size */ size?: number; /** Optional description/metadata for tooltip */ description?: string; /** Semi-major axis (AU) - for orbital info */ semiMajorAxis?: number; /** Orbital period (days) */ period?: number; /** Inclination (degrees) - for 3D orbit tilt */ inclination?: number; } /** 3D data point for scatter3D, bar3D, etc. */ export interface Data3DPoint { /** X coordinate */ x: number; /** Y coordinate */ y: number; /** Z coordinate */ z: number; /** Optional value (for color mapping, sizing) */ value?: number; /** Optional label */ label?: string; /** Optional category */ category?: string; /** Optional color override */ color?: string; /** Optional size override */ size?: number; /** Optional metadata */ meta?: Record; } /** Scatter3D chart data - for constellation visualization, debris fields */ export interface Scatter3DData { /** Unique identifier */ id: string; /** Display name */ name: string; /** 3D data points */ data: Data3DPoint[]; /** Optional symbol size (or function) */ symbolSize?: number | ((value: number[]) => number); /** Optional color (or gradient) */ color?: string; /** Category for grouping */ category?: string; } /** Bar3D chart data - for telemetry comparisons across satellites/time */ export interface Bar3DData { /** X-axis value (category: satellite name, subsystem, etc.) */ x: string | number; /** Y-axis value (category: time period, parameter, etc.) */ y: string | number; /** Z-axis value (height/magnitude) */ z: number; /** Optional color */ color?: string; /** Optional label */ label?: string; } /** Surface3D chart data - for signal strength maps, thermal surfaces */ export interface Surface3DData { /** 2D array of z-values [x][y] -> z */ data: number[][]; /** X-axis range [min, max] */ xRange?: [number, number]; /** Y-axis range [min, max] */ yRange?: [number, number]; /** Color map name */ colorMap?: "jet" | "viridis" | "plasma" | "inferno" | "magma" | "thermal" | "custom"; /** Custom color stops for 'custom' colorMap */ colorStops?: Array<{ offset: number; color: string; }>; /** Wireframe mode */ wireframe?: boolean; } /** Globe chart data - for Earth visualization with satellites */ export interface GlobeData { /** Satellites/objects in orbit */ satellites?: Array<{ id: string; name: string; latitude: number; longitude: number; altitude: number; color?: string; size?: number; category?: string; }>; /** Ground stations */ groundStations?: Array<{ id: string; name: string; latitude: number; longitude: number; color?: string; size?: number; }>; /** Ground tracks (satellite paths) */ groundTracks?: Array<{ id: string; name: string; path: Array<{ latitude: number; longitude: number; }>; color?: string; }>; /** Coverage areas (footprints) */ coverageAreas?: Array<{ id: string; name: string; polygon: Array<{ latitude: number; longitude: number; }>; color?: string; opacity?: number; }>; /** Communication/link lines */ links?: Array<{ from: { latitude: number; longitude: number; altitude?: number; }; to: { latitude: number; longitude: number; altitude?: number; }; color?: string; lineWidth?: number; }>; } /** Lines3D chart data - for debris trajectories, satellite links */ export interface Lines3DData { /** Unique identifier */ id: string; /** Display name */ name: string; /** 3D path points */ path: Array<{ x: number; y: number; z: number; }>; /** Line color */ color?: string; /** Line width */ lineWidth?: number; /** Line style */ lineStyle?: "solid" | "dashed" | "dotted"; /** Show endpoints */ showEndpoints?: boolean; /** Category for grouping */ category?: string; } export interface ChartRegistry { presets: Map; themes: Map; register: (name: string, preset: ChartPreset) => void; get: (name: string) => ChartPreset | undefined; } export interface ChartSyncGroup { /** Group ID */ id: string; /** Chart instances */ charts: Set; /** Sync tooltip */ syncTooltip?: boolean; /** Sync zoom */ syncZoom?: boolean; /** Sync crosshair */ syncCrosshair?: boolean; } export interface ChartSyncOptions { /** Group ID to join */ groupId?: string; /** Sync features */ sync?: { tooltip?: boolean; zoom?: boolean; crosshair?: boolean; }; } /** Single data point for waterfall/spectrogram display */ export interface WaterfallDataPoint { /** Timestamp */ time: number | Date; /** Frequency values (Hz) */ frequencies: number[]; /** Power levels (dBm) at each frequency */ powers: number[]; } /** Signal marker for waterfall display */ export interface WaterfallSignalMarker { /** Marker ID */ id: string; /** Frequency (Hz) */ frequency: number; /** Bandwidth (Hz) */ bandwidth?: number; /** Signal name/label */ label: string; /** Marker color */ color?: string; } /** Doppler track data point */ export interface DopplerTrackPoint { /** Timestamp */ time: number | Date; /** Doppler shift (Hz) */ dopplerShift: number; /** Optional elevation angle */ elevation?: number; } /** Satellite pass info for Doppler tracking */ export interface SatellitePassInfo { /** Satellite name */ name: string; /** Acquisition of signal */ aos: Date; /** Loss of signal */ los: Date; /** Time of closest approach */ tca?: Date; /** Max elevation angle */ maxElevation?: number; } /** Link margin data point */ export interface LinkMarginPoint { /** Elevation angle (degrees) */ elevation: number; /** Uplink margin (dB) */ uplinkMargin?: number; /** Downlink margin (dB) */ downlinkMargin?: number; } /** Coverage grid data for constellation coverage analysis */ export interface CoverageGridData { /** Latitude values */ latitudes: number[]; /** Longitude values */ longitudes: number[]; /** Coverage values (2D array) */ coverage: number[][]; /** Unit for coverage values */ unit?: string; }