import type { Unit } from '@dynatrace-sdk/units'; import type { TruncationMode } from '../../../typography/text-ellipsis/TextEllipsis.js'; import type { PointShapeType } from '../../core/components/shape/type.js'; import type { ColorPalette, CustomColorPalette } from '../../core/types/color-palette.js'; import type { ColoredRange } from '../../core/types/colored-range.js'; import type { Formatter, TimeFormatter } from '../../core/types/formatter.js'; import { ProgrammaticZoomHandlers } from '../../core/types/zoom.js'; /** * Curve shape for line, band and area series * @public */ export type SeriesCurve = 'linear' | 'smooth'; /** * Data type for the XY chart * @public */ export type XYChartData = Record; /** * Bar series single constant variant. * @public */ export declare const BAR_VARIANT_SINGLE = "single"; /** * Bar series stack constant variant. * @public */ export declare const BAR_VARIANT_STACK = "stack"; /** * Bar series group constant variant. * @public */ export declare const BAR_VARIANT_GROUP = "group"; /** * Bar series variant type. * @public */ export type BarSeriesVariant = typeof BAR_VARIANT_SINGLE | typeof BAR_VARIANT_STACK | typeof BAR_VARIANT_GROUP; /** * Color palette options for XYChart. * @public */ export type XYChartColorPalette = ColorPalette | CustomColorPalette | ColoredRange[]; /** * Props definition for the XYChart legend * @public */ export type XYChartLegend = { /** * The truncation mode to be used as start, middle or end in the long legend * labels * @defaultValue 'middle' */ truncationMode: TruncationMode; }; /** * XYChart Ref * @public */ export interface XYChartRef extends ProgrammaticZoomHandlers { /** Chart div element. */ element: HTMLDivElement | null; /** Returns the current serialized config of the XYChart. */ getConfig: () => string; /** Downloads series. */ downloadData: () => void; } /** * The position for the xy chart x-axis * @public */ export type XYChartXAxisPosition = typeof BOTTOM_POSITION | typeof TOP_POSITION | typeof BOTH_POSITION; /** * The position for the xy chart y-axis * @public */ export type XYChartYAxisPosition = typeof LEFT_POSITION | typeof RIGHT_POSITION | typeof BOTH_POSITION; /** * The numerical scale type for the xy chart axis * @public */ export declare const NUMERICAL_SCALE_TYPE = "numerical"; /** * The log scale type for the xy chart axis * @public */ export declare const LOG_SCALE_TYPE = "log"; /** * The time scale type for the xy chart axis * @public */ export declare const TIME_SCALE_TYPE = "time"; /** * The categorical scale type for the xy chart axis * @public */ export declare const CATEGORICAL_SCALE_TYPE = "categorical"; /** * The data type for the xy chart axis * @public */ export type XYChartAxisType = typeof LOG_SCALE_TYPE | typeof NUMERICAL_SCALE_TYPE | typeof TIME_SCALE_TYPE | typeof CATEGORICAL_SCALE_TYPE; /** * The top position for the xy chart x-axis * @public */ export declare const TOP_POSITION = "top"; /** * The bottom position for the xy chart x-axis * @public */ export declare const BOTTOM_POSITION = "bottom"; /** * The left position for the xy chart x-axis * @public */ export declare const LEFT_POSITION = "left"; /** * The right position for the xy chart x-axis * @public */ export declare const RIGHT_POSITION = "right"; /** * The both position for the xy chart x-axis * @public */ export declare const BOTH_POSITION = "both"; /** * The valid data types for x and y accessors * @public */ export type XYAccessorDataTypes = string | number | Date; /** * The base selected datapoint information * @public */ export interface BaseDatapoint extends Record { /** * datapoint x0 value */ x0: XYAccessorDataTypes; /** * datapoint y0 value */ y0: XYAccessorDataTypes; } /** * The selected rect datapoint information * @public */ export interface RectDatapoint extends BaseDatapoint { /** * datapoint x1 value */ x1?: XYAccessorDataTypes; /** * datapoint y1 value */ y1?: XYAccessorDataTypes; /** * datapoint value */ value: number | string; } /** * The selected dot series datapoint information * @public */ export interface DotDatapoint extends BaseDatapoint { /** * datapoint x1 value, exclusive to timeframe datapoints */ x1?: Date; /** * datapoint y1 value, exclusive to timeframe datapoints */ y1?: Date; } /** * The selected line series datapoint information * @public */ export interface LineDatapoint extends BaseDatapoint { /** * datapoint x1 value, exclusive to timeframe datapoints */ x1?: Date; /** * datapoint y1 value, exclusive to timeframe datapoints */ y1?: Date; } /** * The selected bar series datapoint information * @public */ export interface BarDatapoint extends Partial { /** * datapoint x1 value */ x1?: XYAccessorDataTypes; /** * datapoint y1 value */ y1?: XYAccessorDataTypes; } /** * The selected area series datapoint information * @public */ export interface AreaDatapoint extends Partial { /** * datapoint x1 value */ x1?: XYAccessorDataTypes; /** * datapoint y1 value */ y1?: XYAccessorDataTypes; } /** * The selected area datapoint displayed on the action * @public */ export type XYChartAreaSeriesActionItem = { datapoint: AreaDatapoint; category?: string; datapoints?: AreaDatapoint[]; name: string; }; /** * The selected area series in the action * @public */ export type XYChartAreaSeries = XYChartSeriesActionInfo; /** * The selected dot datapoint displayed on the action * @public */ export type XYChartDotSeriesActionItem = DotDatapoint & { /** * series name */ name: string; }; /** * Base type for series action info containing datapoints and name. * @public */ export type XYChartSeriesActionInfo = { /** All datapoints belonging to the selected series or category */ datapoints: T[]; /** The name of the selected series or category */ name: string; }; /** * The selected dot series in the action * @public */ export type XYChartDotSeries = XYChartSeriesActionInfo; /** * The selected rect datapoint displayed on the action * @public */ export type XYChartRectSeriesActionItem = RectDatapoint; /** * The selected rect series in the action * @public */ export type XYChartRectSeries = XYChartSeriesActionInfo; /** * The selected line datapoint displayed on the action * @public */ export type XYChartLineSeriesActionItem = LineDatapoint & { /** * The name for the series */ name: string; }; /** * The selected line series in the action * @public */ export type XYChartLineSeries = XYChartSeriesActionInfo; /** * The selected bar datapoint displayed on the action. * Can be a single BarDatapoint or include grouped datapoints for stacked/grouped bars. * @public */ export type XYChartBarSeriesActionItem = { datapoint: BarDatapoint; category?: string; datapoints?: BarDatapoint[]; name: string; }; /** * The selected bar series in the action * @public */ export type XYChartBarSeries = XYChartSeriesActionInfo; /** * Static threshold data: a single value or a range. * @public */ export type XYChartThresholdStaticData = XYChartThresholdDataLineStatic | XYChartThresholdDataRangeStatic; /** * Dynamic threshold data: a single value or a range, with an x coordinate. * @public */ export type XYChartThresholdDynamicData = XYChartThresholdDataLineDynamic | XYChartThresholdDataRangeDynamic; /** * All possible threshold data types for XYChart. * @public */ export type XYChartThresholdData = XYChartThresholdStaticData | XYChartThresholdDynamicData[]; /** * A single threshold datapoint (static or dynamic). * @public */ export type XYChartThresholdDatapoint = XYChartThresholdStaticData | XYChartThresholdDynamicData; /** * Value type for a threshold (number or Date). * @public */ export type XYChartThresholdValue = number | Date; /** * Base type for a line threshold (single value). * @public */ export type XYChartThresholdLineBase = { y: XYChartThresholdValue; }; /** * Base type for a range threshold (min/max). * @public */ export type XYChartThresholdRangeBase = { yMin: number | Date; yMax: number | Date; }; /** * Static line threshold data. * @public */ export type XYChartThresholdDataLineStatic = XYChartThresholdLineBase; /** * Static range threshold data. * @public */ export type XYChartThresholdDataRangeStatic = XYChartThresholdRangeBase; /** * Dynamic line threshold data (with x). * @public */ export type XYChartThresholdDataLineDynamic = XYChartThresholdLineBase & { x: XYChartThresholdValue; }; /** * Dynamic range threshold data (with x). * @public */ export type XYChartThresholdDataRangeDynamic = XYChartThresholdRangeBase & { x: XYChartThresholdValue; }; /** * The selected datapoints per series in the XYChart. * @public */ export type XYChartSelectedSeries = Record[]; /** * The selected datapoints per series in the XYChart. * @public */ export type XYChartSelectedDomains = Record[]; /** * Datapoint types for the tooltip payload * @public */ export type XYChartTooltipDatapoint = DotDatapoint | LineDatapoint | RectDatapoint | BarDatapoint | AreaDatapoint; /** * NumericalFormatter * @public */ export type NumericalFormatter = (value: number, unit?: string | Unit, precision?: number) => string; /** * AxisFormatter * @public */ export type AxisFormatter = NumericalFormatter | TimeFormatter; /** * Base tooltip payload shared across all series types * @public */ export type BaseTooltipPayload = { datapoint: T; seriesId: string; seriesName: string; xFormatter: AxisFormatter; yFormatter: AxisFormatter; color: string; xAxisLabel?: string; yAxisLabel?: string; }; /** * Tooltip payload containing dot series specific data * @public */ export interface DotTooltipPayload extends BaseTooltipPayload { /** Shape of the dot */ shape: PointShapeType; } /** * Tooltip payload containing line series specific data * @public */ export type LineTooltipPayload = BaseTooltipPayload; /** * Tooltip payload containing rect series specific data * @public */ export interface RectTooltipPayload extends BaseTooltipPayload { /** Rect datapoint */ datapoint: RectDatapoint; /** Label for the value */ valueLabel: string; /** Formatter for the value */ valueFormatter?: Formatter; } /** * Tooltip payload containing bar series specific data * @public */ export type BarTooltipPayload = BaseTooltipPayload; /** * Tooltip payload containing area series specific data * @public */ export type AreaTooltipPayload = BaseTooltipPayload; /** * Tooltip payload containing optional payloads for different series types * @public */ export type XYChartTooltipPayload = { dotPayload?: DotTooltipPayload; linePayload?: LineTooltipPayload; rectPayload?: RectTooltipPayload; barPayload?: BarTooltipPayload; areaPayload?: AreaTooltipPayload; };