import type { TimeseriesZoomDomain } from './timeseries.js'; import type { TimeseriesChartToolbarConfig, TimeseriesToolbarInternalProps } from './toolbar.js'; import type { TruncationMode } from '../../../typography/text-ellipsis/TextEllipsis.js'; import type { PointsDisplay } from '../../core/components/canvas/types/canvas-shape.js'; import type { ColorPalette, CustomColorPalette } from '../../core/types/color-palette.js'; import { ColorRuleProps } from '../../core/types/color-rule.js'; import type { TimeGapPolicy } from '../../core/types/gap-policy.js'; import type { ChartInteractionsConfig, ZoomInteractions } from '../../core/types/interactions.js'; import type { ValueRepresentation } from '../../core/types/scales.js'; import type { SeriesCurve } from '../../core/types/timeseries.js'; import type { WithId } from '../../core/types/with-id.js'; import type { TimeseriesAnnotationsConfigContextProps } from '../context/TimeseriesChartAnnotationsConfig.context.js'; import type { TimeseriesChartLegendProps } from '../slots/Legend.js'; import type { TimeseriesSelectProps } from '../slots/Select.js'; import type { TimeseriesChartThresholdIndicatorProps } from '../slots/ThresholdIndicator.js'; import type { TimeseriesChartTooltipProps } from '../slots/Tooltip.js'; import type { TimeseriesChartXAxisProps } from '../slots/XAxis.js'; import type { TimeseriesChartYAxisProps } from '../slots/YAxis.js'; /** * @internal */ export interface TimeseriesChartSlots { /** Chart Toolbar slots */ toolbar: TimeseriesToolbarInternalProps; /** Chart legend */ legend: TimeseriesChartLegendProps; /** Chart x-axis slot */ xAxis?: TimeseriesChartXAxisProps; /** Chart tooltip slot */ tooltip: TimeseriesChartTooltipProps; /** Chart y-axis slot */ yAxis: TimeseriesChartYAxisProps[]; /** Chart annotations slot */ annotations?: TimeseriesAnnotationsConfigContextProps; /** Chart thresholds */ thresholds: TimeseriesChartThresholdIndicatorProps[]; /** Chart Interactions */ interactions: ChartInteractionsConfig; /** Select Interaction */ select?: TimeseriesSelectProps; /** Color rules to apply custom colors to series */ colorRules: ColorRuleProps[]; /** * Download CSV slot */ downloadCSV?: { enabled?: boolean; }; } /** * Configuration properties for timeseries charts * @public */ export interface TimeseriesChartConfigProperties extends ZoomInteractions { /** Defines how gaps are handled (connect vs. gap) */ gapPolicy?: TimeGapPolicy; /** Defines whether datapoints are displayed */ pointsDisplay?: PointsDisplay; /** Defines if values are absolute or relative */ valueRepresentation?: ValueRepresentation; /** Defines the tooltip configuration */ tooltip?: TimeseriesChartTooltipProps; /** Chart toolbar configuration */ toolbar?: TimeseriesChartToolbarConfig; /** Chart interactions configuration */ interactions?: ChartInteractionsConfig; /** Chart legend properties */ legend?: TimeseriesChartLegendProps; /** Chart X Axis properties */ xAxis?: TimeseriesChartXAxisProps; /** Chart y-axis properties */ yAxis?: TimeseriesChartYAxisProps[]; /** Color palette */ colorPalette?: ColorPalette | CustomColorPalette; /** * Truncation mode to use (start, middle, end) * Applied to all the parts that truncate text. * @defaultValue 'middle' */ truncationMode?: TruncationMode; /** ThresholdIndicatorsConfiguration */ thresholdIndicators?: TimeseriesChartThresholdIndicatorProps[]; /** Defines the curve shape of the series */ curve?: SeriesCurve; /** Enables infinite zooming */ infiniteZoom?: boolean; /** Color rules to apply custom colors to series */ colorRules?: ColorRuleProps[]; /** * Download CSV configuration */ downloadCSV?: { enabled?: boolean; }; /** * Toggles Pan */ pan?: { disabled?: boolean; }; /** * Toggles Zoom */ zoom?: { disabled?: boolean; }; } /** * @internal */ export type TimeseriesChartTooltipConfig = Required; /** * @internal */ export interface TimeseriesChartLegendConfig extends Required> { onRatioChange?: (ratio: number) => void; initialRatio?: TimeseriesChartLegendProps['initialRatio']; } /** * @internal */ export interface TimeseriesChartConfigProps extends ZoomInteractions { gapPolicy?: TimeGapPolicy; pointsDisplay?: PointsDisplay; valueRepresentation?: ValueRepresentation; colorPalette?: ColorPalette | CustomColorPalette; truncationMode?: TruncationMode; curve?: SeriesCurve; infiniteZoom?: boolean; select?: TimeseriesSelectProps; } /** * @internal */ export interface TimeseriesChartYAxisConfig { left?: TimeseriesChartYAxisProps; right?: TimeseriesChartYAxisProps; } /** * @internal */ export type TimeseriesChartXAxisConfig = TimeseriesChartXAxisProps; /** * @internal */ export type TimeseriesChartThresholdConfig = TimeseriesChartThresholdIndicatorProps; /** * @internal */ export interface TimeseriesChartThresholdsConfig { left?: WithId[]; right?: WithId[]; } /** * @internal */ export interface TimeseriesChartConfiguration extends ZoomInteractions { /** Defines the gap policy configuration */ gapPolicy: TimeGapPolicy; /** Defines whether datapoints are displayed or not */ pointsDisplay: PointsDisplay; /** Defines if values are absolute or relative */ valueRepresentation: ValueRepresentation; /** Color palette that will be applied to the chart */ colorPalette: ColorPalette | CustomColorPalette; /** Defines the tooltip configuration */ tooltip: TimeseriesChartTooltipConfig; /** Chart interactions configuration */ interactions: ChartInteractionsConfig; /** Chart toolbar configuration */ toolbar?: TimeseriesToolbarInternalProps; /** Chart legend configuration */ legend: TimeseriesChartLegendConfig; /** Chart X Axis configuration */ xAxis?: TimeseriesChartXAxisConfig; /** Chart y-axis configuration */ yAxis: TimeseriesChartYAxisConfig; /** Chart annotations configuration */ annotations: TimeseriesAnnotationsConfigContextProps | undefined; /** Truncation mode applied when the text overflow */ truncationMode: TruncationMode; /** Chart thresholds configuration */ thresholds?: TimeseriesChartThresholdsConfig; /** Defines the curve shape of the area and line series */ curve?: SeriesCurve; /** Enables the infiniteZoom */ infiniteZoom: boolean; /** Chart selection interaction */ select?: TimeseriesSelectProps; /** Color rules to apply custom colors to series */ colorRules: ColorRuleProps[]; }