igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
917 lines (916 loc) • 26.9 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, Number_$type, Point_$type, markType } from "igniteui-react-core";
import { Rect } from "igniteui-react-core";
import { List$1 } from "igniteui-react-core";
import { Random } from "igniteui-react-core";
import { isNaN_, isInfinity } from "igniteui-react-core";
/**
* @hidden
*/
var CategoryTransitionSourceFramePreparer = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(CategoryTransitionSourceFramePreparer, _super);
function CategoryTransitionSourceFramePreparer() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.c = new Random(0);
return _this;
}
CategoryTransitionSourceFramePreparer.prototype.x = function (a, b, c, d, e, f, g, h, i, j, k, l) {
var _this = this;
b.ad = new Rect(0, 0, 0, 1, 1);
b.h.clear();
b.m.clear();
b.p.clear();
b.s.clear();
b.k.clear();
b.j.clear();
b.i.clear();
b.f.clear();
if (b.o != null) {
b.o.clear();
}
var m = false;
var n = false;
var o = false;
if (e != null) {
o = e.c5;
}
if (f != null) {
m = f.df;
}
if (e != null) {
n = e.df;
}
var p = g;
if (p == 0) {
p = h;
}
var q = null;
if (p == 20) {
if (a.bo == null) {
p = 1;
}
q = a.kz();
}
switch (p) {
case 20:
var r = k();
this.ac(q, b, c, r, d);
break;
case 1:
var s = k();
this.ae(b, c, s, d, o);
break;
case 7:
this.ab(b, c, false, d, l);
break;
case 9:
this.ad(b, c, true, d, l);
break;
case 10:
this.ad(b, c, false, d, l);
break;
case 8:
this.ab(b, c, true, d, l);
break;
case 2:
this.af(b, c, false);
break;
case 3:
this.af(b, c, true);
break;
case 4:
this.ag(b, c, true);
break;
case 5:
this.ag(b, c, false);
break;
case 6:
this.l(b, c);
b.ad = new Rect(0, 0.5, 0.5, 0, 0);
break;
case 16:
if (o) {
this.aa(b, c, n, d, l);
}
else if (d) {
this.ad(b, c, m, d, l);
}
else {
this.ab(b, c, n, d, l);
}
break;
case 17:
if (o) {
this.z(b, c, !m, d, l);
}
else if (d) {
this.ad(b, c, !m, d, l);
}
else {
this.ab(b, c, !n, d, l);
}
break;
case 18:
if (o) {
var t = k();
this.ae(b, c, t, d, o);
}
else if (d) {
this.ab(b, c, n, d, l);
}
else {
this.ad(b, c, m, d, l);
}
break;
case 19:
if (o) {
var u = 1;
this.ae(b, c, u, d, o);
}
else if (d) {
this.ab(b, c, !n, d, l);
}
else {
this.ad(b, c, !m, d, l);
}
break;
case 12:
if (d) {
this.ag(b, c, m);
}
else {
this.af(b, c, n);
}
break;
case 13:
if (d) {
this.ag(b, c, !m);
}
else {
this.af(b, c, !n);
}
break;
case 14:
if (d) {
this.af(b, c, n);
}
else {
this.ag(b, c, m);
}
break;
case 15:
if (d) {
this.af(b, c, !n);
}
else {
this.ag(b, c, !m);
}
break;
case 11:
this.y(b, c);
break;
}
if (i == 0) {
i = j;
}
b.y();
c.y();
switch (i) {
case 3:
this.d(b.h.count, p, b.r, c.r, e, f, d, l);
this.d(b.p.count, p, b.q, c.q, e, f, d, l);
this.d(b.s.count, p, b.t, c.t, e, f, d, l);
this.d(b.k.count, p, b.n, c.n, e, f, d, l);
this.d(b.j.count, p, b.l, c.l, e, f, d, l);
this.o(b, c, function (v, w, x) { return _this.d(v.count, p, b.g._inner[x], c.g._inner[x], e, f, d, l); });
break;
case 2:
var v_1 = k();
this.f(b.h.count, v_1, p, b.h, c.h, b.r, c.r, e, f, d, l);
this.h(b.p.count, v_1, p, b.p, c.p, b.q, c.q, e, f, d, l);
this.h(b.s.count, v_1, p, b.s, c.s, b.t, c.t, e, f, d, l);
this.h(b.k.count, v_1, p, b.k, c.k, b.n, c.n, e, f, d, l);
this.g(b.j.count, v_1, p, b.j, c.j, b.l, c.l, e, f, d, l);
this.o(b, c, function (w, x, y) { return _this.h(w.count, v_1, p, w, x, b.g._inner[y], c.g._inner[y], e, f, d, l); });
break;
case 4:
this.e(b.h.count, p, b.r, c.r);
this.e(b.p.count, p, b.q, c.q);
this.e(b.s.count, p, b.t, c.t);
this.e(b.k.count, p, b.n, c.n);
this.e(b.j.count, p, b.l, c.l);
this.o(b, c, function (w, x, y) { return _this.e(w.count, p, b.g._inner[y], c.g._inner[y]); });
break;
}
};
CategoryTransitionSourceFramePreparer.prototype.ac = function (a, b, c, d, e) {
var _this = this;
if (a.o != null || b.o != null || c.o != null) {
if (a.o == null) {
a.o = new List$1(Number_$type, 0);
}
if (b.o == null) {
b.o = new List$1(Number_$type, 0);
}
if (c.o == null) {
c.o = new List$1(Number_$type, 0);
}
this.t(a.o, b.o, c.o, e, d, true);
}
this.r(a.h, b.h, c.h, e, d, true);
this.t(a.m, b.m, c.m, e, d, true);
this.w(a.p, b.p, c.p, e, d, true);
this.w(a.s, b.s, c.s, e, d, true);
this.w(a.k, b.k, c.k, e, d, true);
this.t(a.j, b.j, c.j, e, d, true);
this.t(a.i, b.i, c.i, e, d, true);
this.n(a, b, c, function (f, g, h, i) { return _this.w(f, g, h, e, d, true); });
};
CategoryTransitionSourceFramePreparer.prototype.e = function (a, b, c, d) {
if (a == 0) {
return;
}
for (var e = 0; e < a; e++) {
c.add(1 + this.c.nextDouble());
d.add(1 + this.c.nextDouble());
}
};
CategoryTransitionSourceFramePreparer.prototype.f = function (a, b, c, d, e, f, g, h, i, j, k) {
if (a == 0) {
return;
}
var l = false;
var m = i;
if (j) {
m = h;
}
if (m != null) {
l = m.df;
}
var n = k.bottom;
var o = k.bottom;
var p = k.top;
if (j) {
o = k.right;
p = k.left;
}
if (l) {
o = k.top;
p = k.bottom;
if (j) {
o = k.left;
p = k.right;
}
}
b = Math.max(b, Math.min(p, o));
b = Math.min(b, Math.max(p, o));
n = 0;
var q;
for (var r = 0; r < a; r++) {
q = e._inner[r];
for (var s = 1; s < q.length; s++) {
if (isNaN_(q[s]) || isInfinity(q[s])) {
continue;
}
n = Math.max(n, Math.abs(b - q[s]));
}
}
var t;
var u;
var v;
for (var w = 0; w < a; w++) {
q = e._inner[w];
t = Math.abs(q[1] - b);
u = Math.abs(q[1] - b);
for (var x = 1; x < q.length; x++) {
if (isNaN_(q[x]) || isInfinity(q[x])) {
continue;
}
t = Math.max(Math.abs(q[x] - b), t);
u = Math.min(Math.abs(q[x] - b), u);
}
var y = (t + u) / 2;
if (isNaN_(y) || n == 0) {
v = 1;
}
else {
v = y / n;
}
f.add(2 - v);
g.add(2 - v);
}
};
CategoryTransitionSourceFramePreparer.prototype.h = function (a, b, c, d, e, f, g, h, i, j, k) {
if (a == 0) {
return;
}
var l = false;
var m = i;
if (j) {
m = h;
}
if (m != null) {
l = m.df;
}
var n = k.bottom;
var o = k.bottom;
var p = k.top;
if (j) {
o = k.right;
p = k.left;
}
if (l) {
o = k.top;
p = k.bottom;
if (j) {
o = k.left;
p = k.right;
}
}
b = Math.max(b, Math.min(p, o));
b = Math.min(b, Math.max(p, o));
n = 0;
var q;
for (var r = 0; r < a; r++) {
q = e._inner[r];
if (j) {
if (isNaN_(q.x) || isInfinity(q.x)) {
continue;
}
n = Math.max(n, Math.abs(q.x - b));
}
else {
if (isNaN_(q.y) || isInfinity(q.y)) {
continue;
}
n = Math.max(n, Math.abs(q.y - b));
}
}
var s;
for (var t = 0; t < a; t++) {
q = e._inner[t];
var u = void 0;
if (j) {
u = q.x;
}
else {
u = q.y;
}
if (isNaN_(u) || isInfinity(u) || n == 0) {
s = 1;
}
else {
s = Math.abs(u - b) / n;
}
f.add(2 - s);
g.add(2 - s);
}
};
CategoryTransitionSourceFramePreparer.prototype.g = function (a, b, c, d, e, f, g, h, i, j, k) {
if (a == 0) {
return;
}
var l = false;
var m = i;
if (j) {
m = h;
}
if (m != null) {
l = m.df;
}
var n = k.bottom;
var o = k.bottom;
var p = k.top;
if (j) {
o = k.right;
p = k.left;
}
if (l) {
o = k.top;
p = k.bottom;
if (j) {
o = k.left;
p = k.right;
}
}
b = Math.max(b, Math.min(p, o));
b = Math.min(b, Math.max(p, o));
n = 0;
var q;
for (var r = 0; r < a; r++) {
q = e._inner[r];
if (isNaN_(q) || isInfinity(q)) {
continue;
}
n = Math.max(n, Math.abs(q - b));
}
var s;
for (var t = 0; t < a; t++) {
q = e._inner[t];
var u = void 0;
u = q;
if (n == 0 || isNaN_(u) || isInfinity(u)) {
s = 1;
}
else {
s = Math.abs(u - b) / n;
}
f.add(2 - s);
g.add(2 - s);
}
};
CategoryTransitionSourceFramePreparer.prototype.d = function (a, b, c, d, e, f, g, h) {
if (a == 0) {
return;
}
var i = e;
if (g) {
i = f;
}
var j = false;
if (i != null) {
j = i.df;
}
var k;
for (var l = 0; l < a; l++) {
if (a == 1) {
k = 1;
}
else {
k = l / (a - 1);
}
k = 1 - k;
c.add(1 + k);
d.add(1 + k);
}
};
CategoryTransitionSourceFramePreparer.prototype.y = function (a, b) {
var _this = this;
a.h.clear();
a.m.clear();
a.p.clear();
a.s.clear();
a.k.clear();
a.j.clear();
a.i.clear();
a.f.clear();
if (a.o != null) {
a.o.clear();
}
if (a.o != null || b.o != null) {
if (a.o == null) {
a.o = new List$1(Number_$type, 0);
}
if (b.o == null) {
b.o = new List$1(Number_$type, 0);
}
this.j(a.o, b.o);
}
this.i(a.h, b.h);
this.j(a.m, b.m);
this.m(a.p, b.p);
this.m(a.s, b.s);
this.m(a.k, b.k);
this.j(a.j, b.j);
this.j(a.i, b.i);
this.o(a, b, function (c, d, e) { return _this.m(c, d); });
var c = a.h.count;
var d = a.h;
var e;
var f;
var g;
var h;
for (var i = 0; i < c; i++) {
e = d._inner[i];
f = e[1];
g = e[1];
for (var j = 2; j < e.length; j++) {
f = Math.min(f, e[j]);
g = Math.max(g, e[j]);
}
h = (f + g) / 2;
for (var k = 1; k < e.length; k++) {
e[k] = h;
}
}
var l = a.j.count;
var m = a.j;
var n = a.i;
for (var o = 0; o < l; o++) {
m._inner[o] = 0;
n._inner[o] = 0;
}
};
CategoryTransitionSourceFramePreparer.prototype.af = function (a, b, c) {
if (c) {
this.l(a, b);
a.ad = new Rect(0, 1, 0, 0, 1);
}
else {
this.l(a, b);
a.ad = new Rect(0, 0, 0, 0, 1);
}
};
CategoryTransitionSourceFramePreparer.prototype.ag = function (a, b, c) {
if (c) {
this.l(a, b);
a.ad = new Rect(0, 0, 0, 1, 0);
}
else {
this.l(a, b);
a.ad = new Rect(0, 0, 1, 1, 0);
}
};
CategoryTransitionSourceFramePreparer.prototype.l = function (a, b) {
var _this = this;
a.h.clear();
a.m.clear();
a.p.clear();
a.s.clear();
a.k.clear();
a.j.clear();
a.i.clear();
a.f.clear();
if (a.o != null) {
a.o.clear();
}
if (a.o != null || b.o != null) {
if (a.o == null) {
a.o = new List$1(Number_$type, 0);
}
if (b.o == null) {
b.o = new List$1(Number_$type, 0);
}
this.j(a.o, b.o);
}
this.i(a.h, b.h);
this.j(a.m, b.m);
this.m(a.p, b.p);
this.m(a.s, b.s);
this.m(a.k, b.k);
this.j(a.j, b.j);
this.j(a.i, b.i);
this.o(a, b, function (c, d, e) { return _this.m(c, d); });
};
CategoryTransitionSourceFramePreparer.prototype.v = function (a, b, c, d, e) {
var f = b.count;
var g;
var h;
for (var i = 0; i < f; i++) {
g = b._inner[i];
if (e) {
if (c) {
h = { $type: Point_$type, x: d, y: g.y };
}
else {
h = { $type: Point_$type, x: g.x, y: d };
}
}
else {
if (c) {
h = { $type: Point_$type, x: g.x, y: d };
}
else {
h = { $type: Point_$type, x: d, y: g.y };
}
}
a.add(h);
}
};
CategoryTransitionSourceFramePreparer.prototype.w = function (a, b, c, d, e, f) {
var g = c.count;
var h;
var i;
var j = a.count;
for (var k = 0; k < g; k++) {
h = c._inner[k];
if (j > k) {
h = a._inner[k];
}
if (f) {
if (d) {
i = { $type: Point_$type, x: h.x, y: h.y };
}
else {
i = { $type: Point_$type, x: h.x, y: h.y };
}
}
else {
if (d) {
i = { $type: Point_$type, x: h.x, y: h.y };
}
else {
i = { $type: Point_$type, x: h.x, y: h.y };
}
}
b.add(i);
}
};
CategoryTransitionSourceFramePreparer.prototype.m = function (a, b) {
var c = b.count;
var d;
var e;
for (var f = 0; f < c; f++) {
d = b._inner[f];
e = { $type: Point_$type, x: d.x, y: d.y };
a.add(e);
}
};
CategoryTransitionSourceFramePreparer.prototype.i = function (a, b) {
var c = b.count;
var d = b;
var e;
var f;
var g = a;
for (var h = 0; h < c; h++) {
f = d._inner[h];
e = new Array(f.length);
for (var i = 0; i < e.length; i++) {
e[i] = f[i];
}
g.add(e);
}
};
CategoryTransitionSourceFramePreparer.prototype.q = function (a, b, c, d, e) {
var f = b.count;
var g = b;
var h;
var i;
var j = a;
for (var k = 0; k < f; k++) {
i = g._inner[k];
h = new Array(i.length);
if (e) {
h[0] = i[0];
for (var l = 1; l < h.length; l++) {
h[l] = d;
}
}
else {
h[0] = d;
for (var m = 1; m < h.length; m++) {
h[m] = i[m];
}
}
j.add(h);
}
};
CategoryTransitionSourceFramePreparer.prototype.r = function (a, b, c, d, e, f) {
var g = c.count;
var h = c;
var i;
var j;
var k;
var l;
var m = a.count;
var n = b;
for (var o = 0; o < g; o++) {
j = h._inner[o];
l = j;
if (m > o) {
j = a._inner[o];
}
i = new Array(j.length);
if (f) {
i[0] = l[0];
for (var p = 1; p < i.length; p++) {
i[p] = j[p];
}
}
else {
i[0] = l[0];
for (var q = 1; q < i.length; q++) {
i[q] = j[q];
}
}
n.add(i);
}
};
CategoryTransitionSourceFramePreparer.prototype.u = function (a, b) {
var c = b.count;
var d;
for (var e = 0; e < c; e++) {
d = b._inner[e];
a.add(d);
}
};
CategoryTransitionSourceFramePreparer.prototype.k = function (a, b) {
var c = b.count;
var d;
for (var e = 0; e < c; e++) {
d = b._inner[e];
a.add(d);
}
};
CategoryTransitionSourceFramePreparer.prototype.j = function (a, b) {
var c = b.count;
var d;
for (var e = 0; e < c; e++) {
d = b._inner[e];
a.add(d);
}
};
CategoryTransitionSourceFramePreparer.prototype.s = function (a, b, c, d, e) {
var f = b.count;
var g;
for (var h = 0; h < f; h++) {
g = b._inner[h];
a.add(g);
}
};
CategoryTransitionSourceFramePreparer.prototype.t = function (a, b, c, d, e, f) {
var g = c.count;
var h;
var i = a.count;
for (var j = 0; j < g; j++) {
if (i > j) {
h = a._inner[j];
}
else {
h = c._inner[j];
}
b.add(h);
}
};
CategoryTransitionSourceFramePreparer.prototype.ab = function (a, b, c, d, e) {
var f = e.right;
if (!c) {
f = e.left;
}
var g = false;
if (d) {
g = true;
}
if (a.o != null || b.o != null) {
if (a.o == null) {
a.o = new List$1(Number_$type, 0);
}
if (b.o == null) {
b.o = new List$1(Number_$type, 0);
}
this.s(a.o, b.o, d, f, g);
}
this.q(a.h, b.h, d, f, g);
this.s(a.m, b.m, d, f, g);
this.v(a.p, b.p, d, f, g);
this.v(a.s, b.s, d, f, g);
this.v(a.k, b.k, d, f, g);
this.s(a.j, b.j, d, f, g);
this.s(a.i, b.i, d, f, g);
this.p(a, b, d, f, g);
};
CategoryTransitionSourceFramePreparer.prototype.ad = function (a, b, c, d, e) {
var f = e.bottom;
if (c) {
f = e.top;
}
var g = true;
if (d) {
g = false;
}
if (a.o != null || b.o != null) {
if (a.o == null) {
a.o = new List$1(Number_$type, 0);
}
if (b.o == null) {
b.o = new List$1(Number_$type, 0);
}
this.s(a.o, b.o, d, f, g);
}
this.q(a.h, b.h, d, f, g);
this.s(a.m, b.m, d, f, g);
this.v(a.p, b.p, d, f, g);
this.v(a.s, b.s, d, f, g);
this.v(a.k, b.k, d, f, g);
this.s(a.j, b.j, d, f, g);
this.s(a.i, b.i, d, f, g);
this.p(a, b, d, f, g);
};
CategoryTransitionSourceFramePreparer.prototype.aa = function (a, b, c, d, e) {
var f = 0;
var g = false;
if (a.o != null || b.o != null) {
if (a.o == null) {
a.o = new List$1(Number_$type, 0);
}
if (b.o == null) {
b.o = new List$1(Number_$type, 0);
}
this.s(a.o, b.o, d, f, g);
}
this.q(a.h, b.h, d, f, g);
this.s(a.m, b.m, d, f, g);
this.v(a.p, b.p, d, f, g);
this.v(a.s, b.s, d, f, g);
this.v(a.k, b.k, d, f, g);
this.s(a.j, b.j, d, f, g);
this.s(a.i, b.i, d, f, g);
this.p(a, b, d, f, g);
};
CategoryTransitionSourceFramePreparer.prototype.z = function (a, b, c, d, e) {
var f = Math.PI * 2;
var g = false;
if (a.o != null || b.o != null) {
if (a.o == null) {
a.o = new List$1(Number_$type, 0);
}
if (b.o == null) {
b.o = new List$1(Number_$type, 0);
}
this.s(a.o, b.o, d, f, g);
}
this.q(a.h, b.h, d, f, g);
this.s(a.m, b.m, d, f, g);
this.v(a.p, b.p, d, f, g);
this.v(a.s, b.s, d, f, g);
this.v(a.k, b.k, d, f, g);
this.s(a.j, b.j, d, f, g);
this.s(a.i, b.i, d, f, g);
this.p(a, b, d, f, g);
};
CategoryTransitionSourceFramePreparer.prototype.ae = function (a, b, c, d, e) {
if (a.o != null || b.o != null) {
if (a.o == null) {
a.o = new List$1(Number_$type, 0);
}
if (b.o == null) {
b.o = new List$1(Number_$type, 0);
}
this.s(a.o, b.o, d, c, true);
}
this.q(a.h, b.h, d, c, true);
if (e && a.h != null) {
for (var f = 0; f < a.h.count; f++) {
if (f < b.h.count) {
var g = a.h._inner[f];
var h = b.h._inner[f];
g[g.length - 1] = h[h.length - 1];
}
}
}
this.s(a.m, b.m, d, c, true);
this.v(a.p, b.p, d, c, true);
this.v(a.s, b.s, d, c, true);
this.v(a.k, b.k, d, c, true);
this.s(a.j, b.j, d, c, true);
this.s(a.i, b.i, d, c, true);
this.p(a, b, d, c, true);
};
CategoryTransitionSourceFramePreparer.prototype.p = function (a, b, c, d, e) {
var _this = this;
this.o(a, b, function (f, g, h) { return _this.v(f, g, c, d, true); });
};
CategoryTransitionSourceFramePreparer.prototype.a = function (a, b) {
var c = null;
if (a.f.count <= b) {
c = new List$1(Point_$type, 0);
a.f.add(c);
}
else {
c = a.f._inner[b];
}
return c;
};
CategoryTransitionSourceFramePreparer.prototype.b = function (a, b) {
var c = null;
if (a.g.count <= b) {
c = new List$1(Number_$type, 0);
a.g.add(c);
}
else {
c = a.g._inner[b];
}
return c;
};
CategoryTransitionSourceFramePreparer.prototype.o = function (a, b, c) {
var d = Math.max(a.f.count, b.f.count);
for (var e = 0; e < d; e++) {
var f = this.a(b, e);
var g = this.a(a, e);
this.b(b, e);
this.b(a, e);
c(g, f, e);
}
};
CategoryTransitionSourceFramePreparer.prototype.n = function (a, b, c, d) {
var e = Math.max(b.f.count, c.f.count);
for (var f = 0; f < e; f++) {
var g = this.a(a, f);
var h = this.a(c, f);
var i = this.a(b, f);
this.b(a, f);
this.b(c, f);
this.b(b, f);
d(g, i, h, f);
}
};
CategoryTransitionSourceFramePreparer.$t = markType(CategoryTransitionSourceFramePreparer, 'CategoryTransitionSourceFramePreparer');
return CategoryTransitionSourceFramePreparer;
}(Base));
export { CategoryTransitionSourceFramePreparer };