igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
1,194 lines (1,193 loc) • 42.2 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 { Series } from "./Series";
import { NumericXAxis } from "./NumericXAxis";
import { DependencyProperty } from "igniteui-react-core";
import { NumericYAxis } from "./NumericYAxis";
import { Color } from "igniteui-react-core";
import { ScatterFrame } from "./ScatterFrame";
import { Defaults } from "./Defaults";
import { KDTree2D } from "./KDTree2D";
import { Point_$type, typeGetValue, runOn, delegateRemove, typeCast, delegateCombine, markType, markDep, toNullable } from "igniteui-react-core";
import { DataLegendSeriesValueInfo } from "igniteui-react-core";
import { DataLegendSeriesContext } from "igniteui-react-core";
import { List$1 } from "igniteui-react-core";
import { Rect } from "igniteui-react-core";
import { IFastItemsSource_$type } from "igniteui-react-core";
import { BrushUtil } from "igniteui-react-core";
import { SeriesView } from "./SeriesView";
import { TestRandomness } from "igniteui-react-core";
import { DefaultRandomnessSource } from "igniteui-react-core";
import { KDPointData } from "./KDPointData";
import { ScalerParams } from "./ScalerParams";
import { ProgressiveLoadStatusEventArgs } from "./ProgressiveLoadStatusEventArgs";
import { SearchArgs } from "./SearchArgs";
import { KDTreeNode2D } from "./KDTreeNode2D";
import { AxisRange } from "./AxisRange";
import { PropertyMetadata } from "igniteui-react-core";
import { truncate, isNaN_, isInfinity, logBase, intDivide } from "igniteui-react-core";
import { boxArray$1, arrayShallowClone } from "igniteui-react-core";
import { dateNow } from "igniteui-react-core";
import { RenderingContext } from "igniteui-react-core";
import { CanvasViewRenderer } from "igniteui-react-core";
import { Rectangle } from "igniteui-react-core";
/**
* @hidden
*/
var HighDensityScatterSeries = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(HighDensityScatterSeries, _super);
function HighDensityScatterSeries() {
var _this = _super.call(this) || this;
_this.xd = null;
_this.xf = null;
_this.yp = 0;
_this.xi = false;
_this.x4 = Defaults.aq.o;
_this.x3 = Defaults.aq.n;
_this.x2 = Defaults.aq.m;
_this.x1 = Defaults.aq.l;
_this.x0 = Defaults.ap.o;
_this.xz = Defaults.ap.n;
_this.xy = Defaults.ap.m;
_this.xx = Defaults.ap.l;
_this.w5 = null;
_this.xa = null;
_this.xb = null;
_this.w6 = null;
_this.w8 = null;
_this.xk = false;
_this.yq = 0;
_this.ys = 0;
_this.ym = 0;
_this.yl = 0;
_this.progressiveLoadStatusChanged = null;
_this.xp = null;
_this.xv = 0;
_this.xu = 0;
_this.xw = 0;
_this.yb = 0;
_this.x9 = 0;
_this.ya = 0;
_this.yc = 0;
_this.ye = 0;
_this.yg = 0;
_this.yf = 0;
_this.yd = 0;
_this.xr = 0;
_this.xs = 0;
_this.xt = 0;
_this.xq = 0;
_this.yo = 0;
_this.yn = 0;
_this.w2 = null;
_this.yr = 0;
_this.xj = false;
_this._itemIndexes = null;
_this.w3 = null;
_this.w0 = null;
_this.xc = null;
_this.ab = HighDensityScatterSeries.$;
_this.f8 = false;
return _this;
}
HighDensityScatterSeries.prototype.bk = function () {
return new HighDensityScatterSeries();
};
HighDensityScatterSeries.prototype.get_fo = function () {
return true;
};
HighDensityScatterSeries.prototype.jk = function () {
if (!isNaN_(this.jj)) {
return _super.prototype.jk.call(this);
}
return Defaults.q;
};
HighDensityScatterSeries.prototype.get_fw = function () {
return true;
};
Object.defineProperty(HighDensityScatterSeries.prototype, "xe", {
get: function () {
return this.xd;
},
set: function (a) {
if (this.xd != a) {
var b = this.xe;
this.xd = a;
this.raisePropertyChanged("XColumn", b, this.xe);
}
},
enumerable: false,
configurable: true
});
HighDensityScatterSeries.prototype.getDataLegendSeriesContextAt = function (a, b) {
var c = { $type: Point_$type, x: a, y: b };
var d = this.kn(c);
var e = d == null ? NaN : this.ix(d, "XMemberPath");
var f = d == null ? NaN : this.ix(d, "YMemberPath");
var g = new DataLegendSeriesValueInfo();
g.l = e;
g.a = 13;
g.q = "X";
g.r = this.zb != null ? this.zb : "X";
g.s = this.y7 != null ? this.y7 : "X:";
g.t = this.y9 != null ? this.y9 : "";
var h = new DataLegendSeriesValueInfo();
h.l = f;
h.a = 14;
h.q = "Y";
h.r = this.zj != null ? this.zj : "Y";
h.s = this.zf != null ? this.zf : "Y:";
h.t = this.zh != null ? this.zh : "";
var i = new DataLegendSeriesContext();
i.e = ((function () {
var $ret = new List$1(DataLegendSeriesValueInfo.$, 0);
$ret.add(g);
$ret.add(h);
return $ret;
})());
i.h = this.mc();
return i;
};
HighDensityScatterSeries.prototype.kq = function (a, b) {
var c = this.nd(b);
if (c == HighDensityScatterSeries.$$p[10]) {
return this.kr(a, b, this.zb);
}
if (c == HighDensityScatterSeries.$$p[14]) {
return this.kr(a, b, this.zj);
}
return _super.prototype.kq.call(this, a, b);
};
HighDensityScatterSeries.prototype.md = function (a) {
var b = this.nd(a);
if (b == HighDensityScatterSeries.$$p[10]) {
return this.zb;
}
if (b == HighDensityScatterSeries.$$p[14]) {
return this.zj;
}
return _super.prototype.md.call(this, a);
};
Object.defineProperty(HighDensityScatterSeries.prototype, "xg", {
get: function () {
return this.xf;
},
set: function (a) {
if (this.xf != a) {
var b = this.xg;
this.xf = a;
this.raisePropertyChanged("YColumn", b, this.xg);
}
},
enumerable: false,
configurable: true
});
HighDensityScatterSeries.prototype.zy = function () {
if (this.w5 == null) {
return;
}
this.w5.t();
var a = this.w5;
a.progressiveThunkCompleted = delegateRemove(a.progressiveThunkCompleted, runOn(this, this.zl));
this.w5 = null;
};
HighDensityScatterSeries.prototype.ra = function (a, b, c, d) {
_super.prototype.ra.call(this, a, b, c, d);
switch (b) {
case HighDensityScatterSeries.$$p[8]:
case HighDensityScatterSeries.$$p[12]:
case HighDensityScatterSeries.$$p[9]:
case HighDensityScatterSeries.$$p[13]:
this.qf();
break;
case "SeriesViewer":
if (this.dc != null) {
var e = this.getEffectiveViewport1(this.cw);
this.xj = !e.isEmpty;
}
break;
case "FastItemsSource":
this.zy();
if (typeCast(IFastItemsSource_$type, c) != null) {
c.deregisterColumn(this.xe);
c.deregisterColumn(this.xg);
this.xe = null;
this.xg = null;
}
if (typeCast(IFastItemsSource_$type, d) != null) {
this.xe = this.dl(this.zb);
this.xg = this.dl(this.zj);
}
if ((this.w9 != null && !this.w9.c1()) || (this.w7 != null && !this.w7.c1())) {
this.rs(this.gg && c != null);
}
this.qm();
break;
case HighDensityScatterSeries.$$p[7]:
var f = this.w6;
this.w6 = this.w7;
this.zy();
if (f != null) {
f.rangeChanged = delegateRemove(f.rangeChanged, runOn(this, this.zo));
}
if (this.w6 != null) {
var g = this.w6;
g.rangeChanged = delegateCombine(g.rangeChanged, runOn(this, this.zo));
}
if (c != null) {
c.b0(this);
}
if (d != null) {
d.ct(this);
}
if ((this.w7 != null && !this.w7.c1()) || (d == null && c != null)) {
this.rs(false);
}
break;
case HighDensityScatterSeries.$$p[11]:
var h = this.w8;
this.w8 = this.w9;
this.zy();
if (h != null) {
h.rangeChanged = delegateRemove(h.rangeChanged, runOn(this, this.zo));
}
if (this.w8 != null) {
var i = this.w8;
i.rangeChanged = delegateCombine(i.rangeChanged, runOn(this, this.zo));
}
if (c != null) {
c.b0(this);
}
if (d != null) {
d.ct(this);
}
if ((this.w9 != null && !this.w9.c1()) || (d == null && c != null)) {
this.rs(false);
}
break;
case "MouseOverEnabled":
this.xk = this.f8;
this.rs(false);
break;
case HighDensityScatterSeries.$$p[10]:
if (this.dp != null) {
this.dp.deregisterColumn(this.xe);
this.xe = this.dl(this.zb);
}
break;
case "XColumn":
this.zy();
if (this.w7 != null && !this.w7.c1()) {
this.rs(false);
}
this.qm();
break;
case HighDensityScatterSeries.$$p[14]:
if (this.dp != null) {
this.dp.deregisterColumn(this.xg);
this.xg = this.dl(this.zj);
}
break;
case "YColumn":
this.zy();
if (this.w9 != null && !this.w9.c1()) {
this.rs(false);
}
this.qm();
break;
case HighDensityScatterSeries.$$p[6]:
this.zy();
this.rs(false);
this.ql();
break;
case HighDensityScatterSeries.$$p[3]:
this.rs(false);
this.ql();
break;
case HighDensityScatterSeries.$$p[1]:
this.rs(false);
this.ql();
break;
case HighDensityScatterSeries.$$p[0]:
case HighDensityScatterSeries.$$p[2]:
if (!this.w4.b8(this.aah, this.aag)) {
return;
}
this.zs();
this.rs(false);
this.ql();
break;
case HighDensityScatterSeries.$$p[4]:
this.yp = Math.max(typeGetValue(d) - 1, 0);
this.xi = this.yp > 0;
this.rs(false);
this.ql();
break;
case HighDensityScatterSeries.$$p[5]:
this.rs(false);
this.ql();
break;
}
};
HighDensityScatterSeries.prototype.zs = function () {
this.x1 = this.aah.l;
this.x4 = this.aah.o;
this.x3 = this.aah.n;
this.x2 = this.aah.m;
this.xx = this.aag.l;
this.x0 = this.aag.o;
this.xz = this.aag.n;
this.xy = this.aag.m;
this.vx = BrushUtil.h(truncate(this.x1), truncate(this.x4), truncate(this.x3), truncate(this.x2));
this.vh = BrushUtil.h(truncate(this.xx), truncate(this.x0), truncate(this.xz), truncate(this.xy));
};
HighDensityScatterSeries.prototype.xm = function (a) {
if (typeCast(NumericYAxis.$, a) !== null) {
return true;
}
return false;
};
HighDensityScatterSeries.prototype.xl = function (a) {
if (typeCast(NumericXAxis.$, a) !== null) {
return true;
}
return false;
};
HighDensityScatterSeries.prototype.zo = function (a, b) {
this.zy();
this.rs(false);
};
Object.defineProperty(HighDensityScatterSeries.prototype, "x8", {
get: function () {
return this.x0 - this.x4;
},
enumerable: false,
configurable: true
});
Object.defineProperty(HighDensityScatterSeries.prototype, "x7", {
get: function () {
return this.xz - this.x3;
},
enumerable: false,
configurable: true
});
Object.defineProperty(HighDensityScatterSeries.prototype, "x6", {
get: function () {
return this.xy - this.x2;
},
enumerable: false,
configurable: true
});
Object.defineProperty(HighDensityScatterSeries.prototype, "x5", {
get: function () {
return this.xx - this.x1;
},
enumerable: false,
configurable: true
});
HighDensityScatterSeries.prototype.he = function (a, b, c) {
var d = _super.prototype.he.call(this, a, b, c);
if (this.w9 == null || this.w7 == null || this.w7.bi == null || this.w9.bi == null || this.xg == null || this.xe == null || this.xg.count < 1 || this.xe.count < 1 || this.xg.count != this.xe.count || this.w7.l4 == this.w7.l3 || this.w9.l4 == this.w9.l3 || this.wu.isEmpty) {
d = false;
}
return d;
};
Object.defineProperty(HighDensityScatterSeries.prototype, "yw", {
get: function () {
return this.yq;
},
set: function (a) {
var b = this.yq;
this.yq = a;
this.raisePropertyChanged("ProgressiveStatus", b, this.yq);
},
enumerable: false,
configurable: true
});
HighDensityScatterSeries.prototype.rt = function (a) {
_super.prototype.rt.call(this, a);
this.zq(a, this.cw);
};
HighDensityScatterSeries.prototype.xh = function () {
if (TestRandomness.instance.testRandomnessSource != null) {
return TestRandomness.instance.testRandomnessSource;
}
return new DefaultRandomnessSource(0);
};
HighDensityScatterSeries.prototype.zq = function (a, b) {
if (this.d6(b)) {
return;
}
if (this.w5 == null && !this.xo) {
var c = new List$1(KDPointData.$, 2, this.xe.count);
var d = this.w7;
var e = this.w9;
var f = new Rect(0, 0, 0, 1, 1);
var g = new Rect(0, 0, 0, 1, 1);
var h = new ScalerParams(1, f, g, d.ch);
var i = new ScalerParams(1, f, g, e.ch);
var j_1;
var k_1;
var _loop_1 = function (l) {
j_1 = d.el(this_1.xe.item(l), h);
k_1 = e.el(this_1.xg.item(l), i);
if (!isNaN_(j_1) && !isNaN_(k_1) && !isInfinity(j_1) && !isInfinity(k_1)) {
c.add(((function () {
var $ret = new KDPointData();
$ret.a = j_1;
$ret.b = k_1;
$ret.c = l;
return $ret;
})()));
}
};
var this_1 = this;
for (var l = 0; l < this.xe.count; l++) {
_loop_1(l);
}
if (this.xn) {
this.yl = 1;
this.ym = truncate(logBase(c.count, 2)) + 3;
this.yw = truncate(((this.yl / this.ym) * 100));
if (this.progressiveLoadStatusChanged != null) {
this.progressiveLoadStatusChanged(this, new ProgressiveLoadStatusEventArgs(this.yw));
}
this.w5 = KDTree2D.b(c.toArray(), 1, this.xh());
var m = this.w5;
m.progressiveThunkCompleted = delegateCombine(m.progressiveThunkCompleted, runOn(this, this.zl));
if (!this.w5.h(this.jz)) {
var n = this.w5;
n.progressiveThunkCompleted = delegateRemove(n.progressiveThunkCompleted, runOn(this, this.zl));
}
this.ql();
}
else {
var o = dateNow();
this.w5 = new KDTree2D(0, c.toArray(), 1, this.xh());
var p = dateNow();
}
}
if (this.xn && !this.xo) {
this.zr(b);
}
else {
this.zt(b);
}
};
HighDensityScatterSeries.prototype.pb = function (a, b, c, d) {
_super.prototype.pb.call(this, a, b, c, d);
this.zy();
var e = false;
if (this.w7 != null && !this.w7.c1()) {
e = true;
}
if (this.w9 != null && !this.w9.c1()) {
e = true;
}
if (e) {
this.rs(false);
}
this.qm();
};
HighDensityScatterSeries.prototype.zn = function (a) {
var b = a;
var c = this.yo * this.yn;
if (this.xk) {
if (this._itemIndexes == null || this._itemIndexes.length != c) {
this._itemIndexes = new Array(c);
for (var d = 0; d < c; d++) {
this._itemIndexes[d] = 0;
}
}
else {
for (var e = 0; e < c; e++) {
this._itemIndexes[e] = 0;
}
}
}
};
HighDensityScatterSeries.prototype.zt = function (a) {
var b;
var c;
var d = null;
if (a.r) {
d = this._itemIndexes;
}
var e = a.getViewInfo(c, b);
c = e.p0;
b = e.p1;
var f = a;
var g = this.getEffectiveViewport1(a);
this.xa = new ScalerParams(0, b, c, this.w6.ch, g);
this.xb = new ScalerParams(0, b, c, this.w8.ch, g);
this.zm(a);
this.zn(a);
var h = this.yo * this.yn;
if (this.w3 == null || this.w3.length != h) {
this.w3 = new Array(h);
this.w0 = new Array(h);
}
var i = this.w3.length;
var j = this.w3;
var k = this.w0;
for (var l = 0; l < i; l++) {
j[l] = 0;
k[l] = 0;
}
this.ys = truncate(Math.round(this.id));
this.w2 = f.b5();
var m = this.w2.length;
var n = this.w2;
for (var o = 0; o < m; o++) {
n[o] = 0;
}
var p = this.yj;
var q = this.yi;
if (isNaN_(p) || isInfinity(p)) {
p = 0;
}
if (isNaN_(q) || isInfinity(q)) {
q = 50;
}
this.xv = Math.min(p, q);
this.xu = Math.max(p, q);
if (this.xv < 0) {
this.xv = 0;
}
if (this.xu < 0) {
this.xu = 0;
}
this.xw = this.xu - this.xv;
if (this.xo) {
this.zp(a);
}
else {
this.z0(a);
}
f.cg();
if (a.r) {
this._itemIndexes = d;
this.w4.ch();
}
};
HighDensityScatterSeries.prototype.zr = function (a) {
if (this.w5 == null) {
return;
}
this.zt(a);
};
HighDensityScatterSeries.prototype.zl = function (a, b) {
var _this = this;
this.w4.cf(function () {
if (_this.yl < _this.ym - 1) {
_this.yl++;
}
_this.yw = truncate(((_this.yl / _this.ym) * 100));
if (_this.progressiveLoadStatusChanged != null) {
_this.progressiveLoadStatusChanged(_this, new ProgressiveLoadStatusEventArgs(_this.yw));
}
_this.zr(_this.cw);
_this.ql();
if (_this.w5 != null) {
if (!_this.w5.h(_this.jz)) {
var c = _this.w5;
c.progressiveThunkCompleted = delegateRemove(c.progressiveThunkCompleted, runOn(_this, _this.zl));
_this.yw = 100;
if (_this.progressiveLoadStatusChanged != null) {
_this.progressiveLoadStatusChanged(_this, new ProgressiveLoadStatusEventArgs(_this.yw));
}
}
}
});
};
HighDensityScatterSeries.prototype.zp = function (a) {
var b = arrayShallowClone(this.xe.asArray());
this.w7.hq(boxArray$1(b), 0, b.length, this.xa);
var c = arrayShallowClone(this.xg.asArray());
this.yr = 0;
var d = this.yp;
var e = this.xi;
var f = this.w3.length;
this.w9.hq(boxArray$1(c), 0, c.length, this.xb);
var g = 255 << 24 | truncate(this.x4) << 16 | truncate(this.x3) << 8 | truncate(this.x2);
for (var h = 0; h < b.length; h++) {
var i = truncate(b[h]);
var j = truncate(c[h]);
i = truncate(Math.floor(i));
j = truncate(Math.floor(j));
if (i < 0 || i >= this.yo || j < 0 || j >= this.yn) {
continue;
}
if (e) {
var k = i - d;
var l = i + d;
l = l > (this.yo - 1) ? (this.yo - 1) : l;
k = k < 0 ? 0 : k;
var m = j + d;
var n = j - d;
for (var o = k; o <= l; o++) {
for (var p = n; p <= m; p++) {
var q = (p * this.yo) + o;
if (q < 0 || q > f - 1) {
continue;
}
this.w3[q] = this.w3[q] + 1;
this.w0[q] = 1;
this.yr++;
if (this.xk) {
this._itemIndexes[q] = h + 1;
}
}
}
}
else {
var r = (j * this.yo) + i;
this.w3[r] = this.w3[r] + 1;
this.w0[r] = 1;
this.yr++;
if (this.xk) {
this._itemIndexes[r] = h + 1;
}
}
}
this.zu();
};
HighDensityScatterSeries.prototype.z0 = function (a) {
var b;
var c;
var d = a.getViewInfo(b, c);
b = d.p0;
c = d.p1;
if (this.w5 == null) {
return;
}
if (this.xp == null) {
this.xp = new List$1(KDTreeNode2D.$, 2, truncate(Math.round(b.width * b.height)));
}
else {
this.xp.clear();
}
var e = c.left;
var f = c.right;
var g = c.top;
var h = c.bottom;
this.yf = c.top;
this.yd = c.height;
this.ye = c.left;
this.yg = c.width;
this.yb = b.top;
this.x9 = b.height;
this.ya = b.left;
this.yc = b.width;
var i = this.getEffectiveViewport1(a);
this.xr = (i.left - this.ya) / this.yc;
this.xs = (i.top - this.yb) / this.x9;
var j = (i.right - this.ya) / this.yc;
this.xt = j - this.xr;
var k = (i.bottom - this.yb) / this.x9;
this.xq = k - this.xs;
if (this.xj) {
e = (e - this.xr) / this.xt;
f = (f - this.xr) / this.xt;
g = (g - this.xs) / this.xq;
h = (h - this.xs) / this.xq;
}
var l = this.id / b.width * c.width;
var m = this.id / b.height * c.height;
var n = Math.min(l, m);
var o = ((function () {
var $ret = new SearchArgs();
$ret.c = e;
$ret.a = f;
$ret.d = g;
$ret.b = h;
$ret.e = l;
$ret.f = m;
$ret.g = 0x7FFFFFFF;
return $ret;
})());
this.w5.u(this.xp, o, 0, 1, 0, 1);
var p;
this.yr = 0;
for (var q = 0; q < this.xp.count; q++) {
p = this.xp._inner[q];
this.zv(p);
}
this.zu();
};
HighDensityScatterSeries.prototype.zv = function (a) {
if (a.g) {
return;
}
var b = a.e != null && a.e.a;
var c = a.a == null ? 0 : a.a.length;
var d = (a.h - c) + 1;
if (b && d > 0) {
}
else {
d = 1;
}
this.zx(a.b, d, b, a.e);
if (c > 0 && !b) {
var e = void 0;
for (var f = 0; f < c; f++) {
e = a.a[f];
this.zx(e, d, false, a.e);
}
}
if (a.e != null) {
a.e.a = false;
}
};
HighDensityScatterSeries.prototype.gd = function (a) {
var b = this.dc != null ? this.dc.v5 : Rect.empty;
var c = this.dc != null ? this.dc.wn : Rect.empty;
var d = new Rect(0, 0, 0, 1, 1);
var e = this.wn(this.cw);
var f = new ScalerParams(0, d, d, this.w7.ch, e);
var g = new ScalerParams(0, d, d, this.w9.ch, e);
var h = !b.isEmpty && !c.isEmpty && this.dp != null ? this.dp.indexOf(a) : -1;
var i = this.w7 != null && this.xe != null && h < this.xe.count ? this.w7.el(this.xe.item(h), f) : NaN;
var j = this.w9 != null && this.xg != null && h < this.xg.count ? this.w9.el(this.xg.item(h), g) : NaN;
if (!isNaN_(i)) {
if (i < b.left + 0.1 * b.width) {
i = i + 0.4 * b.width;
b.x = i - 0.5 * b.width;
}
if (i > b.right - 0.1 * b.width) {
i = i - 0.4 * b.width;
b.x = i - 0.5 * b.width;
}
}
if (!isNaN_(j)) {
if (j < b.top + 0.1 * b.height) {
j = j + 0.4 * b.height;
b.y = j - 0.5 * b.height;
}
if (j > b.bottom - 0.1 * b.height) {
j = j - 0.4 * b.height;
b.y = j - 0.5 * b.height;
}
}
if (this.c4 != null) {
this.c4.au(this.dc, b, true);
}
return h >= 0;
};
HighDensityScatterSeries.prototype.zx = function (a, b, c, d) {
var e = this.yu(b);
var f = a.c;
var g = this.yp;
if (c) {
var h = d.d;
var i = d.b;
var j = d.e;
var k = d.c;
if (this.xj) {
h = this.xr + this.xt * h;
i = this.xr + this.xt * i;
j = this.xs + this.xq * j;
k = this.xs + this.xq * k;
}
var l = truncate((this.ya + this.yc * (h - this.ye) / this.yg));
var m = truncate((this.ya + this.yc * (i - this.ye) / this.yg));
var n = truncate((this.yb + this.x9 * (j - this.yf) / this.yd));
var o = truncate((this.yb + this.x9 * (k - this.yf) / this.yd));
l = truncate(Math.floor(l));
m = truncate(Math.floor(m));
n = truncate(Math.floor(n));
o = truncate(Math.floor(o));
if (this.xi) {
l -= g;
m += g;
n -= g;
o += g;
}
var p = ((m - l) + 1) * ((o - n) + 1);
var q = b / p;
var r = q;
for (var s = l; s <= m; s++) {
for (var t = n; t <= o; t++) {
this.zw(f, s, t, q, r);
}
}
}
else {
var u = a.a;
var v = a.b;
if (this.xj) {
u = this.xr + this.xt * u;
v = this.xs + this.xq * v;
}
var w = truncate((this.ya + this.yc * (u - this.ye) / this.yg));
var x = truncate((this.yb + this.x9 * (v - this.yf) / this.yd));
w = truncate(Math.floor(w));
x = truncate(Math.floor(x));
if (this.xi) {
var y = w - g;
var z = w + g;
var aa = x + g;
var ab = x - g;
var ac = ((z - y) + 1) * ((aa - ab) + 1);
var ad = b / ac;
var ae = ad;
for (var af = y; af <= z; af++) {
for (var ag = ab; ag <= aa; ag++) {
this.zw(f, af, ag, ad, ae);
}
}
}
else {
this.zw(f, w, x, b, 1);
}
}
};
HighDensityScatterSeries.prototype.yt = function (a, b) {
return truncate((Math.floor(255 * b))) << 24 | truncate(Math.floor(b * (this.x4 + a * this.x8))) << 16 | truncate(Math.floor(b * (this.x3 + a * this.x7))) << 8 | truncate(Math.floor(b * (this.x2 + a * this.x6)));
};
HighDensityScatterSeries.prototype.yu = function (a) {
return 255 << 24 | truncate(Math.floor((this.x4 + a * this.x8))) << 16 | truncate(Math.floor((this.x3 + a * this.x7))) << 8 | truncate(Math.floor((this.x2 + a * this.x6)));
};
HighDensityScatterSeries.prototype.yh = function (a) {
return (a >> 24 & 255) / 255;
};
HighDensityScatterSeries.prototype.zw = function (a, b, c, d, e) {
if (b < 0 || b >= this.yo || c < 0 || c >= this.yn) {
return;
}
var f = (c * this.yo) + b;
this.w3[f] = this.w3[f] + d;
this.w0[f] = this.w0[f] + e;
if (this.xk) {
this._itemIndexes[f] = a + 1;
}
this.yr += truncate(d);
};
HighDensityScatterSeries.prototype.zu = function () {
var a = 0;
var b = 0;
var c = this.xw;
var d = this.xv;
var e = this.xu;
var f = this.w3.length;
var g = this.w3;
var h = this.w0;
var i = this.w2;
var j = NaN;
var k = NaN;
var l = 0;
var m = 0;
for (var n = 0; n < f; n++) {
a = g[n];
if (a != 0) {
b = h[n];
if (a >= e) {
a = 1;
}
else if (a <= d) {
a = 0;
}
else {
a = (a - d) / (c);
}
if (b > 1) {
b = 1;
}
if (b < 0.2) {
b = 0.2;
}
if (j != a || k != b) {
l = this.yt(a, b);
j = a;
k = b;
}
i[m] = l >> 16 & 255;
i[m + 1] = l >> 8 & 255;
i[m + 2] = l & 255;
i[m + 3] = l >> 24 & 255;
}
m += 4;
}
};
HighDensityScatterSeries.prototype.zm = function (a) {
var b = a;
b.cd();
};
HighDensityScatterSeries.prototype.ct = function () {
return new HighDensityScatterSeriesView(this);
};
HighDensityScatterSeries.prototype.q1 = function (a) {
_super.prototype.q1.call(this, a);
this.w4 = a;
};
HighDensityScatterSeries.prototype.ay = function (a) {
if (a != null && a == this.w7 && this.xe != null) {
return new AxisRange(this.xe.minimum, this.xe.maximum);
}
if (a != null && a == this.w9 && this.xg != null) {
return new AxisRange(this.xg.minimum, this.xg.maximum);
}
return null;
};
HighDensityScatterSeries.prototype.ss = function (a, b) {
if (this.dc != null) {
var c = this.getEffectiveViewport1(this.cw);
this.xj = !c.isEmpty;
}
this.rs(false);
};
HighDensityScatterSeries.prototype.st = function (a, b) {
this.rs(false);
};
HighDensityScatterSeries.prototype.kn = function (a) {
if (!this.xk || this._itemIndexes == null || this.dc == null || this.dp == null || this._itemIndexes.length != (this.yo * this.yn)) {
return null;
}
var b = this.dc.v5;
var c = (a.x - b.left) / b.width;
var d = (a.y - b.top) / b.height;
var e = truncate(Math.round(this.wu.left + (this.wu.width * c)));
var f = truncate(Math.round(this.wu.top + (this.wu.height * d)));
var g = this.yx(e, f);
if (g < 0 || g > this._itemIndexes.length - 1) {
return null;
}
var h = this._itemIndexes[g] - 1;
if (h < 0 || h > this.dp.count) {
return null;
}
return this.dp.item(h);
};
HighDensityScatterSeries.prototype.yx = function (a, b) {
var c = (this.yo * b) + a;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
var d = 1;
c = (this.yo * (b - d)) + a;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.yo * (b + d)) + a;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.yo * (b)) + a - 1;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.yo * (b)) + a + 1;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.yo * (b - d)) + a - 1;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.yo * (b + d)) + a + 1;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.yo * (b - d)) + a + 1;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.yo * (b + d)) + a - 1;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
return 0;
};
HighDensityScatterSeries.prototype.zz = function (a, b, c) {
this.w2 = a;
this.yo = b;
this.yn = c;
};
HighDensityScatterSeries.prototype.get_g7 = function () {
return true;
};
HighDensityScatterSeries.prototype.set_g7 = function (a) {
_super.prototype.set_g7.call(this, a);
};
HighDensityScatterSeries.prototype.o5 = function (a, b) {
_super.prototype.o5.call(this, a, b);
this.w4.ce();
if (this.cv != null) {
this.cv.ce();
}
this.ql();
};
HighDensityScatterSeries.prototype.ru = function (a, b) {
_super.prototype.ru.call(this, a, b);
if (!this.g0) {
this.cw.a7(b);
return;
}
this.cw.a7(b);
if (this.d6(this.cv)) {
return;
}
var c = typeCast(HighDensityScatterSeriesView.$, this.cv);
var d = new ScatterFrame();
this.zq(false, c);
this.g0 = false;
};
HighDensityScatterSeries.prototype.rr = function (a, b, c, d, e) {
_super.prototype.rr.call(this, a, b, c, d, e);
var f = this.ba.a$j.item(d);
var g = f;
f.a6(c);
if (this.d6(g)) {
return;
}
if (this.xc == null) {
this.xc = new ScatterFrame();
}
this.zq(false, f);
};
HighDensityScatterSeries.prototype.o2 = function () {
_super.prototype.o2.call(this);
this.w7 = null;
this.w9 = null;
};
HighDensityScatterSeries.$t = markType(HighDensityScatterSeries, 'HighDensityScatterSeries', Series.$);
HighDensityScatterSeries.$$p = markDep(DependencyProperty, PropertyMetadata, HighDensityScatterSeries, 'raisePropertyChanged', ['HeatMaximumColor:aag:z1', [Color.$, Defaults.ap], 'HeatMaximum:yi:z2', [1, 50], 'HeatMinimumColor:aah:z3', [Color.$, Defaults.aq], 'HeatMinimum:yj:z4', [1, 0], 'PointExtent:yv:z5', [1, 1], 'ProgressiveLoad:xn:z6', [0, true], 'UseBruteForce:xo:z7', [0, false], 'XAxis:w7:z8', [NumericXAxis.$, null], 'XMemberAsLegendLabel:y7:z9', [2, null], 'XMemberAsLegendUnit:y9:aaa', [2, null], 'XMemberPath:zb:aab', [2, null], 'YAxis:w9:aac', [NumericYAxis.$, null], 'YMemberAsLegendLabel:zf:aad', [2, null], 'YMemberAsLegendUnit:zh:aae', [2, null], 'YMemberPath:zj:aaf', [2, null]]);
return HighDensityScatterSeries;
}(Series));
export { HighDensityScatterSeries };
/**
* @hidden
*/
var HighDensityScatterSeriesView = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(HighDensityScatterSeriesView, _super);
function HighDensityScatterSeriesView(a) {
var _this = _super.call(this, a) || this;
_this.b6 = null;
_this.b4 = null;
_this.cc = 0;
_this.cb = 0;
_this.b9 = null;
_this.ca = null;
_this.b7 = null;
_this.b6 = a;
return _this;
}
HighDensityScatterSeriesView.prototype.ax = function () {
_super.prototype.ax.call(this);
if (!this.r) {
this.b6.aah = Defaults.aq;
this.b6.aag = Defaults.ap;
this.b6.vh = Defaults.al;
this.b6.vx = Defaults.ak;
}
};
HighDensityScatterSeriesView.prototype.ch = function () {
this.b6.zz(this.b4, this.cc, this.cb);
};
HighDensityScatterSeriesView.prototype.cd = function () {
if (this.b9 == null) {
this.b9 = this.f.jz.createElement("canvas");
var a = this.f.jz.get2DCanvasContext(this.b9);
this.b7 = new RenderingContext(new CanvasViewRenderer(), a);
}
var b;
if (this.q) {
b = this.b1;
}
else {
b = this.f.dc.wb();
}
var c = truncate(Math.round(b.left));
var d = truncate(Math.round(b.top));
var e = truncate(Math.round(b.width));
var f = truncate(Math.round(b.height));
var g = this.cc;
var h = this.cb;
this.cc = e;
this.cb = f;
if (g != this.cc || h != this.cb || this.b4 == null) {
this.b9.setAttribute("width", e.toString());
this.b9.setAttribute("height", f.toString());
this.ca = this.b7.h().getImageData(0, 0, e, f);
var imageDataArray_ = this.ca.data;
this.b4 = imageDataArray_;
}
this.b6.zz(this.b4, this.cc, this.cb);
};
HighDensityScatterSeriesView.prototype.b5 = function () {
return this.b4;
};
HighDensityScatterSeriesView.prototype.cg = function () {
var a = truncate(Math.round(this.b1.left));
var b = truncate(Math.round(this.b1.left));
var c = truncate(Math.round(this.b1.width));
var d = truncate(Math.round(this.b1.height));
this.b7.h().putImageData(this.ca, 0, 0);
this.av();
};
HighDensityScatterSeriesView.prototype.cf = function (a) {
if (this.f.jz != null) {
this.f.jz.setTimeout(a, 0);
}
else {
window.setTimeout(a, 0);
}
};
HighDensityScatterSeriesView.prototype.bc = function (a, b) {
_super.prototype.bc.call(this, a, b);
if (b) {
if (!this.b6.f8) {
return;
}
var c = new Rectangle();
c.n = this.b1.left;
c.o = this.b1.top;
c.width = this.b1.width;
c.height = this.b1.height;
c._fill = this.bv();
a.w(c);
return;
}
if (this.b9 == null) {
return;
}
var d = truncate(Math.round(this.b1.left));
var e = truncate(Math.round(this.b1.top));
var f = truncate(Math.round(this.b1.width));
var g = truncate(Math.round(this.b1.height));
this.l.o(this.b9.getNativeElement(), this.f._opacity, d, e, f, g, d, e, f, g);
};
HighDensityScatterSeriesView.prototype.b8 = function (a, b) {
return Color.e(toNullable(Color.$, a), toNullable(Color.$, null)) && Color.e(toNullable(Color.$, b), toNullable(Color.$, null));
};
HighDensityScatterSeriesView.prototype.ce = function () {
if (this.b4 != null) {
for (var a = 0; a < this.b4.length; a++) {
this.b4[a] = 0;
}
this.cg();
}
};
HighDensityScatterSeriesView.prototype.aq = function (a) {
_super.prototype.aq.call(this, a);
if (this.b4 == null) {
this.f.bc.exportSeriesPixelsData(a, null, this.cc, this.cb);
return;
}
var b = new Array(intDivide(this.b4.length, 4));
var c;
for (var d = 0; d < intDivide(this.b4.length, 4); d++) {
c = d * 4;
b[d] = this.b4[c + 3] << 24 | this.b4[c] << 16 | this.b4[c + 1] << 8 | this.b4[c + 2];
}
this.f.bc.exportSeriesPixelsData(a, b, this.cc, this.cb);
};
HighDensityScatterSeriesView.$t = markType(HighDensityScatterSeriesView, 'HighDensityScatterSeriesView', SeriesView.$);
return HighDensityScatterSeriesView;
}(SeriesView));
export { HighDensityScatterSeriesView };