import { type IColor } from "@gooddata/sdk-model"; /** * Defines the calculation types for an algorithm. * * @remarks * The table below summarizes the available calculation types: * * * * * * * * * * *
TypeAlgorithm
change(Primary - Secondary) / Secondary
differencePrimary - Secondary
ratioPrimary / Secondary
change_difference * Change: (Primary - Secondary) / Secondary *
* Difference: Primary - Secondary *
* * @public */ export type CalculationType = "change" | "ratio" | "difference" | "change_difference"; /** * Defines how the comparison value will be placed. * * @public */ export type ComparisonPosition = "top" | "left" | "right" | "auto"; /** * @internal */ export declare const CalculateAs: Record, CalculationType>; /** * @internal */ export declare const ComparisonPositionValues: Record, ComparisonPosition>; /** * Comparison format type * * @remarks * Providing a null value will configure the format to inherit from the format of primary measure. * * @public */ export type ComparisonFormat = string | null; /** * Configuration options for color settings. * * @public */ export interface IColorConfig { /** * Determines whether to disable the comparison color. * * @defaultValue false */ disabled?: boolean; /** * Specifies the color to use, which can be selected from the color palette or provided as an RGB code. * This color is used when the primary measure greater than the secondary measure. * * @defaultValue rgb(0, 193, 141) */ positive?: IColor; /** * Specifies the color to use, which can be selected from the color palette or provided as an RGB code. * This color is used when the primary measure less than the secondary measure. * * @defaultValue rgb(229, 77, 64) */ negative?: IColor; /** * Specifies the color to use, which can be selected from the color palette or provided as an RGB code. * This color is used when the primary measure equal to the secondary measure. * * @defaultValue rgb(148, 161, 173) */ equals?: IColor; } /** * Configuration options for labeling conditions. * * @public */ export interface ILabelConfig { /** * This property specifies whether to use the unconditional value for all conditions * or separate values for each condition. * * @defaultValue false */ isConditional?: boolean; /** * Specifies the label to be used for the comparison value. * * @remarks * The default value is based on the calculation type: * * * * * * *
Calculation TypeDefault value
changeChange
ratioof
differenceDifference
change_differenceChange
*/ unconditionalValue?: string; /** * This property specify the label of the positive comparison value *
* Primary is larger than Secondary * * @defaultValue based on the calculation type * * * * * * *
Calculation typeDefault label
changeIncrease
differenceIncrease
ratio(Not applicable)
*/ positive?: string; /** * This property specify the label of the negative comparison *
* Primary is less than Secondary * * @defaultValue based on the calculation type * * * * * * *
Calculation typeDefault label
changeDecrease
differenceDecrease
ratio(Not applicable)
*/ negative?: string; /** * This property specify the label of the equals comparison value *
* Primary is equals Secondary * * * * * * *
Calculation typeDefault label
changeNo change
differenceNo difference
ratio(Not applicable)
*/ equals?: string; } /** * Configuration options for comparing values. * * @public */ export interface IComparison { /** * Enables or disables the comparison. * * @defaultValue true */ enabled: boolean; /** * Defines how the comparison value will be calculated. * * @remarks * The default value is determined by the type of secondary measure: * * * * *
Type of secondary measureDefault value
Derived measurechange
Non-derived measureratio
* * @see {@link CalculationType} for available calculation methods. * * @defaultValue Based on the secondary measure. */ calculationType?: CalculationType; /** * Defines how the comparison value will be placed. * * @see {@link ComparisonPosition} for supported positions * * @defaultValue auto */ position?: ComparisonPosition; /** * Defines the number format of the comparison value. * * @remarks * The default value is based on the calculation type: * * * * * *
Calculation TypeDefault format
changePercent (rounded)
ratioPercent (rounded)
differenceInherit
* * @see {@link ComparisonFormat} for supported formats. * * @defaultValue Based on the calculation type. */ format?: ComparisonFormat; /** * Defines the number format of the comparison sub value. * * @remarks * The default value is based on the calculation subtype: * * * * * *
Calculation TypeDefault format
changePercent (rounded)
ratioPercent (rounded)
differenceInherit
* * @see {@link ComparisonFormat} for supported formats. * * @defaultValue Based on the calculation subtype. */ subFormat?: ComparisonFormat; /** * Controls the visibility of the arrow trend indicator and its direction based on conditions. * * @remarks * The arrow direction is determined as follows: * * * * * * *
ConditionDirection
Primary greater than SecondaryUp
Primary less than SecondaryDown
Primary equal to SecondaryNo direction, arrow hidden
*/ isArrowEnabled?: boolean; /** * Controls the application of conditional colors. * * @see {@link IColorConfig} for configuration details. */ colorConfig?: IColorConfig; /** * Controls the label displayed beneath the comparison value. * * @see {@link ILabelConfig} for configuration details. */ labelConfig?: ILabelConfig; } //# sourceMappingURL=comparison.d.ts.map