import type { ReactNode } from 'react-markdown'; import type { ConvertibleUnit, FormatOptions, Unit } from '@dynatrace-sdk/units'; import type { BehaviorTrackingProps } from '../../../../core/types/behavior-tracking-props.js'; import type { DataTestId } from '../../../../core/types/data-props.js'; import type { MaskingProps } from '../../../../core/types/masking-props.js'; import type { StylingProps } from '../../../../core/types/styling-props.js'; import type { ColorPalette, CustomColorPalette } from '../../../core/types/color-palette.js'; import type { Formatter } from '../../../core/types/formatter.js'; import type { SeriesActionsTemplate } from '../../../core/types/series-actions-template.js'; import type { MeterBarSize } from '../../shared/types/meter-bars.js'; /** * Information hold by each segment in the multi meter bar chart * @public */ export type MultiMeterBarSegmentData = { id: string; name: string; values: string[]; }; /** * @public */ export interface MultiMeterBarChartProps extends StylingProps, MaskingProps, DataTestId, BehaviorTrackingProps { /** * The chart width. A valid CSS width is expected. * @defaultValue 100% */ width?: number | string; /** * The chart height. A valid CSS height is expected. * @defaultValue 300px */ height?: number | string; /** * Min value for the multi meter bar chart scale. * @defaultValue 0 */ min?: number; /** * Max value for the multi meter bar chart scale. * @defaultValue 'auto' */ max?: number | 'auto'; /** * Color palette to be used for the segments * @defaultValue "categorical" */ colorPalette?: ColorPalette | CustomColorPalette; /** Show the loading indicator when truthy. * @defaultValue false */ loading?: boolean; /** * The size that applies to the value, icon, and label. * @defaultvalue 'size16' */ size?: MeterBarSize; /** * The custom unit for the value of the multi meter bar. */ unit?: string | Unit; /** * Custom Formatter for the chart */ formatter?: Formatter | FormatOptions; /** * Icon to show left of the label. */ prefixIcon?: ReactNode; /** Exposed callback to display series actions */ seriesActions?: (seriesData: MultiMeterBarSegmentData) => SeriesActionsTemplate; } /** * @public */ export type MultiMeterBarChartData = { [key: string]: unknown; }; /** * @public */ export interface MultiMeterBarSegmentBaseProps { /** * Segment name */ name: string; /** * Segment color, if not provided, color that comes from the parent colorPalette value will be used */ color?: string; } /** * @public */ export interface MultiMeterBarSegmentPropsWithAccessor extends MultiMeterBarSegmentBaseProps { /** * Data object to retrieve the value from using the valueAccessor. */ value: MultiMeterBarChartData; /** * Accessor string to retrieve the value from the data object. */ valueAccessor: string; } /** * @public */ export interface MultiMeterBarSegmentPropsWithNumericValue extends MultiMeterBarSegmentBaseProps { /** * Segment percentage value */ value: number; valueAccessor?: never; } /** * @public */ export type MultiMeterBarSegmentProps = MultiMeterBarSegmentPropsWithAccessor | MultiMeterBarSegmentPropsWithNumericValue; /** * @public */ export declare const multiMeterBarChartTooltipVariantOptions: readonly ["single", "shared"]; /** * The different variants available to use in the tooltip subcomponent * @public */ export type MultiMeterBarChartTooltipVariant = (typeof multiMeterBarChartTooltipVariantOptions)[number]; /** * @public */ export interface MultiMeterBarChartTooltipProps { /** * Variant to be used for the multi meter bar chart tooltip * @defaultValue "single" */ variant?: MultiMeterBarChartTooltipVariant; }