export declare const GAUGE_THICKNESS = 50; export declare const FILL_THICKNESS = 38; /** * get width for the whole gauge viz for horizontal or vertical view * @method getGaugeWidth * @param {Object} input * @param {Number} containerWidth * @param {String} orientation * @return {Number} width */ export declare const getGaugeWidth: ({ containerWidth, orientation, gaugeThickness, horizontalPadding, }: { containerWidth: any; orientation: any; gaugeThickness?: number; horizontalPadding?: number; }) => number; /** * get height for the whole gauge viz for horizontal or vertical view * @method getGaugeHeight * @param {Object} input * @param {Number} containerHeight * @param {String} orientation * @return {Number} height */ export declare const getGaugeHeight: ({ containerHeight, orientation, gaugeThickness, verticalPadding, }: { containerHeight: any; orientation: any; gaugeThickness?: number; verticalPadding?: number; }) => number; /** * get how long the gauge shoud be. * In horizontal view, gauge length equals to gauge width. In vertical view, it equals to gauge height. * @method getGaugeLength * @param {Object} input * @param {Number} input.containerWidth * @param {Number} input.containerHeight * @param {String} input.orientation * @return {Number} gaugeLength */ export declare const getGaugeLength: ({ containerWidth, containerHeight, orientation, gaugeThickness, horizontalPadding, verticalPadding, }: { containerWidth: any; containerHeight: any; orientation: any; gaugeThickness?: number; horizontalPadding?: number; verticalPadding?: number; }) => number; /** * get start x and y for rendering gauge * @method getGaugeStartPosition * @param {Object} input * @param {Number} containerWidth * @param {Number} containerHeight * @param {Number} gaugeLength * @param {String} orientation * @return {Object} position * @return {Number} position.gaugeStartX * @return {Number} position.gaugeStartY */ export declare const getGaugeStartPosition: ({ containerWidth, containerHeight, gaugeLength, orientation, gaugeThickness, horizontalPadding, verticalPadding, }: { containerWidth: any; containerHeight: any; gaugeLength: any; orientation: any; gaugeThickness?: number; horizontalPadding?: number; verticalPadding?: number; }) => { gaugeStartX: number; gaugeStartY: number; }; /** * get dimensions for the whole gauge viz, * which can be useful to calculate background bar and major ticks positions. * @method getGaugeDimensions * @param {Object} input * @param {Number} input.containerWidth * @param {Number} input.containerHeight * @param {String} input.orientation 'horizontal' or 'vertical' * @return {Object} gaugeDimensions * @return {Number} gaugeDimensions.gaugeLength how long the gauge shoud be in horizontal or vertical orientation. * @return {Number} gaugeDimensions.gaugeStartX start x to render gauge * @return {Number} gaugeDimensions.gaugeStartY start y to render gauge * @return {Number} gaugeDimensions.gaugeWidth natural width of gauge * @return {Number} gaugeDimensions.gaugeHeight natural height of gauge */ export declare const getGaugeDimensions: ({ containerWidth, containerHeight, orientation, gaugeThickness, horizontalPadding, verticalPadding, }: { containerWidth: any; containerHeight: any; orientation: any; gaugeThickness?: number; horizontalPadding?: number; verticalPadding?: number; }) => { gaugeLength: number; gaugeStartX: number; gaugeStartY: number; gaugeWidth: number; gaugeHeight: number; }; /** * if gaugeColor is not specified, auto assign a gauge color to the fill bar * based on how much percentage the value is taken between min and max * @method assignGaugeColor * @params * */ export declare const assignGaugeColor: ({ value, min, max }: { value: any; min: any; max: any; }) => any; /** * get inner bar length in gauge * @method getGaugeBarLength * @param {Object} input * @param {Number} input.gaugeLength * @param {Number} input.value * @param {Number} input.min * @param {Number} input.max * @return {Number} gaugeBarLength */ export declare const getGaugeBarLength: ({ gaugeLength, value, min, max }: { gaugeLength: any; value: any; min: any; max: any; }) => any; /** * get x and y position for rendering inner bar in gauge * @method getGaugeBarStartPositions * @param {Object} input * @param {Number} input.gaugeStartX * @param {Number} input.gaugeStartY * @param {Number} input.gaugeWidth * @param {Number} input.gaugeHeight * @param {Number} input.gaugeBarLength * @param {String} input.orientation * @return {Object} position * @return {Number} position.gaugeBarX * @return {Number} position.gaugeBarY */ export declare const getGaugeBarStartPositions: ({ gaugeStartX, gaugeStartY, gaugeWidth, gaugeHeight, gaugeBarLength, orientation, fillThickness, }: { gaugeStartX: any; gaugeStartY: any; gaugeWidth: any; gaugeHeight: any; gaugeBarLength: any; orientation: any; fillThickness?: number; }) => { gaugeBarX: any; gaugeBarY: any; }; /** * get width of inner bar in gauge * @method getGaugeBarWidth * @param {Object} input * @param {Number} input.gaugeBarLength * @param {String} orientation * @return {Number} gaugeBarWidth */ export declare const getGaugeBarWidth: ({ gaugeBarLength, orientation, fillThickness }: { gaugeBarLength: any; orientation: any; fillThickness?: number; }) => any; /** * get height of inner bar in gauge * @method getGaugeBarWidth * @param {Object} input * @param {Number} input.gaugeBarLength * @param {String} orientation * @return {Number} gaugeBarHeight */ export declare const getGaugeBarHeight: ({ gaugeBarLength, orientation, fillThickness }: { gaugeBarLength: any; orientation: any; fillThickness?: number; }) => any; /** * get dimensions for the fill bar in the gauge * @method getFillBarDimensions * @param {Object} input * @param {Number} input.gaugeLength * @param {Number} input.gaugeStartX * @param {Number} input.gaugeStartY * @param {Number} input.gaugeWidth, * @param {Number} input.gaugeHeight, * @param {Number} input.value, * @param {Number} input.min, * @param {Number} input.max, * @param {String} input.orientation * @return {Object} fillBarDimensions * @return {Number} fillBarDimensions.fillBarLength * @return {Number} fillBarDimensions.fillBarX * @return {Number} fillBarDimensions.fillBarY * @return {Number} fillBarDimensions.fillBarWidth * @return {Number} fillBarDimensions.fillBarHeight */ export declare const getFillBarDimensions: ({ gaugeLength, gaugeStartX, gaugeStartY, gaugeWidth, gaugeHeight, value, min, max, orientation, fillThickness, }: { gaugeLength: any; gaugeStartX: any; gaugeStartY: any; gaugeWidth: any; gaugeHeight: any; value: any; min: any; max: any; orientation: any; fillThickness?: number; }) => { fillBarLength: any; fillBarX: any; fillBarY: any; fillBarWidth: any; fillBarHeight: any; }; /** * get position x and y for value marker in filler gauge * @method getFillerGaugeValueMarkerPositions * @param {Object} input * @param {Number} input.fillBarX * @param {Number} input.fillBarY * @param {Number} input.fillBarLength * @param {String} input.orientation * @return {Object} position * @return {Number} position.valueMarkerX * @return {Number} position.valueMarkerY */ export declare const getFillerGaugeValueMarkerPositions: ({ fillBarX, fillBarY, fillBarLength, orientation, gaugeThickness, fillThickness, }: { fillBarX: any; fillBarY: any; fillBarLength: any; orientation: any; gaugeThickness?: number; fillThickness?: number; }) => { valueMarkerX: any; valueMarkerY: any; }; /** * get dimensions for the marker bar in the gauge * @method getMarkerBarDimensions * @param {Object} input * @param {Number} input.gaugeLength * @param {Number} input.gaugeStartX * @param {Number} input.gaugeStartY * @param {Number} input.gaugeWidth, * @param {Number} input.gaugeHeight, * @param {String} input.orientation * @return {Object} markerBarDimensions * @return {Number} markerBarDimensions.markerBarLength * @return {Number} markerBarDimensions.markerBarX * @return {Number} markerBarDimensions.markerBarY * @return {Number} markerBarDimensions.markerBarWidth * @return {Number} markerBarDimensions.markerBarHeight */ export declare const getMarkerBarDimensions: ({ gaugeLength, gaugeStartX, gaugeStartY, gaugeWidth, gaugeHeight, orientation, }: { gaugeLength: any; gaugeStartX: any; gaugeStartY: any; gaugeWidth: any; gaugeHeight: any; orientation: any; }) => { markerBarLength: any; markerBarX: any; markerBarY: any; markerBarWidth: any; markerBarHeight: any; }; /** * get position x and y for value marker in marker gauge * @method getMarkerGaugeValueMarkerPositions * @param {Object} input * @param {Number} input.markerBarX * @param {Number} input.markerBarY * @param {Number} input.markerBarHeight * @param {Number} input.markerBarLength * @param {Number} input.value * @param {Number} input.min * @param {Number} input.max * @param {String} input.orientation * @return {Object} position * @return {Number} position.valueMarkerX * @return {Number} position.valueMarkerY */ export declare const getMarkerGaugeValueMarkerPositions: ({ markerBarX, markerBarY, markerBarHeight, markerBarLength: gaugeLength, orientation, value, min, max, }: { markerBarX: any; markerBarY: any; markerBarHeight: any; markerBarLength: any; orientation: any; value: any; min: any; max: any; }) => { valueMarkerX: any; valueMarkerY: any; }; /** * sort the ranges in ascending order * @method getSortedRanges * @param {Array} ranges * @return {Array} sortedRanges */ export declare const getSortedRanges: (ranges: any) => any; /** * validate whether ranges prop is valid - continuous ranges, range.to < range.from, range.from != range.to * @method validateRanges * @param {Array} ranges * @return {String} error */ export declare const validateRanges: (ranges: any) => any; /** * calculate min and max value of gauge * @method getGaugeRange * @param {Array} ranges * @return {Object} gaugeRange * @return {Number} gaugeRange.min * @return {Number} gaugeRange.max */ export declare const getGaugeRange: (ranges: any) => { min: number; max: number; }; /** * calculate stop offsets for linear gradient * @method getGradientStopOffsets * @param {Array} ranges * @param {String} orientation * @return {Array} cumulativeOffsets */ export declare const getGradientStopOffsets: ({ ranges, orientation }: { ranges: any; orientation: any; }) => any[]; /** * calculate stop colors for linear gradient * @method getGradientStopColors * @param {Array} ranges * @param {String} orientation * @return {Array} stopColors */ export declare const getGradientStopColors: ({ ranges, orientation }: { ranges: any; orientation: any; }) => any; /** * calculate linear gradient stops from ranges * @method getGradientStops * @param {Object} input * @param {Array} ranges * @param {String} orientation * @return {Array} stops */ export declare const getGradientStops: ({ ranges, orientation }: { ranges: any; orientation: any; }) => any[]; /** * calculate linear gradient dimensions * @method getGradientDimensions * @param {String} orientation * @return {Object} dimensions * @return {String} dimensions.x1 * @return {String} dimensions.y1 * @return {String} dimensions.x2 * @return {String} dimensions.y2 */ export declare const getGradientDimensions: (orientation: any) => { x1: string; y1: string; x2: string; y2: string; }; type NumericInput = number | string; interface UniqueDecimalPlacesInput { values: number[]; minimumDecimalPlaces: number; } interface PercentageFromRangeInput { value: number; min: number; range: number; } interface NumOfTicksInput { min: number; max: number; majorUnit: number | string; usePercentageRange: boolean; } interface TickLabelFormatterResult { numOfTicks: number; numericStep: number; formatTickLabel: (value: number) => string; } interface FormatGaugeValueLabelInput { value: NumericInput; min: number; max: number; usePercentageValue: boolean; } export declare const getDecimalPlaces: (value: NumericInput) => number; export declare const getUniqueDecimalPlaces: ({ values, minimumDecimalPlaces, }: UniqueDecimalPlacesInput) => number; export declare const getPercentageFromRange: ({ value, min, range }: PercentageFromRangeInput) => number; export declare const getNumOfTicks: ({ min, max, majorUnit, usePercentageRange, }: NumOfTicksInput) => { numOfTicks: number; isAutoMajorUnit: boolean; majorUnitNumber: number; }; export declare const getTickLabelFormatter: ({ min, max, majorUnit, usePercentageRange, }: NumOfTicksInput) => TickLabelFormatterResult; export declare const formatGaugeValueLabel: ({ value, min, max, usePercentageValue, }: FormatGaugeValueLabelInput) => string; interface GaugeOptions { [key: string]: any; } /** * Helper method to update the option names which can be mapped to pure component options * @method mapToOldKey * @param {Object} options * @returns {Object} */ export declare const mapToOldKey: (options: GaugeOptions) => GaugeOptions; type LabelOrValue = 'label' | 'value'; /** * Helper method to map labelDisplay and valueDisplay options to pure component option names * @method mapToOldKey * @param {string} labelOrValue * @param {Object} options * @returns {Object} */ export declare const mapValueLabelDisplay: (labelOrValue: LabelOrValue, options: GaugeOptions) => GaugeOptions; /** * Chained helper for mapping the option properties (and values) we expose in config.ts into property values that pure component accepts * This is for options that has new key name and can not directly be mapped with pure component props * @method convertToGaugeProperties * @param {Object} originalOptions * @returns {Object} */ export declare const convertToGaugeProperties: (originalOptions: GaugeOptions) => GaugeOptions; export {}; //# sourceMappingURL=gaugeUtils.d.ts.map