UNPKG

igniteui-angular-gauges

Version:

Ignite UI Angular gauge components.

88 lines (87 loc) 2.86 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 { 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 */ export let RadialGaugeScaler = /*@__PURE__*/ (() => { class RadialGaugeScaler extends Base { constructor(a, b, c, d, e) { super(); 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; let f = MathUtil.p(this.e); let g = MathUtil.p(this.d); let h = RadialGaugeScaler.k(f, g, this.l); this.f = h.c; this.a = h.d; } get i() { return this.f; } get g() { return this.a; } static k(a, b, c) { if (c == 1 && b < a) { b += Math.PI * 2; } if (c == 0 && a < b) { a += Math.PI * 2; } if (c == 0) { let d = a; a = b; b = d; } return new Tuple$2(Number_$type, Number_$type, a, b); } h(a) { let 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; } let c = this.f + (this.a - this.f) * b; return c; } j(a) { let b = (a - this.f) / (this.a - this.f); if (this.l == 0) { b = 1 - b; } let c = this.c + (this.b - this.c) * b; return c; } } RadialGaugeScaler.$t = markType(RadialGaugeScaler, 'RadialGaugeScaler'); return RadialGaugeScaler; })();