UNPKG

igniteui-react-charts

Version:

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

1,194 lines (1,193 loc) 42.3 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 { 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.xy = null; _this.x0 = null; _this.za = 0; _this.x3 = false; _this.yp = Defaults.bf.o; _this.yo = Defaults.bf.n; _this.yn = Defaults.bf.m; _this.ym = Defaults.bf.l; _this.yl = Defaults.be.o; _this.yk = Defaults.be.n; _this.yj = Defaults.be.m; _this.yi = Defaults.be.l; _this.xq = null; _this.xv = null; _this.xw = null; _this.xr = null; _this.xt = null; _this.x5 = false; _this.zb = 0; _this.zd = 0; _this.y7 = 0; _this.y6 = 0; _this.progressiveLoadStatusChanged = null; _this.ya = null; _this.yg = 0; _this.yf = 0; _this.yh = 0; _this.yw = 0; _this.yu = 0; _this.yv = 0; _this.yx = 0; _this.yz = 0; _this.y1 = 0; _this.y0 = 0; _this.yy = 0; _this.yc = 0; _this.yd = 0; _this.ye = 0; _this.yb = 0; _this.y9 = 0; _this.y8 = 0; _this.xn = null; _this.zc = 0; _this.x4 = false; _this._itemIndexes = null; _this.xo = null; _this.xl = null; _this.xx = null; _this.ab = HighDensityScatterSeries.$; _this.gf = false; return _this; } HighDensityScatterSeries.prototype.bk = function () { return new HighDensityScatterSeries(); }; HighDensityScatterSeries.prototype.get_fs = function () { return true; }; HighDensityScatterSeries.prototype.ju = function () { if (!isNaN_(this.jt)) { return _super.prototype.ju.call(this); } return Defaults.ad; }; HighDensityScatterSeries.prototype.get_f0 = function () { return true; }; Object.defineProperty(HighDensityScatterSeries.prototype, "xz", { get: function () { return this.xy; }, set: function (a) { if (this.xy != a) { var b = this.xz; this.xy = a; this.raisePropertyChanged("XColumn", b, this.xz); } }, enumerable: false, configurable: true }); HighDensityScatterSeries.prototype.getDataLegendSeriesContextAt = function (a, b) { var c = { $type: Point_$type, x: a, y: b }; var d = this.ky(c); var e = d == null ? NaN : this.i6(d, "XMemberPath"); var f = d == null ? NaN : this.i6(d, "YMemberPath"); var g = new DataLegendSeriesValueInfo(); g.l = e; g.a = 13; g.q = "X"; g.r = this.zw != null ? this.zw : "X"; g.s = this.zs != null ? this.zs : "X:"; g.t = this.zu != null ? this.zu : ""; var h = new DataLegendSeriesValueInfo(); h.l = f; h.a = 14; h.q = "Y"; h.r = this.z4 != null ? this.z4 : "Y"; h.s = this.z0 != null ? this.z0 : "Y:"; h.t = this.z2 != null ? this.z2 : ""; 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.mp(); return i; }; HighDensityScatterSeries.prototype.k1 = function (a, b) { var c = this.nq(b); if (c == HighDensityScatterSeries.$$p[10]) { return this.k2(a, b, this.zw); } if (c == HighDensityScatterSeries.$$p[14]) { return this.k2(a, b, this.z4); } return _super.prototype.k1.call(this, a, b); }; HighDensityScatterSeries.prototype.mq = function (a) { var b = this.nq(a); if (b == HighDensityScatterSeries.$$p[10]) { return this.zw; } if (b == HighDensityScatterSeries.$$p[14]) { return this.z4; } return _super.prototype.mq.call(this, a); }; Object.defineProperty(HighDensityScatterSeries.prototype, "x1", { get: function () { return this.x0; }, set: function (a) { if (this.x0 != a) { var b = this.x1; this.x0 = a; this.raisePropertyChanged("YColumn", b, this.x1); } }, enumerable: false, configurable: true }); HighDensityScatterSeries.prototype.aaj = function () { if (this.xq == null) { return; } this.xq.t(); var a = this.xq; a.progressiveThunkCompleted = delegateRemove(a.progressiveThunkCompleted, runOn(this, this.z6)); this.xq = null; }; HighDensityScatterSeries.prototype.rs = function (a, b, c, d) { _super.prototype.rs.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.qw(); break; case "SeriesViewer": if (this.dc != null) { var e = this.getEffectiveViewport1(this.cw); this.x4 = !e.isEmpty; } break; case "FastItemsSource": this.aaj(); if (typeCast(IFastItemsSource_$type, c) != null) { c.deregisterColumn(this.xz); c.deregisterColumn(this.x1); this.xz = null; this.x1 = null; } if (typeCast(IFastItemsSource_$type, d) != null) { this.xz = this.dl(this.zw); this.x1 = this.dl(this.z4); } if ((this.xu != null && !this.xu.ee()) || (this.xs != null && !this.xs.ee())) { this.sa(this.go && c != null); } this.q3(); break; case HighDensityScatterSeries.$$p[7]: var f = this.xr; this.xr = this.xs; this.aaj(); if (f != null) { f.rangeChanged = delegateRemove(f.rangeChanged, runOn(this, this.z9)); } if (this.xr != null) { var g = this.xr; g.rangeChanged = delegateCombine(g.rangeChanged, runOn(this, this.z9)); } if (c != null) { c.cx(this); } if (d != null) { d.d4(this); } if ((this.xs != null && !this.xs.ee()) || (d == null && c != null)) { this.sa(false); } break; case HighDensityScatterSeries.$$p[11]: var h = this.xt; this.xt = this.xu; this.aaj(); if (h != null) { h.rangeChanged = delegateRemove(h.rangeChanged, runOn(this, this.z9)); } if (this.xt != null) { var i = this.xt; i.rangeChanged = delegateCombine(i.rangeChanged, runOn(this, this.z9)); } if (c != null) { c.cx(this); } if (d != null) { d.d4(this); } if ((this.xu != null && !this.xu.ee()) || (d == null && c != null)) { this.sa(false); } break; case "MouseOverEnabled": this.x5 = this.gf; this.sa(false); break; case HighDensityScatterSeries.$$p[10]: if (this.dp != null) { this.dp.deregisterColumn(this.xz); this.xz = this.dl(this.zw); } break; case "XColumn": this.aaj(); if (this.xs != null && !this.xs.ee()) { this.sa(false); } this.q3(); break; case HighDensityScatterSeries.$$p[14]: if (this.dp != null) { this.dp.deregisterColumn(this.x1); this.x1 = this.dl(this.z4); } break; case "YColumn": this.aaj(); if (this.xu != null && !this.xu.ee()) { this.sa(false); } this.q3(); break; case HighDensityScatterSeries.$$p[6]: this.aaj(); this.sa(false); this.q2(); break; case HighDensityScatterSeries.$$p[3]: this.sa(false); this.q2(); break; case HighDensityScatterSeries.$$p[1]: this.sa(false); this.q2(); break; case HighDensityScatterSeries.$$p[0]: case HighDensityScatterSeries.$$p[2]: if (!this.xp.ch(this.aa2, this.aa1)) { return; } this.aad(); this.sa(false); this.q2(); break; case HighDensityScatterSeries.$$p[4]: this.za = Math.max(typeGetValue(d) - 1, 0); this.x3 = this.za > 0; this.sa(false); this.q2(); break; case HighDensityScatterSeries.$$p[5]: this.sa(false); this.q2(); break; } }; HighDensityScatterSeries.prototype.aad = function () { this.ym = this.aa2.l; this.yp = this.aa2.o; this.yo = this.aa2.n; this.yn = this.aa2.m; this.yi = this.aa1.l; this.yl = this.aa1.o; this.yk = this.aa1.n; this.yj = this.aa1.m; this.wh = BrushUtil.l(truncate(this.ym), truncate(this.yp), truncate(this.yo), truncate(this.yn)); this.v1 = BrushUtil.l(truncate(this.yi), truncate(this.yl), truncate(this.yk), truncate(this.yj)); }; HighDensityScatterSeries.prototype.x7 = function (a) { if (typeCast(NumericYAxis.$, a) !== null) { return true; } return false; }; HighDensityScatterSeries.prototype.x6 = function (a) { if (typeCast(NumericXAxis.$, a) !== null) { return true; } return false; }; HighDensityScatterSeries.prototype.z9 = function (a, b) { this.aaj(); this.sa(false); }; Object.defineProperty(HighDensityScatterSeries.prototype, "yt", { get: function () { return this.yl - this.yp; }, enumerable: false, configurable: true }); Object.defineProperty(HighDensityScatterSeries.prototype, "ys", { get: function () { return this.yk - this.yo; }, enumerable: false, configurable: true }); Object.defineProperty(HighDensityScatterSeries.prototype, "yr", { get: function () { return this.yj - this.yn; }, enumerable: false, configurable: true }); Object.defineProperty(HighDensityScatterSeries.prototype, "yq", { get: function () { return this.yi - this.ym; }, enumerable: false, configurable: true }); HighDensityScatterSeries.prototype.hm = function (a, b, c) { var d = _super.prototype.hm.call(this, a, b, c); if (this.xu == null || this.xs == null || this.xs.b7 == null || this.xu.b7 == null || this.x1 == null || this.xz == null || this.x1.count < 1 || this.xz.count < 1 || this.x1.count != this.xz.count || this.xs.qy == this.xs.qx || this.xu.qy == this.xu.qx || this.xf.isEmpty) { d = false; } return d; }; Object.defineProperty(HighDensityScatterSeries.prototype, "zh", { get: function () { return this.zb; }, set: function (a) { var b = this.zb; this.zb = a; this.raisePropertyChanged("ProgressiveStatus", b, this.zb); }, enumerable: false, configurable: true }); HighDensityScatterSeries.prototype.sb = function (a) { _super.prototype.sb.call(this, a); this.aab(a, this.cw); }; HighDensityScatterSeries.prototype.x2 = function () { if (TestRandomness.instance.testRandomnessSource != null) { return TestRandomness.instance.testRandomnessSource; } return new DefaultRandomnessSource(0); }; HighDensityScatterSeries.prototype.aab = function (a, b) { if (this.d7(b)) { return; } if (this.xq == null && !this.x9) { var c = new List$1(KDPointData.$, 2, this.xz.count); var d = this.xs; var e = this.xu; 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.dn); var i = new ScalerParams(1, f, g, e.dn); var j_1; var k_1; var _loop_1 = function (l) { j_1 = d.f7(this_1.xz.item(l), h); k_1 = e.f7(this_1.x1.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.xz.count; l++) { _loop_1(l); } if (this.x8) { this.y6 = 1; this.y7 = truncate(logBase(c.count, 2)) + 3; this.zh = truncate(((this.y6 / this.y7) * 100)); if (this.progressiveLoadStatusChanged != null) { this.progressiveLoadStatusChanged(this, new ProgressiveLoadStatusEventArgs(this.zh)); } this.xq = KDTree2D.b(c.toArray(), 1, this.x2()); var m = this.xq; m.progressiveThunkCompleted = delegateCombine(m.progressiveThunkCompleted, runOn(this, this.z6)); if (!this.xq.h(this.ka)) { var n = this.xq; n.progressiveThunkCompleted = delegateRemove(n.progressiveThunkCompleted, runOn(this, this.z6)); } this.q2(); } else { var o = dateNow(); this.xq = new KDTree2D(0, c.toArray(), 1, this.x2()); var p = dateNow(); } } if (this.x8 && !this.x9) { this.aac(b); } else { this.aae(b); } }; HighDensityScatterSeries.prototype.pq = function (a, b, c, d) { _super.prototype.pq.call(this, a, b, c, d); this.aaj(); var e = false; if (this.xs != null && !this.xs.ee()) { e = true; } if (this.xu != null && !this.xu.ee()) { e = true; } if (e) { this.sa(false); } this.q3(); }; HighDensityScatterSeries.prototype.z8 = function (a) { var b = a; var c = this.y9 * this.y8; if (this.x5) { 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.aae = 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.xv = new ScalerParams(0, b, c, this.xr.dn, g); this.xw = new ScalerParams(0, b, c, this.xt.dn, g); this.z7(a); this.z8(a); var h = this.y9 * this.y8; if (this.xo == null || this.xo.length != h) { this.xo = new Array(h); this.xl = new Array(h); } var i = this.xo.length; var j = this.xo; var k = this.xl; for (var l = 0; l < i; l++) { j[l] = 0; k[l] = 0; } this.zd = truncate(Math.round(this.im)); this.xn = f.ce(); var m = this.xn.length; var n = this.xn; for (var o = 0; o < m; o++) { n[o] = 0; } var p = this.y4; var q = this.y3; if (isNaN_(p) || isInfinity(p)) { p = 0; } if (isNaN_(q) || isInfinity(q)) { q = 50; } this.yg = Math.min(p, q); this.yf = Math.max(p, q); if (this.yg < 0) { this.yg = 0; } if (this.yf < 0) { this.yf = 0; } this.yh = this.yf - this.yg; if (this.x9) { this.aaa(a); } else { this.aal(a); } f.cp(); if (a.t) { this._itemIndexes = d; this.xp.cq(); } }; HighDensityScatterSeries.prototype.aac = function (a) { if (this.xq == null) { return; } this.aae(a); }; HighDensityScatterSeries.prototype.z6 = function (a, b) { var _this = this; this.xp.co(function () { if (_this.y6 < _this.y7 - 1) { _this.y6++; } _this.zh = truncate(((_this.y6 / _this.y7) * 100)); if (_this.progressiveLoadStatusChanged != null) { _this.progressiveLoadStatusChanged(_this, new ProgressiveLoadStatusEventArgs(_this.zh)); } _this.aac(_this.cw); _this.q2(); if (_this.xq != null) { if (!_this.xq.h(_this.ka)) { var c = _this.xq; c.progressiveThunkCompleted = delegateRemove(c.progressiveThunkCompleted, runOn(_this, _this.z6)); _this.zh = 100; if (_this.progressiveLoadStatusChanged != null) { _this.progressiveLoadStatusChanged(_this, new ProgressiveLoadStatusEventArgs(_this.zh)); } } } }); }; HighDensityScatterSeries.prototype.aaa = function (a) { var b = arrayShallowClone(this.xz.asArray()); this.xs.k3(boxArray$1(b), 0, b.length, this.xv); var c = arrayShallowClone(this.x1.asArray()); this.zc = 0; var d = this.za; var e = this.x3; var f = this.xo.length; this.xu.k3(boxArray$1(c), 0, c.length, this.xw); var g = 255 << 24 | truncate(this.yp) << 16 | truncate(this.yo) << 8 | truncate(this.yn); 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.y9 || j < 0 || j >= this.y8) { continue; } if (e) { var k = i - d; var l = i + d; l = l > (this.y9 - 1) ? (this.y9 - 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.y9) + o; if (q < 0 || q > f - 1) { continue; } this.xo[q] = this.xo[q] + 1; this.xl[q] = 1; this.zc++; if (this.x5) { this._itemIndexes[q] = h + 1; } } } } else { var r = (j * this.y9) + i; this.xo[r] = this.xo[r] + 1; this.xl[r] = 1; this.zc++; if (this.x5) { this._itemIndexes[r] = h + 1; } } } this.aaf(); }; HighDensityScatterSeries.prototype.aal = function (a) { var b; var c; var d = a.getViewInfo(b, c); b = d.p0; c = d.p1; if (this.xq == null) { return; } if (this.ya == null) { this.ya = new List$1(KDTreeNode2D.$, 2, truncate(Math.round(b.width * b.height))); } else { this.ya.clear(); } var e = c.left; var f = c.right; var g = c.top; var h = c.bottom; this.y0 = c.top; this.yy = c.height; this.yz = c.left; this.y1 = c.width; this.yw = b.top; this.yu = b.height; this.yv = b.left; this.yx = b.width; var i = this.getEffectiveViewport1(a); this.yc = (i.left - this.yv) / this.yx; this.yd = (i.top - this.yw) / this.yu; var j = (i.right - this.yv) / this.yx; this.ye = j - this.yc; var k = (i.bottom - this.yw) / this.yu; this.yb = k - this.yd; if (this.x4) { e = (e - this.yc) / this.ye; f = (f - this.yc) / this.ye; g = (g - this.yd) / this.yb; h = (h - this.yd) / this.yb; } var l = this.im / b.width * c.width; var m = this.im / 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.xq.u(this.ya, o, 0, 1, 0, 1); var p; this.zc = 0; for (var q = 0; q < this.ya.count; q++) { p = this.ya._inner[q]; this.aag(p); } this.aaf(); }; HighDensityScatterSeries.prototype.aag = 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.aai(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.aai(e, d, false, a.e); } } if (a.e != null) { a.e.a = false; } }; HighDensityScatterSeries.prototype.gl = function (a) { var b = this.dc != null ? this.dc.yv : Rect.empty; var c = this.dc != null ? this.dc.zd : Rect.empty; var d = new Rect(0, 0, 0, 1, 1); var e = this.w8(this.cw); var f = new ScalerParams(0, d, d, this.xs.dn, e); var g = new ScalerParams(0, d, d, this.xu.dn, e); var h = !b.isEmpty && !c.isEmpty && this.dp != null ? this.dp.indexOf(a) : -1; var i = this.xs != null && this.xz != null && h < this.xz.count ? this.xs.f7(this.xz.item(h), f) : NaN; var j = this.xu != null && this.x1 != null && h < this.x1.count ? this.xu.f7(this.x1.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.aai = function (a, b, c, d) { var e = this.zf(b); var f = a.c; var g = this.za; if (c) { var h = d.d; var i = d.b; var j = d.e; var k = d.c; if (this.x4) { h = this.yc + this.ye * h; i = this.yc + this.ye * i; j = this.yd + this.yb * j; k = this.yd + this.yb * k; } var l = truncate((this.yv + this.yx * (h - this.yz) / this.y1)); var m = truncate((this.yv + this.yx * (i - this.yz) / this.y1)); var n = truncate((this.yw + this.yu * (j - this.y0) / this.yy)); var o = truncate((this.yw + this.yu * (k - this.y0) / this.yy)); l = truncate(Math.floor(l)); m = truncate(Math.floor(m)); n = truncate(Math.floor(n)); o = truncate(Math.floor(o)); if (this.x3) { 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.aah(f, s, t, q, r); } } } else { var u = a.a; var v = a.b; if (this.x4) { u = this.yc + this.ye * u; v = this.yd + this.yb * v; } var w = truncate((this.yv + this.yx * (u - this.yz) / this.y1)); var x = truncate((this.yw + this.yu * (v - this.y0) / this.yy)); w = truncate(Math.floor(w)); x = truncate(Math.floor(x)); if (this.x3) { 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.aah(f, af, ag, ad, ae); } } } else { this.aah(f, w, x, b, 1); } } }; HighDensityScatterSeries.prototype.ze = function (a, b) { return truncate((Math.floor(255 * b))) << 24 | truncate(Math.floor(b * (this.yp + a * this.yt))) << 16 | truncate(Math.floor(b * (this.yo + a * this.ys))) << 8 | truncate(Math.floor(b * (this.yn + a * this.yr))); }; HighDensityScatterSeries.prototype.zf = function (a) { return 255 << 24 | truncate(Math.floor((this.yp + a * this.yt))) << 16 | truncate(Math.floor((this.yo + a * this.ys))) << 8 | truncate(Math.floor((this.yn + a * this.yr))); }; HighDensityScatterSeries.prototype.y2 = function (a) { return (a >> 24 & 255) / 255; }; HighDensityScatterSeries.prototype.aah = function (a, b, c, d, e) { if (b < 0 || b >= this.y9 || c < 0 || c >= this.y8) { return; } var f = (c * this.y9) + b; this.xo[f] = this.xo[f] + d; this.xl[f] = this.xl[f] + e; if (this.x5) { this._itemIndexes[f] = a + 1; } this.zc += truncate(d); }; HighDensityScatterSeries.prototype.aaf = function () { var a = 0; var b = 0; var c = this.yh; var d = this.yg; var e = this.yf; var f = this.xo.length; var g = this.xo; var h = this.xl; var i = this.xn; 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.ze(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.z7 = function (a) { var b = a; b.cm(); }; HighDensityScatterSeries.prototype.ct = function () { return new HighDensityScatterSeriesView(this); }; HighDensityScatterSeries.prototype.rj = function (a) { _super.prototype.rj.call(this, a); this.xp = a; }; HighDensityScatterSeries.prototype.ay = function (a) { if (a != null && a == this.xs && this.xz != null) { return new AxisRange(this.xz.minimum, this.xz.maximum); } if (a != null && a == this.xu && this.x1 != null) { return new AxisRange(this.x1.minimum, this.x1.maximum); } return null; }; HighDensityScatterSeries.prototype.ta = function (a, b) { if (this.dc != null) { var c = this.getEffectiveViewport1(this.cw); this.x4 = !c.isEmpty; } this.sa(false); }; HighDensityScatterSeries.prototype.tb = function (a, b) { this.sa(false); }; HighDensityScatterSeries.prototype.ky = function (a) { if (!this.x5 || this._itemIndexes == null || this.dc == null || this.dp == null || this._itemIndexes.length != (this.y9 * this.y8)) { return null; } var b = this.dc.yv; var c = (a.x - b.left) / b.width; var d = (a.y - b.top) / b.height; var e = truncate(Math.round(this.xf.left + (this.xf.width * c))); var f = truncate(Math.round(this.xf.top + (this.xf.height * d))); var g = this.zi(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.zi = function (a, b) { var c = (this.y9 * b) + a; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } var d = 1; c = (this.y9 * (b - d)) + a; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } c = (this.y9 * (b + d)) + a; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } c = (this.y9 * (b)) + a - 1; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } c = (this.y9 * (b)) + a + 1; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } c = (this.y9 * (b - d)) + a - 1; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } c = (this.y9 * (b + d)) + a + 1; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } c = (this.y9 * (b - d)) + a + 1; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } c = (this.y9 * (b + d)) + a - 1; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } return 0; }; HighDensityScatterSeries.prototype.aak = function (a, b, c) { this.xn = a; this.y9 = b; this.y8 = c; }; HighDensityScatterSeries.prototype.get_hf = function () { return true; }; HighDensityScatterSeries.prototype.set_hf = function (a) { _super.prototype.set_hf.call(this, a); }; HighDensityScatterSeries.prototype.pk = function (a, b) { _super.prototype.pk.call(this, a, b); this.xp.cn(); if (this.cv != null) { this.cv.cn(); } this.q2(); }; HighDensityScatterSeries.prototype.sc = function (a, b) { _super.prototype.sc.call(this, a, b); if (!this.g8) { 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.aab(false, c); this.g8 = false; }; HighDensityScatterSeries.prototype.r9 = function (a, b, c, d, e) { _super.prototype.r9.call(this, a, b, c, d, e); var f = this.ba.a$k.item(d); var g = f; f.bd(c); if (this.d7(g)) { return; } if (this.xx == null) { this.xx = new ScatterFrame(); } this.aab(false, f); }; HighDensityScatterSeries.prototype.ph = function () { _super.prototype.ph.call(this); this.xs = null; this.xu = null; }; HighDensityScatterSeries.$t = markType(HighDensityScatterSeries, 'HighDensityScatterSeries', Series.$); HighDensityScatterSeries.$$p = markDep(DependencyProperty, PropertyMetadata, HighDensityScatterSeries, 'raisePropertyChanged', ['HeatMaximumColor:aa1:aam', [Color.$, Defaults.be], 'HeatMaximum:y3:aan', [1, 50], 'HeatMinimumColor:aa2:aao', [Color.$, Defaults.bf], 'HeatMinimum:y4:aap', [1, 0], 'PointExtent:zg:aaq', [1, 1], 'ProgressiveLoad:x8:aar', [0, true], 'UseBruteForce:x9:aas', [0, false], 'XAxis:xs:aat', [NumericXAxis.$, null], 'XMemberAsLegendLabel:zs:aau', [2, null], 'XMemberAsLegendUnit:zu:aav', [2, null], 'XMemberPath:zw:aaw', [2, null], 'YAxis:xu:aax', [NumericYAxis.$, null], 'YMemberAsLegendLabel:z0:aay', [2, null], 'YMemberAsLegendUnit:z2:aaz', [2, null], 'YMemberPath:z4:aa0', [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.aa2 = Defaults.bf; this.cf.aa1 = Defaults.be; this.cf.v1 = Defaults.ba; this.cf.wh = Defaults.a9; } }; HighDensityScatterSeriesView.prototype.cq = function () { this.cf.aak(this.cd, this.cl, this.ck); }; HighDensityScatterSeriesView.prototype.cm = function () { if (this.ci == null) { this.ci = this.f.ka.createElement("canvas"); var a = this.f.ka.get2DCanvasContext(this.ci); this.cg = new RenderingContext(new CanvasViewRenderer(), a); } var b; if (this.s) { b = this.b9; } else { b = this.f.dc.y1(); } 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.aak(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.ka != null) { this.f.ka.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.gf) { 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 };