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