/** Core */ import { Generic } from "cmf.core/src/core"; /** * Default decimal places count */ export declare const DEFAULT_DECIMAL_PLACES_COUNT: number; export declare const DEFAULT_DEBOUNCE_TIMER: number; export declare const FONT_SIZE_UNIT: string; /** * VisualData visualization type: * * **Number**: Value and unit (no color) * * **Delta**: Delta and color * * **DeltaIndicator**: Delta and arrow (pointing up or down according to value being above or bellow target) * * **NumberDelta**: Number and unit, and as subtitle delta, delta percentage and color * * **RadialGauge**: Radial gauge with colors and a pointer for the value * * **LinearGauge**: Linear gauge with colors and an arrow representing the value * * **BulletGauge**: Bullet gauge with colors for ranges and value in a bullet manner * * **ProgressBar**: Horizontal bar with divisions representing the percentage * (in steps of 10 or 5 depending on component size) (colored). Shows also value, units and percentage. * * **VerticalBar**: Vertical bar with color filled by the percentage. Shows also value, units and percentage. * * **HalfCircle**: Similar to vertical bar, but in a radial manner (half circle). Shows also value, units and percentage. * * **FullCircle**: Similar to a vertical bar, but in a full circle. Shows also value, units and percentage. * * **Thermometer**: Visual similar to a Thermometer representing the percentage of the value visually like a vertical bar. * Shows value and units. */ export declare enum VisualDataType { Number = 0, Delta = 1, DeltaIndicator = 2, NumberDelta = 3, RadialGauge = 4, LinearGauge = 5, BulletGauge = 6, ProgressBar = 7, VerticalBar = 8, HalfCircle = 9, FullCircle = 10, Thermometer = 11 } /** * Color options for visual */ export declare enum VisualDataColor { Green = 0, Yellow = 1, Red = 2, Blue = 3 } /** * Value being represented in the ranges. Has a value and the color to be applied after the value. * If exclusive, the color is only applied if number is '>' value, otherwise '>='. */ export interface VisualDataValue { value: number; color?: string | VisualDataColor; exclusive?: boolean; } /** * VisualDataRangeInterval */ export interface VisualDataRangeInterval { from: number; to: number; color: string; percentage: number; fromPercentage: number; toPercentage: number; exclusive: boolean; colorLight?: string; } /** * Interface for VisualData Options. * This interface contains the options for all visual data types. */ export interface VisualDataOptions { ignore?: boolean; } /** * VisualData Utils */ export declare class VisualDataUtils extends Generic { private static readonly generic; /** * Available font sizes */ private static readonly FONT_SIZES; /** * Color classes */ private static readonly COLOR_CLASSES; /** * Color classes values */ private static readonly COLOR_CLASSES_VALUES; /** * Bigger than exclusive */ private static biggerThanExclusive; /** * Calculate font size based on with and height of container */ static calculateFontSize(text: string, width: number, height: number, multiplier?: number, charactersLimit?: number): number; /** * Calculate foreground color * @param backgroundColor The background color * @param contrastLimit The contrast limit */ static calculateForegroundColor(backgroundColor: string, contrastLimit?: number): string; /** * Get font size from visual data dimensions */ static getFontSize(text: string, width: number, height: number, multiplier?: number, sizeUpperLimit?: number, baseFontSize?: number): number; /** * Calculate color to show */ static calculateColor(color: VisualDataColor | string): string; /** * Process ranges */ static processRanges(ranges: VisualDataValue[], isExclusiveRanges: boolean, min: number, max: number, target: number): VisualDataRangeInterval[]; /** * Calculate data */ static calculateData(value: number, target: number, ranges: VisualDataValue[], min: number, max: number, valuesDecimalPlaces: number, percentagesDecimalPlaces: number, isReversedDeltaPercentage: boolean, isExclusiveRanges: boolean): { value: number; delta: number; dataPercentage: number; deltaPercentage: number; targetPercentage: number; color: string; }; /** * Debounce on changes * @param onChanges */ static debounceOnChanges(onChanges: any, context: any): any; }