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.xw = null; _this.xy = null; _this.y8 = 0; _this.x1 = false; _this.yn = Defaults.bf.o; _this.ym = Defaults.bf.n; _this.yl = Defaults.bf.m; _this.yk = Defaults.bf.l; _this.yj = Defaults.be.o; _this.yi = Defaults.be.n; _this.yh = Defaults.be.m; _this.yg = Defaults.be.l; _this.xo = null; _this.xt = null; _this.xu = null; _this.xp = null; _this.xr = null; _this.x3 = false; _this.y9 = 0; _this.zb = 0; _this.y5 = 0; _this.y4 = 0; _this.progressiveLoadStatusChanged = null; _this.x8 = null; _this.ye = 0; _this.yd = 0; _this.yf = 0; _this.yu = 0; _this.ys = 0; _this.yt = 0; _this.yv = 0; _this.yx = 0; _this.yz = 0; _this.yy = 0; _this.yw = 0; _this.ya = 0; _this.yb = 0; _this.yc = 0; _this.x9 = 0; _this.y7 = 0; _this.y6 = 0; _this.xl = null; _this.za = 0; _this.x2 = false; _this._itemIndexes = null; _this.xm = null; _this.xj = null; _this.xv = null; _this.ab = HighDensityScatterSeries.$; _this.ge = false; return _this; } HighDensityScatterSeries.prototype.bk = function () { return new HighDensityScatterSeries(); }; HighDensityScatterSeries.prototype.get_fr = function () { return true; }; HighDensityScatterSeries.prototype.js = function () { if (!isNaN_(this.jr)) { return _super.prototype.js.call(this); } return Defaults.ad; }; HighDensityScatterSeries.prototype.get_fz = function () { return true; }; Object.defineProperty(HighDensityScatterSeries.prototype, "xx", { get: function () { return this.xw; }, set: function (a) { if (this.xw != a) { var b = this.xx; this.xw = a; this.raisePropertyChanged("XColumn", b, this.xx); } }, enumerable: false, configurable: true }); HighDensityScatterSeries.prototype.getDataLegendSeriesContextAt = function (a, b) { var c = { $type: Point_$type, x: a, y: b }; var d = this.kw(c); var e = d == null ? NaN : this.i4(d, "XMemberPath"); var f = d == null ? NaN : this.i4(d, "YMemberPath"); var g = new DataLegendSeriesValueInfo(); g.l = e; g.a = 13; g.q = "X"; g.r = this.zu != null ? this.zu : "X"; g.s = this.zq != null ? this.zq : "X:"; g.t = this.zs != null ? this.zs : ""; var h = new DataLegendSeriesValueInfo(); h.l = f; h.a = 14; h.q = "Y"; h.r = this.z2 != null ? this.z2 : "Y"; h.s = this.zy != null ? this.zy : "Y:"; h.t = this.z0 != null ? this.z0 : ""; 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.mn(); return i; }; HighDensityScatterSeries.prototype.kz = function (a, b) { var c = this.no(b); if (c == HighDensityScatterSeries.$$p[10]) { return this.k0(a, b, this.zu); } if (c == HighDensityScatterSeries.$$p[14]) { return this.k0(a, b, this.z2); } return _super.prototype.kz.call(this, a, b); }; HighDensityScatterSeries.prototype.mo = function (a) { var b = this.no(a); if (b == HighDensityScatterSeries.$$p[10]) { return this.zu; } if (b == HighDensityScatterSeries.$$p[14]) { return this.z2; } return _super.prototype.mo.call(this, a); }; 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("YColumn", b, this.xz); } }, enumerable: false, configurable: true }); HighDensityScatterSeries.prototype.aah = function () { if (this.xo == null) { return; } this.xo.t(); var a = this.xo; a.progressiveThunkCompleted = delegateRemove(a.progressiveThunkCompleted, runOn(this, this.z4)); this.xo = null; }; HighDensityScatterSeries.prototype.rq = function (a, b, c, d) { _super.prototype.rq.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.qu(); break; case "SeriesViewer": if (this.dc != null) { var e = this.getEffectiveViewport1(this.cw); this.x2 = !e.isEmpty; } break; case "FastItemsSource": this.aah(); if (typeCast(IFastItemsSource_$type, c) != null) { c.deregisterColumn(this.xx); c.deregisterColumn(this.xz); this.xx = null; this.xz = null; } if (typeCast(IFastItemsSource_$type, d) != null) { this.xx = this.dl(this.zu); this.xz = this.dl(this.z2); } if ((this.xs != null && !this.xs.ed()) || (this.xq != null && !this.xq.ed())) { this.r8(this.gm && c != null); } this.q1(); break; case HighDensityScatterSeries.$$p[7]: var f = this.xp; this.xp = this.xq; this.aah(); if (f != null) { f.rangeChanged = delegateRemove(f.rangeChanged, runOn(this, this.z7)); } if (this.xp != null) { var g = this.xp; g.rangeChanged = delegateCombine(g.rangeChanged, runOn(this, this.z7)); } if (c != null) { c.cx(this); } if (d != null) { d.d3(this); } if ((this.xq != null && !this.xq.ed()) || (d == null && c != null)) { this.r8(false); } break; case HighDensityScatterSeries.$$p[11]: var h = this.xr; this.xr = this.xs; this.aah(); if (h != null) { h.rangeChanged = delegateRemove(h.rangeChanged, runOn(this, this.z7)); } if (this.xr != null) { var i = this.xr; i.rangeChanged = delegateCombine(i.rangeChanged, runOn(this, this.z7)); } if (c != null) { c.cx(this); } if (d != null) { d.d3(this); } if ((this.xs != null && !this.xs.ed()) || (d == null && c != null)) { this.r8(false); } break; case "MouseOverEnabled": this.x3 = this.ge; this.r8(false); break; case HighDensityScatterSeries.$$p[10]: if (this.dp != null) { this.dp.deregisterColumn(this.xx); this.xx = this.dl(this.zu); } break; case "XColumn": this.aah(); if (this.xq != null && !this.xq.ed()) { this.r8(false); } this.q1(); break; case HighDensityScatterSeries.$$p[14]: if (this.dp != null) { this.dp.deregisterColumn(this.xz); this.xz = this.dl(this.z2); } break; case "YColumn": this.aah(); if (this.xs != null && !this.xs.ed()) { this.r8(false); } this.q1(); break; case HighDensityScatterSeries.$$p[6]: this.aah(); this.r8(false); this.q0(); break; case HighDensityScatterSeries.$$p[3]: this.r8(false); this.q0(); break; case HighDensityScatterSeries.$$p[1]: this.r8(false); this.q0(); break; case HighDensityScatterSeries.$$p[0]: case HighDensityScatterSeries.$$p[2]: if (!this.xn.ch(this.aa0, this.aaz)) { return; } this.aab(); this.r8(false); this.q0(); break; case HighDensityScatterSeries.$$p[4]: this.y8 = Math.max(typeGetValue(d) - 1, 0); this.x1 = this.y8 > 0; this.r8(false); this.q0(); break; case HighDensityScatterSeries.$$p[5]: this.r8(false); this.q0(); break; } }; HighDensityScatterSeries.prototype.aab = function () { this.yk = this.aa0.l; this.yn = this.aa0.o; this.ym = this.aa0.n; this.yl = this.aa0.m; this.yg = this.aaz.l; this.yj = this.aaz.o; this.yi = this.aaz.n; this.yh = this.aaz.m; this.wf = BrushUtil.j(truncate(this.yk), truncate(this.yn), truncate(this.ym), truncate(this.yl)); this.vz = BrushUtil.j(truncate(this.yg), truncate(this.yj), truncate(this.yi), truncate(this.yh)); }; HighDensityScatterSeries.prototype.x5 = function (a) { if (typeCast(NumericYAxis.$, a) !== null) { return true; } return false; }; HighDensityScatterSeries.prototype.x4 = function (a) { if (typeCast(NumericXAxis.$, a) !== null) { return true; } return false; }; HighDensityScatterSeries.prototype.z7 = function (a, b) { this.aah(); this.r8(false); }; 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 }); Object.defineProperty(HighDensityScatterSeries.prototype, "yo", { get: function () { return this.yg - this.yk; }, enumerable: false, configurable: true }); HighDensityScatterSeries.prototype.hk = function (a, b, c) { var d = _super.prototype.hk.call(this, a, b, c); if (this.xs == null || this.xq == null || this.xq.b7 == null || this.xs.b7 == null || this.xz == null || this.xx == null || this.xz.count < 1 || this.xx.count < 1 || this.xz.count != this.xx.count || this.xq.qw == this.xq.qv || this.xs.qw == this.xs.qv || this.xd.isEmpty) { d = false; } return d; }; Object.defineProperty(HighDensityScatterSeries.prototype, "zf", { get: function () { return this.y9; }, set: function (a) { var b = this.y9; this.y9 = a; this.raisePropertyChanged("ProgressiveStatus", b, this.y9); }, enumerable: false, configurable: true }); HighDensityScatterSeries.prototype.r9 = function (a) { _super.prototype.r9.call(this, a); this.z9(a, this.cw); }; HighDensityScatterSeries.prototype.x0 = function () { if (TestRandomness.instance.testRandomnessSource != null) { return TestRandomness.instance.testRandomnessSource; } return new DefaultRandomnessSource(0); }; HighDensityScatterSeries.prototype.z9 = function (a, b) { if (this.d7(b)) { return; } if (this.xo == null && !this.x7) { var c = new List$1(KDPointData.$, 2, this.xx.count); var d = this.xq; var e = this.xs; 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.f6(this_1.xx.item(l), h); k_1 = e.f6(this_1.xz.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.xx.count; l++) { _loop_1(l); } if (this.x6) { this.y4 = 1; this.y5 = truncate(logBase(c.count, 2)) + 3; this.zf = truncate(((this.y4 / this.y5) * 100)); if (this.progressiveLoadStatusChanged != null) { this.progressiveLoadStatusChanged(this, new ProgressiveLoadStatusEventArgs(this.zf)); } this.xo = KDTree2D.b(c.toArray(), 1, this.x0()); var m = this.xo; m.progressiveThunkCompleted = delegateCombine(m.progressiveThunkCompleted, runOn(this, this.z4)); if (!this.xo.h(this.j8)) { var n = this.xo; n.progressiveThunkCompleted = delegateRemove(n.progressiveThunkCompleted, runOn(this, this.z4)); } this.q0(); } else { var o = dateNow(); this.xo = new KDTree2D(0, c.toArray(), 1, this.x0()); var p = dateNow(); } } if (this.x6 && !this.x7) { this.aaa(b); } else { this.aac(b); } }; HighDensityScatterSeries.prototype.po = function (a, b, c, d) { _super.prototype.po.call(this, a, b, c, d); this.aah(); var e = false; if (this.xq != null && !this.xq.ed()) { e = true; } if (this.xs != null && !this.xs.ed()) { e = true; } if (e) { this.r8(false); } this.q1(); }; HighDensityScatterSeries.prototype.z6 = function (a) { var b = a; var c = this.y7 * this.y6; if (this.x3) { 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.aac = 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.xt = new ScalerParams(0, b, c, this.xp.dn, g); this.xu = new ScalerParams(0, b, c, this.xr.dn, g); this.z5(a); this.z6(a); var h = this.y7 * this.y6; if (this.xm == null || this.xm.length != h) { this.xm = new Array(h); this.xj = new Array(h); } var i = this.xm.length; var j = this.xm; var k = this.xj; for (var l = 0; l < i; l++) { j[l] = 0; k[l] = 0; } this.zb = truncate(Math.round(this.ik)); this.xl = f.ce(); var m = this.xl.length; var n = this.xl; for (var o = 0; o < m; o++) { n[o] = 0; } var p = this.y2; var q = this.y1; if (isNaN_(p) || isInfinity(p)) { p = 0; } if (isNaN_(q) || isInfinity(q)) { q = 50; } this.ye = Math.min(p, q); this.yd = Math.max(p, q); if (this.ye < 0) { this.ye = 0; } if (this.yd < 0) { this.yd = 0; } this.yf = this.yd - this.ye; if (this.x7) { this.z8(a); } else { this.aaj(a); } f.cp(); if (a.t) { this._itemIndexes = d; this.xn.cq(); } }; HighDensityScatterSeries.prototype.aaa = function (a) { if (this.xo == null) { return; } this.aac(a); }; HighDensityScatterSeries.prototype.z4 = function (a, b) { var _this = this; this.xn.co(function () { if (_this.y4 < _this.y5 - 1) { _this.y4++; } _this.zf = truncate(((_this.y4 / _this.y5) * 100)); if (_this.progressiveLoadStatusChanged != null) { _this.progressiveLoadStatusChanged(_this, new ProgressiveLoadStatusEventArgs(_this.zf)); } _this.aaa(_this.cw); _this.q0(); if (_this.xo != null) { if (!_this.xo.h(_this.j8)) { var c = _this.xo; c.progressiveThunkCompleted = delegateRemove(c.progressiveThunkCompleted, runOn(_this, _this.z4)); _this.zf = 100; if (_this.progressiveLoadStatusChanged != null) { _this.progressiveLoadStatusChanged(_this, new ProgressiveLoadStatusEventArgs(_this.zf)); } } } }); }; HighDensityScatterSeries.prototype.z8 = function (a) { var b = arrayShallowClone(this.xx.asArray()); this.xq.k1(boxArray$1(b), 0, b.length, this.xt); var c = arrayShallowClone(this.xz.asArray()); this.za = 0; var d = this.y8; var e = this.x1; var f = this.xm.length; this.xs.k1(boxArray$1(c), 0, c.length, this.xu); var g = 255 << 24 | truncate(this.yn) << 16 | truncate(this.ym) << 8 | truncate(this.yl); 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.y7 || j < 0 || j >= this.y6) { continue; } if (e) { var k = i - d; var l = i + d; l = l > (this.y7 - 1) ? (this.y7 - 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.y7) + o; if (q < 0 || q > f - 1) { continue; } this.xm[q] = this.xm[q] + 1; this.xj[q] = 1; this.za++; if (this.x3) { this._itemIndexes[q] = h + 1; } } } } else { var r = (j * this.y7) + i; this.xm[r] = this.xm[r] + 1; this.xj[r] = 1; this.za++; if (this.x3) { this._itemIndexes[r] = h + 1; } } } this.aad(); }; HighDensityScatterSeries.prototype.aaj = function (a) { var b; var c; var d = a.getViewInfo(b, c); b = d.p0; c = d.p1; if (this.xo == null) { return; } if (this.x8 == null) { this.x8 = new List$1(KDTreeNode2D.$, 2, truncate(Math.round(b.width * b.height))); } else { this.x8.clear(); } var e = c.left; var f = c.right; var g = c.top; var h = c.bottom; this.yy = c.top; this.yw = c.height; this.yx = c.left; this.yz = c.width; this.yu = b.top; this.ys = b.height; this.yt = b.left; this.yv = b.width; var i = this.getEffectiveViewport1(a); this.ya = (i.left - this.yt) / this.yv; this.yb = (i.top - this.yu) / this.ys; var j = (i.right - this.yt) / this.yv; this.yc = j - this.ya; var k = (i.bottom - this.yu) / this.ys; this.x9 = k - this.yb; if (this.x2) { e = (e - this.ya) / this.yc; f = (f - this.ya) / this.yc; g = (g - this.yb) / this.x9; h = (h - this.yb) / this.x9; } var l = this.ik / b.width * c.width; var m = this.ik / 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.xo.u(this.x8, o, 0, 1, 0, 1); var p; this.za = 0; for (var q = 0; q < this.x8.count; q++) { p = this.x8._inner[q]; this.aae(p); } this.aad(); }; HighDensityScatterSeries.prototype.aae = 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.aag(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.aag(e, d, false, a.e); } } if (a.e != null) { a.e.a = false; } }; HighDensityScatterSeries.prototype.gj = function (a) { var b = this.dc != null ? this.dc.yr : Rect.empty; var c = this.dc != null ? this.dc.y9 : Rect.empty; var d = new Rect(0, 0, 0, 1, 1); var e = this.w6(this.cw); var f = new ScalerParams(0, d, d, this.xq.dn, e); var g = new ScalerParams(0, d, d, this.xs.dn, e); var h = !b.isEmpty && !c.isEmpty && this.dp != null ? this.dp.indexOf(a) : -1; var i = this.xq != null && this.xx != null && h < this.xx.count ? this.xq.f6(this.xx.item(h), f) : NaN; var j = this.xs != null && this.xz != null && h < this.xz.count ? this.xs.f6(this.xz.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.aag = function (a, b, c, d) { var e = this.zd(b); var f = a.c; var g = this.y8; if (c) { var h = d.d; var i = d.b; var j = d.e; var k = d.c; if (this.x2) { h = this.ya + this.yc * h; i = this.ya + this.yc * i; j = this.yb + this.x9 * j; k = this.yb + this.x9 * k; } var l = truncate((this.yt + this.yv * (h - this.yx) / this.yz)); var m = truncate((this.yt + this.yv * (i - this.yx) / this.yz)); var n = truncate((this.yu + this.ys * (j - this.yy) / this.yw)); var o = truncate((this.yu + this.ys * (k - this.yy) / this.yw)); l = truncate(Math.floor(l)); m = truncate(Math.floor(m)); n = truncate(Math.floor(n)); o = truncate(Math.floor(o)); if (this.x1) { 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.aaf(f, s, t, q, r); } } } else { var u = a.a; var v = a.b; if (this.x2) { u = this.ya + this.yc * u; v = this.yb + this.x9 * v; } var w = truncate((this.yt + this.yv * (u - this.yx) / this.yz)); var x = truncate((this.yu + this.ys * (v - this.yy) / this.yw)); w = truncate(Math.floor(w)); x = truncate(Math.floor(x)); if (this.x1) { 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.aaf(f, af, ag, ad, ae); } } } else { this.aaf(f, w, x, b, 1); } } }; HighDensityScatterSeries.prototype.zc = function (a, b) { return truncate((Math.floor(255 * b))) << 24 | truncate(Math.floor(b * (this.yn + a * this.yr))) << 16 | truncate(Math.floor(b * (this.ym + a * this.yq))) << 8 | truncate(Math.floor(b * (this.yl + a * this.yp))); }; HighDensityScatterSeries.prototype.zd = function (a) { return 255 << 24 | truncate(Math.floor((this.yn + a * this.yr))) << 16 | truncate(Math.floor((this.ym + a * this.yq))) << 8 | truncate(Math.floor((this.yl + a * this.yp))); }; HighDensityScatterSeries.prototype.y0 = function (a) { return (a >> 24 & 255) / 255; }; HighDensityScatterSeries.prototype.aaf = function (a, b, c, d, e) { if (b < 0 || b >= this.y7 || c < 0 || c >= this.y6) { return; } var f = (c * this.y7) + b; this.xm[f] = this.xm[f] + d; this.xj[f] = this.xj[f] + e; if (this.x3) { this._itemIndexes[f] = a + 1; } this.za += truncate(d); }; HighDensityScatterSeries.prototype.aad = function () { var a = 0; var b = 0; var c = this.yf; var d = this.ye; var e = this.yd; var f = this.xm.length; var g = this.xm; var h = this.xj; var i = this.xl; 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.zc(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.z5 = function (a) { var b = a; b.cm(); }; HighDensityScatterSeries.prototype.ct = function () { return new HighDensityScatterSeriesView(this); }; HighDensityScatterSeries.prototype.rh = function (a) { _super.prototype.rh.call(this, a); this.xn = a; }; HighDensityScatterSeries.prototype.ay = function (a) { if (a != null && a == this.xq && this.xx != null) { return new AxisRange(this.xx.minimum, this.xx.maximum); } if (a != null && a == this.xs && this.xz != null) { return new AxisRange(this.xz.minimum, this.xz.maximum); } return null; }; HighDensityScatterSeries.prototype.s8 = function (a, b) { if (this.dc != null) { var c = this.getEffectiveViewport1(this.cw); this.x2 = !c.isEmpty; } this.r8(false); }; HighDensityScatterSeries.prototype.s9 = function (a, b) { this.r8(false); }; HighDensityScatterSeries.prototype.kw = function (a) { if (!this.x3 || this._itemIndexes == null || this.dc == null || this.dp == null || this._itemIndexes.length != (this.y7 * this.y6)) { return null; } var b = this.dc.yr; var c = (a.x - b.left) / b.width; var d = (a.y - b.top) / b.height; var e = truncate(Math.round(this.xd.left + (this.xd.width * c))); var f = truncate(Math.round(this.xd.top + (this.xd.height * d))); var g = this.zg(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.zg = function (a, b) { var c = (this.y7 * b) + a; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } var d = 1; c = (this.y7 * (b - d)) + a; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } c = (this.y7 * (b + d)) + a; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } c = (this.y7 * (b)) + a - 1; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } c = (this.y7 * (b)) + a + 1; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } c = (this.y7 * (b - d)) + a - 1; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } c = (this.y7 * (b + d)) + a + 1; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } c = (this.y7 * (b - d)) + a + 1; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } c = (this.y7 * (b + d)) + a - 1; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } return 0; }; HighDensityScatterSeries.prototype.aai = function (a, b, c) { this.xl = a; this.y7 = b; this.y6 = c; }; HighDensityScatterSeries.prototype.get_hd = function () { return true; }; HighDensityScatterSeries.prototype.set_hd = function (a) { _super.prototype.set_hd.call(this, a); }; HighDensityScatterSeries.prototype.pi = function (a, b) { _super.prototype.pi.call(this, a, b); this.xn.cn(); if (this.cv != null) { this.cv.cn(); } this.q0(); }; HighDensityScatterSeries.prototype.sa = function (a, b) { _super.prototype.sa.call(this, a, b); if (!this.g6) { 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.z9(false, c); this.g6 = false; }; HighDensityScatterSeries.prototype.r7 = function (a, b, c, d, e) { _super.prototype.r7.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.xv == null) { this.xv = new ScatterFrame(); } this.z9(false, f); }; HighDensityScatterSeries.prototype.pf = function () { _super.prototype.pf.call(this); this.xq = null; this.xs = null; }; HighDensityScatterSeries.$t = markType(HighDensityScatterSeries, 'HighDensityScatterSeries', Series.$); HighDensityScatterSeries.$$p = markDep(DependencyProperty, PropertyMetadata, HighDensityScatterSeries, 'raisePropertyChanged', ['HeatMaximumColor:aaz:aak', [Color.$, Defaults.be], 'HeatMaximum:y1:aal', [1, 50], 'HeatMinimumColor:aa0:aam', [Color.$, Defaults.bf], 'HeatMinimum:y2:aan', [1, 0], 'PointExtent:ze:aao', [1, 1], 'ProgressiveLoad:x6:aap', [0, true], 'UseBruteForce:x7:aaq', [0, false], 'XAxis:xq:aar', [NumericXAxis.$, null], 'XMemberAsLegendLabel:zq:aas', [2, null], 'XMemberAsLegendUnit:zs:aat', [2, null], 'XMemberPath:zu:aau', [2, null], 'YAxis:xs:aav', [NumericYAxis.$, null], 'YMemberAsLegendLabel:zy:aaw', [2, null], 'YMemberAsLegendUnit:z0:aax', [2, null], 'YMemberPath:z2:aay', [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.aa0 = Defaults.bf; this.cf.aaz = Defaults.be; this.cf.vz = Defaults.ba; this.cf.wf = Defaults.a9; } }; HighDensityScatterSeriesView.prototype.cq = function () { this.cf.aai(this.cd, this.cl, this.ck); }; HighDensityScatterSeriesView.prototype.cm = function () { if (this.ci == null) { this.ci = this.f.j8.createElement("canvas"); var a = this.f.j8.get2DCanvasContext(this.ci); this.cg = new RenderingContext(new CanvasViewRenderer(), a); } var b; if (this.s) { b = this.b9; } else { b = this.f.dc.yx(); } 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.aai(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.j8 != null) { this.f.j8.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.ge) { 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 };