/** Angular */ import * as ng from "@angular/core"; /** Core */ import { CoreComponent } from "cmf.core/src/core"; /** Nested modules */ import { NumberDeltaColorChangeArgs } from "./numberDelta/numberDelta"; import { TemperatureUnit } from "./thermometer/thermometer"; import { VisualDataColor, VisualDataValue, VisualDataRangeInterval, VisualDataOptions, VisualDataType } from "./visualDataUtils"; export { VisualDataType, VisualDataColor, VisualDataValue, VisualDataRangeInterval, VisualDataOptions }; /** * Options for NumberDelta data type */ export interface NumberDeltaOptions extends VisualDataOptions { hidePrimaryLabel: boolean; hideSecondaryLabel: boolean; showBackgroundColorOnNumberDisplay: boolean; } /** * Options for FullCircle data type */ export declare type FullCircleOptions = NumberDeltaOptions; /** * Options for HalfCircle data type */ export declare type HalfCircleOptions = NumberDeltaOptions; /** * Internal options */ export interface VisualDataOptionsInternalOptions { hidePrimaryLabel: boolean; hideSecondaryLabel: boolean; useNameAsSecondaryLabel: boolean; decimalPlaces: number; showUnits: boolean; animations: boolean; showBackgroundColorOnNumberDisplay: boolean; } /** * Default options */ export declare const DEFAULT_OPTIONS: VisualDataOptionsInternalOptions; /** * ## Visual data component * * Displays a visual component to represent data (numeric value) in a visual manner, using different colors. * Different representations can be used using type (@see VisualDataType). * Overall, the value and units are used to represent the value and min/max (or ranges) * and target are used to calculate percentages (detailed bellow). Ranges are used to calculate the color. * * ## Inputs: * * **type**: Type of visual representation (@see VisualDataType) * * **value**: Numeric value to represent * * **units**: Units of the value * * **color**: Custom color for background * * **target**: Target that the value aims to hit (used to calculate the percentage) * * **min**: Min value used to calculate the percentage. E.g. if the value is three-quarters of the way between min and target, * the percentage will be '75%' and delta percentage will be '-25%'. If no min if provided, * the percentage is calculated using the lowest range value. * * **max**: Similar to min, used for percentage when the value is above the target. If it is not provided, * it is considered to be the highest value of the ranges. * * **ranges**: Array of 'VisualDataValue' (@see VisualDataValue). Represents the values and colors by range. * Each element of the array represents the color beyond the value. E.G. If the range has values [(0 - Green), (10 - Yellow), * (20 - Red - exclusive)] The value will be green from ]0,10[ , yellow from '[10, 20]' and red from ]20, +Infinity[. * The first value is also the value from ]-Infinity, ]. * * **exclusiveRanges**: Makes all ranges exclusive, showing the color only if the value is above the range and not equal. * E.g. if the value is 10 and the range has the color green starting at 10 the color will be the previous color and * only when the value is > 10 will the color be shown. * * **animated**: Enables/disables value transition animation on the chart * * **reverseDeltaPercentage**: Reverse calculation of delta percentage to use "target" and "max" instead of default "min" and "target" * * **mainTitle**: Main title * * **subTitle**: Sub title * ### Example * * ``` * * * ``` */ export declare class VisualData extends CoreComponent implements ng.OnChanges { private _elementRef; private _zone; /** * Stores the element that holds the component context menu */ private _contextMenu; /** * If context menu is opened */ private _contextMenuOpened; /** * Individual Visual type */ _individualVisualType: number; /** * Type */ _visualDataType: VisualDataType; /** * Thermometer temperature unit */ _thermometerTemperatureUnit: TemperatureUnit; /** * Internal options */ _options: VisualDataOptionsInternalOptions; /** * Units */ _units: string; /** * Blur on resize */ _blurOnResize: boolean; /** * Custom Color */ customColor: string; /** * Main Title */ mainTitle: string; /** * Sub Title */ subTitle: string; /** * Label */ label: string; /** * Ranges */ ranges: Array; /** * Visual data type */ visualDataType: any; /** * units input: units of the value */ units: string; /** * value input: Main value visualized */ value: number; /** * target input: target to achieve */ target: number; /** * Optional max value (percentage calculation) */ min: number; /** * Optional min value (percentage calculation) */ max: number; /** * Exclude initial value in ranges */ exclusiveRanges: boolean; /** * If chart value transitions are animated */ animated: boolean; /** * Reverse calculation of delta percentage (use target and max) */ reverseDeltaPercentage: boolean; /** * Specific options for each visual data type * Generic typing used to allow the use of specific typings */ options: VisualDataOptions; /** * Color */ color: string; /** * Text color */ textColor: string; /** * Constructor */ constructor(_elementRef: ng.ElementRef, viewContainerRef: ng.ViewContainerRef, _zone: ng.NgZone); /** * On current colors change */ onCurrentColorsChange(args: NumberDeltaColorChangeArgs): void; /** * On changes */ ngOnChanges(changes: ng.SimpleChanges): void; } export declare class VisualDataModule { }