UNPKG

igniteui-react-charts

Version:

Ignite UI React charting components for building rich data visualizations using TypeScript APIs.

325 lines (324 loc) 10.7 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 { Frame } from "./Frame"; import { Rect } from "igniteui-react-core"; import { List$1 } from "igniteui-react-core"; import { Array_$type, Number_$type, Point_$type, typeCast, markType } from "igniteui-react-core"; /** * @hidden */ var CategoryFrame = /** @class */ /*@__PURE__*/ (function (_super) { __extends(CategoryFrame, _super); function CategoryFrame(a) { var _this = _super.call(this) || this; _this.af = null; _this.k = new List$1(Array_$type, 0); _this.r = null; _this.p = new List$1(Number_$type, 0); _this.q = new List$1(Number_$type, 0); _this.s = new List$1(Point_$type, 0); _this.t = new List$1(Number_$type, 0); _this.v = new List$1(Point_$type, 0); _this.w = new List$1(Number_$type, 0); _this.n = new List$1(Point_$type, 0); _this.o = new List$1(Number_$type, 0); _this.m = new List$1(Number_$type, 0); _this.l = new List$1(Number_$type, 0); _this.u = new List$1(Number_$type, 0); _this.i = new List$1(List$1.$.specialize(Point_$type), 0); _this.j = new List$1(List$1.$.specialize(Number_$type), 0); _this.z = 0; _this.y = 0; _this.ag = null; _this.af = new Rect(0, 0, 0, 1, 1); _this.y = a; _this.ac(); return _this; } CategoryFrame.prototype.d = function (a, b, c) { this.ac(); var d = typeCast(CategoryFrame.$, b); var e = typeCast(CategoryFrame.$, c); var f = d.k.count; var g = e.k.count; var h = Math.max(f, g); var i = Math.max(d.s.count, e.s.count); var j = Math.max(d.v.count, e.v.count); var k = Math.max(d.p.count, e.p.count); var l = Math.max(d.n.count, e.n.count); var m = d.u.count > 0; if (m) { this.ad(this.u, a, d.u, e.u, h); } var n = d.t.count > 0; if (n) { this.ad(this.t, a, d.t, e.t, i); } var o = d.w.count > 0; if (o) { this.ad(this.w, a, d.w, e.w, j); } var p = d.q.count > 0; if (p) { this.ad(this.q, a, d.q, e.q, k); } var q = d.o.count > 0; if (q) { this.ad(this.o, a, d.o, e.o, l); } if (this.k.count < h) { while (this.k.count < h) { this.k.add(new Array(this.y)); } } if (this.k.count > h) { this.k.v(h, this.k.count - h); } if (m) { var r = 0; for (var s = 0; s < Math.min(f, g); ++s) { var t = this.k._inner[s]; r = a * this.u._inner[s]; r = r > 1 ? 1 : r; for (var u = 0; u < this.y; ++u) { t[u] = d.k._inner[s][u] + r * (e.k._inner[s][u] - d.k._inner[s][u]); } } } else { for (var v = 0; v < Math.min(f, g); ++v) { var w = this.k._inner[v]; for (var x = 0; x < this.y; ++x) { w[x] = d.k._inner[v][x] + a * (e.k._inner[v][x] - d.k._inner[v][x]); } } } if (f < g) { var y = new Array(this.y); for (var z = this.y - 1; z >= 0; --z) { y[z] = d.k.count > 0 ? d.k._inner[d.k.count - 1][z] : 0; } if (m) { var aa = 0; for (var ab = f; ab < g; ++ab) { var ac = this.k._inner[ab]; aa = a * this.u._inner[ab]; aa = aa > 1 ? 1 : aa; for (var ad = this.y - 1; ad >= 0; --ad) { ac[ad] = y[ad] + aa * (e.k._inner[ab][ad] - y[ad]); } } } else { for (var ae = f; ae < g; ++ae) { var af = this.k._inner[ae]; for (var ag = this.y - 1; ag >= 0; --ag) { af[ag] = y[ag] + a * (e.k._inner[ae][ag] - y[ag]); } } } } if (f > g) { var ah = new Array(this.y); for (var ai = this.y - 1; ai >= 0; --ai) { ah[ai] = e.k.count > 0 ? e.k._inner[e.k.count - 1][ai] : 0; } if (m) { var aj = 0; for (var ak = g; ak < f; ++ak) { var al = this.k._inner[ak]; aj = a * this.u._inner[ak]; aj = aj > 1 ? 1 : aj; for (var am = this.y - 1; am >= 0; --am) { al[am] = d.k._inner[ak][am] + aj * (ah[am] - d.k._inner[ak][am]); } } } else { for (var an = g; an < f; ++an) { var ao = this.k._inner[an]; for (var ap = this.y - 1; ap >= 0; --ap) { ao[ap] = d.k._inner[an][ap] + a * (ah[ap] - d.k._inner[an][ap]); } } } } if (n) { Frame.g(this.s, a, d.s, e.s, this.t); } else { Frame.b(this.s, a, d.s, e.s); } if (o) { Frame.g(this.v, a, d.v, e.v, this.w); } else { Frame.b(this.v, a, d.v, e.v); } if (p) { Frame.g(this.n, a, d.n, e.n, this.q); } else { Frame.b(this.n, a, d.n, e.n); } if (q) { Frame.h(this.m, a, d.m, e.m, this.o); Frame.h(this.l, a, d.l, e.l, this.o); } else { Frame.c(this.m, a, d.m, e.m); Frame.c(this.l, a, d.l, e.l); } if (d.r != null || e.r != null) { if (this.r == null) { this.r = new List$1(Number_$type, 0); } if (d.r == null) { d.r = new List$1(Number_$type, 0); } if (e.r == null) { e.r = new List$1(Number_$type, 0); } if (m) { Frame.h(this.r, a, d.r, e.r, this.u); Frame.h(this.r, a, d.r, e.r, this.u); } else { Frame.c(this.r, a, d.r, e.r); Frame.c(this.r, a, d.r, e.r); } } var aq = d.ag; var ar = e.ag; if (Rect.l_op_Equality(aq, null)) { aq = this.af; } if (Rect.l_op_Equality(ar, null)) { ar = this.af; } var as = aq.left + (ar.left - aq.left) * a; var at = aq.top + (ar.top - aq.top) * a; var au = Math.max(0, aq.width + (ar.width - aq.width) * a); var av = Math.max(0, aq.height + (ar.height - aq.height) * a); this.ag = new Rect(0, as, at, au, av); var aw = Math.max(Math.max(d.i.count, e.i.count), this.i.count); for (var ax = 0; ax < aw; ax++) { var ay = null; if (this.i.count <= ax) { ay = new List$1(Point_$type, 0); this.i.add(ay); } else { ay = this.i._inner[ax]; } var az = null; if (d.i.count <= ax) { az = new List$1(Point_$type, 0); d.i.add(az); } else { az = d.i._inner[ax]; } var a0 = null; if (e.i.count <= ax) { a0 = new List$1(Point_$type, 0); e.i.add(a0); } else { a0 = e.i._inner[ax]; } var a1 = null; if (this.j.count <= ax) { a1 = new List$1(Number_$type, 0); this.j.add(a1); } else { a1 = this.j._inner[ax]; } var a2 = null; if (d.j.count <= ax) { a2 = new List$1(Number_$type, 0); d.j.add(a2); } else { a2 = d.j._inner[ax]; } var a3 = null; if (e.j.count <= ax) { a3 = new List$1(Number_$type, 0); e.j.add(a3); } else { a3 = e.j._inner[ax]; } var a4 = Math.max(az.count, a0.count); var a5 = a2.count > 0; if (a5) { this.ad(a1, a, a2, a3, a4); } if (a5) { Frame.g(ay, a, az, a0, a1); } else { Frame.b(ay, a, az, a0); } } }; CategoryFrame.prototype.ad = function (a, b, c, d, e) { if (d.count == 0) { for (var f = 0; f < c.count; f++) { d.add(c._inner[f]); } } else { Frame.c(a, b, c, d); } if (a.count < e) { var g = a.count; for (var h = 0; h < e - g; h++) { a.add(1); } } }; CategoryFrame.prototype.ab = function () { this.u.clear(); this.w.clear(); this.t.clear(); this.q.clear(); this.o.clear(); this.j.clear(); }; CategoryFrame.prototype.aa = function () { this.ac(); this.ab(); this.ag = this.af; }; CategoryFrame.prototype.ae = function () { this.aa(); this.k.clear(); this.n.clear(); this.p.clear(); this.s.clear(); this.v.clear(); if (this.r != null) { this.r.clear(); } this.i.clear(); }; CategoryFrame.prototype.ac = function () { CategoryFrame.x++; if (CategoryFrame.x >= (0x7FFFFFFF - 1)) { CategoryFrame.x = 0; } this.z = CategoryFrame.x; }; CategoryFrame.$t = markType(CategoryFrame, 'CategoryFrame', Frame.$); CategoryFrame.x = 0; return CategoryFrame; }(Frame)); export { CategoryFrame };