igniteui-angular-gauges
Version:
Ignite UI Angular gauge components.
237 lines (236 loc) • 8.28 kB
JavaScript
/*
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, Point_$type, markType } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { LinearGraphRectFrame } from "./LinearGraphRectFrame";
import { PathGeometry } from "igniteui-angular-core";
import { PathFigure } from "igniteui-angular-core";
import { LineSegment } from "igniteui-angular-core";
import { BrushUtil } from "igniteui-angular-core";
import { InterpolationUtil } from "igniteui-angular-core";
import { LinearGraphNeedleFrame } from "./LinearGraphNeedleFrame";
/**
* @hidden
*/
var LinearGraphScaleFrame = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(LinearGraphScaleFrame, _super);
function LinearGraphScaleFrame() {
var _this = _super.call(this) || this;
_this.m = null;
_this.u = 0;
_this.r = 0;
_this.s = 0;
_this.t = 0;
_this.l = null;
_this.j = null;
_this.w = 0;
_this.v = 0;
_this.ad = null;
_this.x = 0;
_this.i = null;
_this.p = 0;
_this.o = 0;
_this.ac = null;
_this.q = 0;
_this.e = null;
_this.d = null;
_this.f = null;
_this.c = null;
_this.g = null;
_this.h = null;
_this.n = 0;
_this.ab = null;
_this.m = new List$1(LinearGraphRectFrame.$, 0);
_this.j = new Array(0);
_this.i = new Array(0);
_this.e = new Array(0);
_this.d = new Array(0);
_this.f = new Array(0);
_this.c = new Array(0);
_this.g = new Array(0);
_this.h = new Array(0);
_this.l = new LinearGraphRectFrame();
return _this;
}
LinearGraphScaleFrame.prototype.ae = function (a, b, c, d) {
var _this = this;
var e = new PathGeometry();
var f = new PathFigure();
var g = a.x;
var h = a.y;
var i, j, k, l;
if (d == 1) {
i = ((function () {
var $ret = new LineSegment(1);
$ret.c = { $type: Point_$type, x: g + b * _this.s, y: h };
return $ret;
})());
j = ((function () {
var $ret = new LineSegment(1);
$ret.c = { $type: Point_$type, x: g + b * _this.t, y: h };
return $ret;
})());
k = ((function () {
var $ret = new LineSegment(1);
$ret.c = { $type: Point_$type, x: g + b * _this.t, y: h + c };
return $ret;
})());
l = ((function () {
var $ret = new LineSegment(1);
$ret.c = { $type: Point_$type, x: g + b * _this.s, y: h + c };
return $ret;
})());
}
else {
i = ((function () {
var $ret = new LineSegment(1);
$ret.c = { $type: Point_$type, x: g, y: b * (1 - _this.t) };
return $ret;
})());
j = ((function () {
var $ret = new LineSegment(1);
$ret.c = { $type: Point_$type, x: g + c, y: b * (1 - _this.t) };
return $ret;
})());
k = ((function () {
var $ret = new LineSegment(1);
$ret.c = { $type: Point_$type, x: g + c, y: b * (1 - _this.s) };
return $ret;
})());
l = ((function () {
var $ret = new LineSegment(1);
$ret.c = { $type: Point_$type, x: g, y: b * (1 - _this.s) };
return $ret;
})());
}
f._startPoint = i.c;
f._segments.add(j);
f._segments.add(k);
f._segments.add(l);
f._isClosed = true;
e.c.add(f);
return e;
};
LinearGraphScaleFrame.prototype.y = function (a, b, c) {
this.ad = BrushUtil.n(b.ad, a, c.ad, 0);
this.ac = BrushUtil.n(b.ac, a, c.ac, 0);
if (b.ab == null && c.ab == null) {
this.ab = null;
}
else {
this.ab = BrushUtil.n(b.ab, a, c.ab, 0);
}
this.u = b.u + (c.u - b.u) * a;
this.r = b.r + (c.r - b.r) * a;
this.s = b.s + (c.s - b.s) * a;
this.t = b.t + (c.t - b.t) * a;
this.n = b.n + (c.n - b.n) * a;
this.w = b.w + (c.w - b.w) * a;
this.v = b.v + (c.v - b.v) * a;
this.p = b.p + (c.p - b.p) * a;
this.o = b.o + (c.o - b.o) * a;
this.x = b.x + (c.x - b.x) * a;
this.q = b.q + (c.q - b.q) * a;
this.j = this.a(a, this.j, b.j, c.j);
this.i = this.a(a, this.i, b.i, c.i);
this.e = this.a(a, this.e, b.e, c.e);
this.f = this.a(a, this.f, b.f, c.f);
this.c = this.a(a, this.c, b.c, c.c);
this.g = this.a(a, this.g, b.g, c.g);
this.h = this.a(a, this.h, b.h, c.h);
this.d = this.b(a, this.d, b.d, c.d);
this.aa(a, this.m, b.m, c.m);
this.l = this.k(a, b.l, c.l);
};
LinearGraphScaleFrame.prototype.a = function (a, b, c, d) {
var e = Math.max(c.length, d.length);
var f = Math.min(c.length, d.length);
if (b.length != e) {
b = new Array(e);
}
var g = 0;
if (c.length > 0) {
g = c[c.length - 1];
}
var h = 0;
if (d.length > 0) {
h = d[d.length - 1];
}
var i = c.length > d.length;
var j = 0;
for (j = 0; j < f; j++) {
b[j] = c[j] + (d[j] - c[j]) * a;
}
var k;
var l;
for (j = f; j < e; j++) {
if (i) {
k = c[j];
l = h;
}
else {
k = g;
l = d[j];
}
b[j] = k + (l - k) * a;
}
return b;
};
LinearGraphScaleFrame.prototype.b = function (a, b, c, d) {
var e = Math.max(c.length, d.length);
var f = Math.min(c.length, d.length);
if (b.length != e) {
b = new Array(e);
}
var g = null;
if (c.length > 0) {
g = c[c.length - 1];
}
var h = null;
if (d.length > 0) {
h = d[d.length - 1];
}
var i = c.length > d.length;
var j = 0;
for (j = 0; j < f; j++) {
b[j] = d[j];
}
var k;
var l;
for (j = f; j < e; j++) {
if (i) {
k = c[j];
l = h;
}
else {
k = g;
l = d[j];
}
if (l != null) {
b[j] = l;
}
else {
b[j] = k;
}
}
return b;
};
LinearGraphScaleFrame.prototype.aa = function (a, b, c, d) {
InterpolationUtil.e(LinearGraphRectFrame.$, b, a, c, d, function () { return new LinearGraphRectFrame(); }, LinearGraphRectFrame.a);
};
LinearGraphScaleFrame.prototype.k = function (a, b, c) {
var d = 1 - a;
return LinearGraphRectFrame.a(a, d, b, c);
};
LinearGraphScaleFrame.prototype.z = function (a, b, c, d) {
InterpolationUtil.e(LinearGraphNeedleFrame.$, b, a, c, d, function () { return new LinearGraphNeedleFrame(); }, LinearGraphNeedleFrame.a);
};
LinearGraphScaleFrame.$t = markType(LinearGraphScaleFrame, 'LinearGraphScaleFrame');
return LinearGraphScaleFrame;
}(Base));
export { LinearGraphScaleFrame };