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.xg = null;
_this.xi = null;
_this.ys = 0;
_this.xl = false;
_this.x7 = Defaults.bf.o;
_this.x6 = Defaults.bf.n;
_this.x5 = Defaults.bf.m;
_this.x4 = Defaults.bf.l;
_this.x3 = Defaults.be.o;
_this.x2 = Defaults.be.n;
_this.x1 = Defaults.be.m;
_this.x0 = Defaults.be.l;
_this.w8 = null;
_this.xd = null;
_this.xe = null;
_this.w9 = null;
_this.xb = null;
_this.xn = false;
_this.yt = 0;
_this.yv = 0;
_this.yp = 0;
_this.yo = 0;
_this.progressiveLoadStatusChanged = null;
_this.xs = null;
_this.xy = 0;
_this.xx = 0;
_this.xz = 0;
_this.ye = 0;
_this.yc = 0;
_this.yd = 0;
_this.yf = 0;
_this.yh = 0;
_this.yj = 0;
_this.yi = 0;
_this.yg = 0;
_this.xu = 0;
_this.xv = 0;
_this.xw = 0;
_this.xt = 0;
_this.yr = 0;
_this.yq = 0;
_this.w5 = null;
_this.yu = 0;
_this.xm = false;
_this._itemIndexes = null;
_this.w6 = null;
_this.w3 = null;
_this.xf = null;
_this.ab = HighDensityScatterSeries.$;
_this.f9 = false;
return _this;
}
HighDensityScatterSeries.prototype.bk = function () {
return new HighDensityScatterSeries();
};
HighDensityScatterSeries.prototype.get_fp = function () {
return true;
};
HighDensityScatterSeries.prototype.jl = function () {
if (!isNaN_(this.jk)) {
return _super.prototype.jl.call(this);
}
return Defaults.ad;
};
HighDensityScatterSeries.prototype.get_fx = function () {
return true;
};
Object.defineProperty(HighDensityScatterSeries.prototype, "xh", {
get: function () {
return this.xg;
},
set: function (a) {
if (this.xg != a) {
var b = this.xh;
this.xg = a;
this.raisePropertyChanged("XColumn", b, this.xh);
}
},
enumerable: false,
configurable: true
});
HighDensityScatterSeries.prototype.getDataLegendSeriesContextAt = function (a, b) {
var c = { $type: Point_$type, x: a, y: b };
var d = this.ko(c);
var e = d == null ? NaN : this.iy(d, "XMemberPath");
var f = d == null ? NaN : this.iy(d, "YMemberPath");
var g = new DataLegendSeriesValueInfo();
g.l = e;
g.a = 13;
g.q = "X";
g.r = this.ze != null ? this.ze : "X";
g.s = this.za != null ? this.za : "X:";
g.t = this.zc != null ? this.zc : "";
var h = new DataLegendSeriesValueInfo();
h.l = f;
h.a = 14;
h.q = "Y";
h.r = this.zm != null ? this.zm : "Y";
h.s = this.zi != null ? this.zi : "Y:";
h.t = this.zk != null ? this.zk : "";
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.me();
return i;
};
HighDensityScatterSeries.prototype.kr = function (a, b) {
var c = this.nf(b);
if (c == HighDensityScatterSeries.$$p[10]) {
return this.ks(a, b, this.ze);
}
if (c == HighDensityScatterSeries.$$p[14]) {
return this.ks(a, b, this.zm);
}
return _super.prototype.kr.call(this, a, b);
};
HighDensityScatterSeries.prototype.mf = function (a) {
var b = this.nf(a);
if (b == HighDensityScatterSeries.$$p[10]) {
return this.ze;
}
if (b == HighDensityScatterSeries.$$p[14]) {
return this.zm;
}
return _super.prototype.mf.call(this, a);
};
Object.defineProperty(HighDensityScatterSeries.prototype, "xj", {
get: function () {
return this.xi;
},
set: function (a) {
if (this.xi != a) {
var b = this.xj;
this.xi = a;
this.raisePropertyChanged("YColumn", b, this.xj);
}
},
enumerable: false,
configurable: true
});
HighDensityScatterSeries.prototype.z1 = function () {
if (this.w8 == null) {
return;
}
this.w8.t();
var a = this.w8;
a.progressiveThunkCompleted = delegateRemove(a.progressiveThunkCompleted, runOn(this, this.zo));
this.w8 = null;
};
HighDensityScatterSeries.prototype.rc = function (a, b, c, d) {
_super.prototype.rc.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.qh();
break;
case "SeriesViewer":
if (this.dc != null) {
var e = this.getEffectiveViewport1(this.cw);
this.xm = !e.isEmpty;
}
break;
case "FastItemsSource":
this.z1();
if (typeCast(IFastItemsSource_$type, c) != null) {
c.deregisterColumn(this.xh);
c.deregisterColumn(this.xj);
this.xh = null;
this.xj = null;
}
if (typeCast(IFastItemsSource_$type, d) != null) {
this.xh = this.dl(this.ze);
this.xj = this.dl(this.zm);
}
if ((this.xc != null && !this.xc.c1()) || (this.xa != null && !this.xa.c1())) {
this.ru(this.gh && c != null);
}
this.qo();
break;
case HighDensityScatterSeries.$$p[7]:
var f = this.w9;
this.w9 = this.xa;
this.z1();
if (f != null) {
f.rangeChanged = delegateRemove(f.rangeChanged, runOn(this, this.zr));
}
if (this.w9 != null) {
var g = this.w9;
g.rangeChanged = delegateCombine(g.rangeChanged, runOn(this, this.zr));
}
if (c != null) {
c.b0(this);
}
if (d != null) {
d.ct(this);
}
if ((this.xa != null && !this.xa.c1()) || (d == null && c != null)) {
this.ru(false);
}
break;
case HighDensityScatterSeries.$$p[11]:
var h = this.xb;
this.xb = this.xc;
this.z1();
if (h != null) {
h.rangeChanged = delegateRemove(h.rangeChanged, runOn(this, this.zr));
}
if (this.xb != null) {
var i = this.xb;
i.rangeChanged = delegateCombine(i.rangeChanged, runOn(this, this.zr));
}
if (c != null) {
c.b0(this);
}
if (d != null) {
d.ct(this);
}
if ((this.xc != null && !this.xc.c1()) || (d == null && c != null)) {
this.ru(false);
}
break;
case "MouseOverEnabled":
this.xn = this.f9;
this.ru(false);
break;
case HighDensityScatterSeries.$$p[10]:
if (this.dp != null) {
this.dp.deregisterColumn(this.xh);
this.xh = this.dl(this.ze);
}
break;
case "XColumn":
this.z1();
if (this.xa != null && !this.xa.c1()) {
this.ru(false);
}
this.qo();
break;
case HighDensityScatterSeries.$$p[14]:
if (this.dp != null) {
this.dp.deregisterColumn(this.xj);
this.xj = this.dl(this.zm);
}
break;
case "YColumn":
this.z1();
if (this.xc != null && !this.xc.c1()) {
this.ru(false);
}
this.qo();
break;
case HighDensityScatterSeries.$$p[6]:
this.z1();
this.ru(false);
this.qn();
break;
case HighDensityScatterSeries.$$p[3]:
this.ru(false);
this.qn();
break;
case HighDensityScatterSeries.$$p[1]:
this.ru(false);
this.qn();
break;
case HighDensityScatterSeries.$$p[0]:
case HighDensityScatterSeries.$$p[2]:
if (!this.w7.ch(this.aak, this.aaj)) {
return;
}
this.zv();
this.ru(false);
this.qn();
break;
case HighDensityScatterSeries.$$p[4]:
this.ys = Math.max(typeGetValue(d) - 1, 0);
this.xl = this.ys > 0;
this.ru(false);
this.qn();
break;
case HighDensityScatterSeries.$$p[5]:
this.ru(false);
this.qn();
break;
}
};
HighDensityScatterSeries.prototype.zv = function () {
this.x4 = this.aak.l;
this.x7 = this.aak.o;
this.x6 = this.aak.n;
this.x5 = this.aak.m;
this.x0 = this.aaj.l;
this.x3 = this.aaj.o;
this.x2 = this.aaj.n;
this.x1 = this.aaj.m;
this.v0 = BrushUtil.j(truncate(this.x4), truncate(this.x7), truncate(this.x6), truncate(this.x5));
this.vk = BrushUtil.j(truncate(this.x0), truncate(this.x3), truncate(this.x2), truncate(this.x1));
};
HighDensityScatterSeries.prototype.xp = function (a) {
if (typeCast(NumericYAxis.$, a) !== null) {
return true;
}
return false;
};
HighDensityScatterSeries.prototype.xo = function (a) {
if (typeCast(NumericXAxis.$, a) !== null) {
return true;
}
return false;
};
HighDensityScatterSeries.prototype.zr = function (a, b) {
this.z1();
this.ru(false);
};
Object.defineProperty(HighDensityScatterSeries.prototype, "yb", {
get: function () {
return this.x3 - this.x7;
},
enumerable: false,
configurable: true
});
Object.defineProperty(HighDensityScatterSeries.prototype, "ya", {
get: function () {
return this.x2 - this.x6;
},
enumerable: false,
configurable: true
});
Object.defineProperty(HighDensityScatterSeries.prototype, "x9", {
get: function () {
return this.x1 - this.x5;
},
enumerable: false,
configurable: true
});
Object.defineProperty(HighDensityScatterSeries.prototype, "x8", {
get: function () {
return this.x0 - this.x4;
},
enumerable: false,
configurable: true
});
HighDensityScatterSeries.prototype.hf = function (a, b, c) {
var d = _super.prototype.hf.call(this, a, b, c);
if (this.xc == null || this.xa == null || this.xa.bi == null || this.xc.bi == null || this.xj == null || this.xh == null || this.xj.count < 1 || this.xh.count < 1 || this.xj.count != this.xh.count || this.xa.l4 == this.xa.l3 || this.xc.l4 == this.xc.l3 || this.wx.isEmpty) {
d = false;
}
return d;
};
Object.defineProperty(HighDensityScatterSeries.prototype, "yz", {
get: function () {
return this.yt;
},
set: function (a) {
var b = this.yt;
this.yt = a;
this.raisePropertyChanged("ProgressiveStatus", b, this.yt);
},
enumerable: false,
configurable: true
});
HighDensityScatterSeries.prototype.rv = function (a) {
_super.prototype.rv.call(this, a);
this.zt(a, this.cw);
};
HighDensityScatterSeries.prototype.xk = function () {
if (TestRandomness.instance.testRandomnessSource != null) {
return TestRandomness.instance.testRandomnessSource;
}
return new DefaultRandomnessSource(0);
};
HighDensityScatterSeries.prototype.zt = function (a, b) {
if (this.d7(b)) {
return;
}
if (this.w8 == null && !this.xr) {
var c = new List$1(KDPointData.$, 2, this.xh.count);
var d = this.xa;
var e = this.xc;
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.xh.item(l), h);
k_1 = e.el(this_1.xj.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.xh.count; l++) {
_loop_1(l);
}
if (this.xq) {
this.yo = 1;
this.yp = truncate(logBase(c.count, 2)) + 3;
this.yz = truncate(((this.yo / this.yp) * 100));
if (this.progressiveLoadStatusChanged != null) {
this.progressiveLoadStatusChanged(this, new ProgressiveLoadStatusEventArgs(this.yz));
}
this.w8 = KDTree2D.b(c.toArray(), 1, this.xk());
var m = this.w8;
m.progressiveThunkCompleted = delegateCombine(m.progressiveThunkCompleted, runOn(this, this.zo));
if (!this.w8.h(this.j0)) {
var n = this.w8;
n.progressiveThunkCompleted = delegateRemove(n.progressiveThunkCompleted, runOn(this, this.zo));
}
this.qn();
}
else {
var o = dateNow();
this.w8 = new KDTree2D(0, c.toArray(), 1, this.xk());
var p = dateNow();
}
}
if (this.xq && !this.xr) {
this.zu(b);
}
else {
this.zw(b);
}
};
HighDensityScatterSeries.prototype.pd = function (a, b, c, d) {
_super.prototype.pd.call(this, a, b, c, d);
this.z1();
var e = false;
if (this.xa != null && !this.xa.c1()) {
e = true;
}
if (this.xc != null && !this.xc.c1()) {
e = true;
}
if (e) {
this.ru(false);
}
this.qo();
};
HighDensityScatterSeries.prototype.zq = function (a) {
var b = a;
var c = this.yr * this.yq;
if (this.xn) {
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.zw = function (a) {
var b;
var c;
var d = null;
if (a.t) {
d = this._itemIndexes;
}
var e = a.getViewInfo(c, b);
c = e.p0;
b = e.p1;
var f = a;
var g = this.getEffectiveViewport1(a);
this.xd = new ScalerParams(0, b, c, this.w9.ch, g);
this.xe = new ScalerParams(0, b, c, this.xb.ch, g);
this.zp(a);
this.zq(a);
var h = this.yr * this.yq;
if (this.w6 == null || this.w6.length != h) {
this.w6 = new Array(h);
this.w3 = new Array(h);
}
var i = this.w6.length;
var j = this.w6;
var k = this.w3;
for (var l = 0; l < i; l++) {
j[l] = 0;
k[l] = 0;
}
this.yv = truncate(Math.round(this.ie));
this.w5 = f.ce();
var m = this.w5.length;
var n = this.w5;
for (var o = 0; o < m; o++) {
n[o] = 0;
}
var p = this.ym;
var q = this.yl;
if (isNaN_(p) || isInfinity(p)) {
p = 0;
}
if (isNaN_(q) || isInfinity(q)) {
q = 50;
}
this.xy = Math.min(p, q);
this.xx = Math.max(p, q);
if (this.xy < 0) {
this.xy = 0;
}
if (this.xx < 0) {
this.xx = 0;
}
this.xz = this.xx - this.xy;
if (this.xr) {
this.zs(a);
}
else {
this.z3(a);
}
f.cp();
if (a.t) {
this._itemIndexes = d;
this.w7.cq();
}
};
HighDensityScatterSeries.prototype.zu = function (a) {
if (this.w8 == null) {
return;
}
this.zw(a);
};
HighDensityScatterSeries.prototype.zo = function (a, b) {
var _this = this;
this.w7.co(function () {
if (_this.yo < _this.yp - 1) {
_this.yo++;
}
_this.yz = truncate(((_this.yo / _this.yp) * 100));
if (_this.progressiveLoadStatusChanged != null) {
_this.progressiveLoadStatusChanged(_this, new ProgressiveLoadStatusEventArgs(_this.yz));
}
_this.zu(_this.cw);
_this.qn();
if (_this.w8 != null) {
if (!_this.w8.h(_this.j0)) {
var c = _this.w8;
c.progressiveThunkCompleted = delegateRemove(c.progressiveThunkCompleted, runOn(_this, _this.zo));
_this.yz = 100;
if (_this.progressiveLoadStatusChanged != null) {
_this.progressiveLoadStatusChanged(_this, new ProgressiveLoadStatusEventArgs(_this.yz));
}
}
}
});
};
HighDensityScatterSeries.prototype.zs = function (a) {
var b = arrayShallowClone(this.xh.asArray());
this.xa.hq(boxArray$1(b), 0, b.length, this.xd);
var c = arrayShallowClone(this.xj.asArray());
this.yu = 0;
var d = this.ys;
var e = this.xl;
var f = this.w6.length;
this.xc.hq(boxArray$1(c), 0, c.length, this.xe);
var g = 255 << 24 | truncate(this.x7) << 16 | truncate(this.x6) << 8 | truncate(this.x5);
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.yr || j < 0 || j >= this.yq) {
continue;
}
if (e) {
var k = i - d;
var l = i + d;
l = l > (this.yr - 1) ? (this.yr - 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.yr) + o;
if (q < 0 || q > f - 1) {
continue;
}
this.w6[q] = this.w6[q] + 1;
this.w3[q] = 1;
this.yu++;
if (this.xn) {
this._itemIndexes[q] = h + 1;
}
}
}
}
else {
var r = (j * this.yr) + i;
this.w6[r] = this.w6[r] + 1;
this.w3[r] = 1;
this.yu++;
if (this.xn) {
this._itemIndexes[r] = h + 1;
}
}
}
this.zx();
};
HighDensityScatterSeries.prototype.z3 = function (a) {
var b;
var c;
var d = a.getViewInfo(b, c);
b = d.p0;
c = d.p1;
if (this.w8 == null) {
return;
}
if (this.xs == null) {
this.xs = new List$1(KDTreeNode2D.$, 2, truncate(Math.round(b.width * b.height)));
}
else {
this.xs.clear();
}
var e = c.left;
var f = c.right;
var g = c.top;
var h = c.bottom;
this.yi = c.top;
this.yg = c.height;
this.yh = c.left;
this.yj = c.width;
this.ye = b.top;
this.yc = b.height;
this.yd = b.left;
this.yf = b.width;
var i = this.getEffectiveViewport1(a);
this.xu = (i.left - this.yd) / this.yf;
this.xv = (i.top - this.ye) / this.yc;
var j = (i.right - this.yd) / this.yf;
this.xw = j - this.xu;
var k = (i.bottom - this.ye) / this.yc;
this.xt = k - this.xv;
if (this.xm) {
e = (e - this.xu) / this.xw;
f = (f - this.xu) / this.xw;
g = (g - this.xv) / this.xt;
h = (h - this.xv) / this.xt;
}
var l = this.ie / b.width * c.width;
var m = this.ie / 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.w8.u(this.xs, o, 0, 1, 0, 1);
var p;
this.yu = 0;
for (var q = 0; q < this.xs.count; q++) {
p = this.xs._inner[q];
this.zy(p);
}
this.zx();
};
HighDensityScatterSeries.prototype.zy = 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.z0(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.z0(e, d, false, a.e);
}
}
if (a.e != null) {
a.e.a = false;
}
};
HighDensityScatterSeries.prototype.ge = function (a) {
var b = this.dc != null ? this.dc.wt : Rect.empty;
var c = this.dc != null ? this.dc.xb : Rect.empty;
var d = new Rect(0, 0, 0, 1, 1);
var e = this.wq(this.cw);
var f = new ScalerParams(0, d, d, this.xa.ch, e);
var g = new ScalerParams(0, d, d, this.xc.ch, e);
var h = !b.isEmpty && !c.isEmpty && this.dp != null ? this.dp.indexOf(a) : -1;
var i = this.xa != null && this.xh != null && h < this.xh.count ? this.xa.el(this.xh.item(h), f) : NaN;
var j = this.xc != null && this.xj != null && h < this.xj.count ? this.xc.el(this.xj.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.z0 = function (a, b, c, d) {
var e = this.yx(b);
var f = a.c;
var g = this.ys;
if (c) {
var h = d.d;
var i = d.b;
var j = d.e;
var k = d.c;
if (this.xm) {
h = this.xu + this.xw * h;
i = this.xu + this.xw * i;
j = this.xv + this.xt * j;
k = this.xv + this.xt * k;
}
var l = truncate((this.yd + this.yf * (h - this.yh) / this.yj));
var m = truncate((this.yd + this.yf * (i - this.yh) / this.yj));
var n = truncate((this.ye + this.yc * (j - this.yi) / this.yg));
var o = truncate((this.ye + this.yc * (k - this.yi) / this.yg));
l = truncate(Math.floor(l));
m = truncate(Math.floor(m));
n = truncate(Math.floor(n));
o = truncate(Math.floor(o));
if (this.xl) {
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.zz(f, s, t, q, r);
}
}
}
else {
var u = a.a;
var v = a.b;
if (this.xm) {
u = this.xu + this.xw * u;
v = this.xv + this.xt * v;
}
var w = truncate((this.yd + this.yf * (u - this.yh) / this.yj));
var x = truncate((this.ye + this.yc * (v - this.yi) / this.yg));
w = truncate(Math.floor(w));
x = truncate(Math.floor(x));
if (this.xl) {
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.zz(f, af, ag, ad, ae);
}
}
}
else {
this.zz(f, w, x, b, 1);
}
}
};
HighDensityScatterSeries.prototype.yw = function (a, b) {
return truncate((Math.floor(255 * b))) << 24 | truncate(Math.floor(b * (this.x7 + a * this.yb))) << 16 | truncate(Math.floor(b * (this.x6 + a * this.ya))) << 8 | truncate(Math.floor(b * (this.x5 + a * this.x9)));
};
HighDensityScatterSeries.prototype.yx = function (a) {
return 255 << 24 | truncate(Math.floor((this.x7 + a * this.yb))) << 16 | truncate(Math.floor((this.x6 + a * this.ya))) << 8 | truncate(Math.floor((this.x5 + a * this.x9)));
};
HighDensityScatterSeries.prototype.yk = function (a) {
return (a >> 24 & 255) / 255;
};
HighDensityScatterSeries.prototype.zz = function (a, b, c, d, e) {
if (b < 0 || b >= this.yr || c < 0 || c >= this.yq) {
return;
}
var f = (c * this.yr) + b;
this.w6[f] = this.w6[f] + d;
this.w3[f] = this.w3[f] + e;
if (this.xn) {
this._itemIndexes[f] = a + 1;
}
this.yu += truncate(d);
};
HighDensityScatterSeries.prototype.zx = function () {
var a = 0;
var b = 0;
var c = this.xz;
var d = this.xy;
var e = this.xx;
var f = this.w6.length;
var g = this.w6;
var h = this.w3;
var i = this.w5;
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.yw(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.zp = function (a) {
var b = a;
b.cm();
};
HighDensityScatterSeries.prototype.ct = function () {
return new HighDensityScatterSeriesView(this);
};
HighDensityScatterSeries.prototype.q3 = function (a) {
_super.prototype.q3.call(this, a);
this.w7 = a;
};
HighDensityScatterSeries.prototype.ay = function (a) {
if (a != null && a == this.xa && this.xh != null) {
return new AxisRange(this.xh.minimum, this.xh.maximum);
}
if (a != null && a == this.xc && this.xj != null) {
return new AxisRange(this.xj.minimum, this.xj.maximum);
}
return null;
};
HighDensityScatterSeries.prototype.su = function (a, b) {
if (this.dc != null) {
var c = this.getEffectiveViewport1(this.cw);
this.xm = !c.isEmpty;
}
this.ru(false);
};
HighDensityScatterSeries.prototype.sv = function (a, b) {
this.ru(false);
};
HighDensityScatterSeries.prototype.ko = function (a) {
if (!this.xn || this._itemIndexes == null || this.dc == null || this.dp == null || this._itemIndexes.length != (this.yr * this.yq)) {
return null;
}
var b = this.dc.wt;
var c = (a.x - b.left) / b.width;
var d = (a.y - b.top) / b.height;
var e = truncate(Math.round(this.wx.left + (this.wx.width * c)));
var f = truncate(Math.round(this.wx.top + (this.wx.height * d)));
var g = this.y0(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.y0 = function (a, b) {
var c = (this.yr * b) + a;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
var d = 1;
c = (this.yr * (b - d)) + a;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.yr * (b + d)) + a;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.yr * (b)) + a - 1;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.yr * (b)) + a + 1;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.yr * (b - d)) + a - 1;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.yr * (b + d)) + a + 1;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.yr * (b - d)) + a + 1;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.yr * (b + d)) + a - 1;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
return 0;
};
HighDensityScatterSeries.prototype.z2 = function (a, b, c) {
this.w5 = a;
this.yr = b;
this.yq = c;
};
HighDensityScatterSeries.prototype.get_g8 = function () {
return true;
};
HighDensityScatterSeries.prototype.set_g8 = function (a) {
_super.prototype.set_g8.call(this, a);
};
HighDensityScatterSeries.prototype.o7 = function (a, b) {
_super.prototype.o7.call(this, a, b);
this.w7.cn();
if (this.cv != null) {
this.cv.cn();
}
this.qn();
};
HighDensityScatterSeries.prototype.rw = function (a, b) {
_super.prototype.rw.call(this, a, b);
if (!this.g1) {
this.cw.be(b);
return;
}
this.cw.be(b);
if (this.d7(this.cv)) {
return;
}
var c = typeCast(HighDensityScatterSeriesView.$, this.cv);
var d = new ScatterFrame();
this.zt(false, c);
this.g1 = false;
};
HighDensityScatterSeries.prototype.rt = function (a, b, c, d, e) {
_super.prototype.rt.call(this, a, b, c, d, e);
var f = this.ba.a$j.item(d);
var g = f;
f.bd(c);
if (this.d7(g)) {
return;
}
if (this.xf == null) {
this.xf = new ScatterFrame();
}
this.zt(false, f);
};
HighDensityScatterSeries.prototype.o4 = function () {
_super.prototype.o4.call(this);
this.xa = null;
this.xc = null;
};
HighDensityScatterSeries.$t = markType(HighDensityScatterSeries, 'HighDensityScatterSeries', Series.$);
HighDensityScatterSeries.$$p = markDep(DependencyProperty, PropertyMetadata, HighDensityScatterSeries, 'raisePropertyChanged', ['HeatMaximumColor:aaj:z4', [Color.$, Defaults.be], 'HeatMaximum:yl:z5', [1, 50], 'HeatMinimumColor:aak:z6', [Color.$, Defaults.bf], 'HeatMinimum:ym:z7', [1, 0], 'PointExtent:yy:z8', [1, 1], 'ProgressiveLoad:xq:z9', [0, true], 'UseBruteForce:xr:aaa', [0, false], 'XAxis:xa:aab', [NumericXAxis.$, null], 'XMemberAsLegendLabel:za:aac', [2, null], 'XMemberAsLegendUnit:zc:aad', [2, null], 'XMemberPath:ze:aae', [2, null], 'YAxis:xc:aaf', [NumericYAxis.$, null], 'YMemberAsLegendLabel:zi:aag', [2, null], 'YMemberAsLegendUnit:zk:aah', [2, null], 'YMemberPath:zm:aai', [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.cf = null;
_this.cd = null;
_this.cl = 0;
_this.ck = 0;
_this.ci = null;
_this.cj = null;
_this.cg = null;
_this.cf = a;
return _this;
}
HighDensityScatterSeriesView.prototype.a4 = function () {
_super.prototype.a4.call(this);
if (!this.t) {
this.cf.aak = Defaults.bf;
this.cf.aaj = Defaults.be;
this.cf.vk = Defaults.ba;
this.cf.v0 = Defaults.a9;
}
};
HighDensityScatterSeriesView.prototype.cq = function () {
this.cf.z2(this.cd, this.cl, this.ck);
};
HighDensityScatterSeriesView.prototype.cm = function () {
if (this.ci == null) {
this.ci = this.f.j0.createElement("canvas");
var a = this.f.j0.get2DCanvasContext(this.ci);
this.cg = new RenderingContext(new CanvasViewRenderer(), a);
}
var b;
if (this.s) {
b = this.b9;
}
else {
b = this.f.dc.wz();
}
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.cl;
var h = this.ck;
this.cl = e;
this.ck = f;
if (g != this.cl || h != this.ck || this.cd == null) {
this.ci.setAttribute("width", e.toString());
this.ci.setAttribute("height", f.toString());
this.cj = this.cg.h().getImageData(0, 0, e, f);
var imageDataArray_ = this.cj.data;
this.cd = imageDataArray_;
}
this.cf.z2(this.cd, this.cl, this.ck);
};
HighDensityScatterSeriesView.prototype.ce = function () {
return this.cd;
};
HighDensityScatterSeriesView.prototype.cp = function () {
var a = truncate(Math.round(this.b9.left));
var b = truncate(Math.round(this.b9.left));
var c = truncate(Math.round(this.b9.width));
var d = truncate(Math.round(this.b9.height));
this.cg.h().putImageData(this.cj, 0, 0);
this.a2();
};
HighDensityScatterSeriesView.prototype.co = function (a) {
if (this.f.j0 != null) {
this.f.j0.setTimeout(a, 0);
}
else {
window.setTimeout(a, 0);
}
};
HighDensityScatterSeriesView.prototype.bj = function (a, b) {
_super.prototype.bj.call(this, a, b);
if (b) {
if (!this.cf.f9) {
return;
}
var c = new Rectangle();
c.n = this.b9.left;
c.o = this.b9.top;
c.width = this.b9.width;
c.height = this.b9.height;
c._fill = this.b3();
a.w(c);
return;
}
if (this.ci == null) {
return;
}
var d = truncate(Math.round(this.b9.left));
var e = truncate(Math.round(this.b9.top));
var f = truncate(Math.round(this.b9.width));
var g = truncate(Math.round(this.b9.height));
this.m.o(this.ci.getNativeElement(), this.f._opacity, d, e, f, g, d, e, f, g);
};
HighDensityScatterSeriesView.prototype.ch = function (a, b) {
return Color.e(toNullable(Color.$, a), toNullable(Color.$, null)) && Color.e(toNullable(Color.$, b), toNullable(Color.$, null));
};
HighDensityScatterSeriesView.prototype.cn = function () {
if (this.cd != null) {
for (var a = 0; a < this.cd.length; a++) {
this.cd[a] = 0;
}
this.cp();
}
};
HighDensityScatterSeriesView.prototype.ax = function (a) {
_super.prototype.ax.call(this, a);
if (this.cd == null) {
this.f.bc.exportSeriesPixelsData(a, null, this.cl, this.ck);
return;
}
var b = new Array(intDivide(this.cd.length, 4));
var c;
for (var d = 0; d < intDivide(this.cd.length, 4); d++) {
c = d * 4;
b[d] = this.cd[c + 3] << 24 | this.cd[c] << 16 | this.cd[c + 1] << 8 | this.cd[c + 2];
}
this.f.bc.exportSeriesPixelsData(a, b, this.cl, this.ck);
};
HighDensityScatterSeriesView.$t = markType(HighDensityScatterSeriesView, 'HighDensityScatterSeriesView', SeriesView.$);
return HighDensityScatterSeriesView;
}(SeriesView));
export { HighDensityScatterSeriesView };