import type { ConvertibleUnit, FormatOptions, Unit } from '@dynatrace-sdk/units'; import type { SingleValueToolbarConfig } from '../../core/components/single-value-renderer/components/SingleValueToolbar.js'; import type { SingleValueAlignment, SingleValueBaseProps, SingleValueUnit } from '../../core/components/single-value-renderer/types/single-value-base-props.js'; import type { SparklineGapPolicy, SparklineVariant } from '../../core/components/sparkline-display/types/sparkline-props.js'; import type { SparklineThresholdIndicatorProps } from '../../core/components/sparkline-display/types/sparkline-thresholds-props.js'; import type { SparklineXAxisProps } from '../../core/components/sparkline-display/types/sparkline-x-axis-props.js'; import type { SparklineYAxisProps } from '../../core/components/sparkline-display/types/sparkline-y-axis-props.js'; import { ColorRuleProps } from '../../core/types/color-rule.js'; import type { Formatter } from '../../core/types/formatter.js'; import { SeriesCurve } from '../../core/types/timeseries.js'; /** * Props for SingleValue * @public */ export interface SingleValueProps extends SingleValueBaseProps { /** Show the loading indicator when truly. * @defaultValue false */ loading?: boolean; /** * Chart width. When a number is specified, it's treated in pixels, * otherwise a valid width string is expected (e.g., "100%", "200px"). * @defaultValue 100% */ width?: number | string; /** * Chart height. When a number is specified, it's treated in pixels, * otherwise a valid height string is expected (e.g., "100px", "50%"). * @defaultValue 100% */ height?: number | string; } /** * Configuration for SingleValue * @public */ export interface SingleValueSparklineConfig { /** Sparkline color **/ color?: string; /** Sparkline variant (line, area) **/ variant?: SparklineVariant; /** Threshold props for the sparkline */ thresholdIndicators?: SparklineThresholdIndicatorProps[]; /** X-axis props for the sparkline */ xAxis?: SparklineXAxisProps; /** Y-axis props for the sparkline */ yAxis?: SparklineYAxisProps; /** Whether Sparkline shows X Axis ticks or not **/ showTicks?: boolean; /** Whether Sparkline shows min/max values or not */ showContextValues?: boolean; /** Gap policy */ gapPolicy?: SparklineGapPolicy; /** Sparkline curve type */ curve?: SeriesCurve; } /** * @public */ export interface SingleValueConfigProperties { /** Optional label text to show beneath the value. */ label?: string; /** State of the value. This affects text and prefix icon color. * @defaultValue 'default' */ color?: string; /** Optional unit to show in the right of the value */ unit?: SingleValueUnit; /** If specified, value will be formatted with given formatter options. */ formatter?: Formatter | FormatOptions; /** Sparkline config properties */ sparkline?: SingleValueSparklineConfig; /** Horizontal alignment of icon, value and unit. * @defaultValue 'start' */ alignment?: SingleValueAlignment; /** Additional rules to apply colors based on value */ colorRules?: ColorRuleProps[]; /** Toolbar configuration */ toolbar?: SingleValueToolbarConfig; }