UNPKG

igniteui-angular-gauges

Version:

Ignite UI Angular gauge components.

98 lines (97 loc) 3.17 kB
/* THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE AGREEMENT ("AGREEMENT") LOCATED HERE: https://www.infragistics.com/legal/license/igultimate-la https://www.infragistics.com/legal/license/igultimate-eula GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company. */ import { __extends } from "tslib"; import { Base, Number_$type, markType } from "igniteui-angular-core"; import { Tuple$2 } from "igniteui-angular-core"; import { MathUtil } from "igniteui-angular-core"; import { isNaN_, isInfinity } from "igniteui-angular-core"; /** * @hidden */ var RadialGaugeScaler = /** @class */ /*@__PURE__*/ (function (_super) { __extends(RadialGaugeScaler, _super); function RadialGaugeScaler(a, b, c, d, e) { var _this = _super.call(this) || this; _this.e = 0; _this.d = 0; _this.c = 0; _this.b = 0; _this.l = 0; _this.f = 0; _this.a = 0; _this.e = c; _this.d = d; if (isNaN_(_this.e) || isInfinity(_this.e)) { _this.e = 135; } if (isNaN_(_this.d) || isInfinity(_this.d)) { _this.d = 45; } _this.l = e; _this.c = a; _this.b = b; var f = MathUtil.p(_this.e); var g = MathUtil.p(_this.d); var h = RadialGaugeScaler.k(f, g, _this.l); _this.f = h.c; _this.a = h.d; return _this; } Object.defineProperty(RadialGaugeScaler.prototype, "i", { get: function () { return this.f; }, enumerable: false, configurable: true }); Object.defineProperty(RadialGaugeScaler.prototype, "g", { get: function () { return this.a; }, enumerable: false, configurable: true }); RadialGaugeScaler.k = function (a, b, c) { if (c == 1 && b < a) { b += Math.PI * 2; } if (c == 0 && a < b) { a += Math.PI * 2; } if (c == 0) { var d = a; a = b; b = d; } return new Tuple$2(Number_$type, Number_$type, a, b); }; RadialGaugeScaler.prototype.h = function (a) { var b = NaN; if (this.c == this.b) { b = 0; } else { b = (a - this.c) / (this.b - this.c); } if (this.l == 0) { b = 1 - b; } var c = this.f + (this.a - this.f) * b; return c; }; RadialGaugeScaler.prototype.j = function (a) { var b = (a - this.f) / (this.a - this.f); if (this.l == 0) { b = 1 - b; } var c = this.c + (this.b - this.c) * b; return c; }; RadialGaugeScaler.$t = markType(RadialGaugeScaler, 'RadialGaugeScaler'); return RadialGaugeScaler; }(Base)); export { RadialGaugeScaler };