UNPKG

igniteui-react-charts

Version:

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

1,158 lines (1,157 loc) 41.8 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 { 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 */ export let HighDensityScatterSeries = /*@__PURE__*/ (() => { class HighDensityScatterSeries extends Series { bk() { return new HighDensityScatterSeries(); } get_fr() { return true; } js() { if (!isNaN_(this.jr)) { return super.js(); } return Defaults.ad; } constructor() { super(); 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; } get_fz() { return true; } get xx() { return this.xw; } set xx(a) { if (this.xw != a) { let b = this.xx; this.xw = a; this.raisePropertyChanged("XColumn", b, this.xx); } } getDataLegendSeriesContextAt(a, b) { let c = { $type: Point_$type, x: a, y: b }; let d = this.kw(c); let e = d == null ? NaN : this.i4(d, "XMemberPath"); let f = d == null ? NaN : this.i4(d, "YMemberPath"); let 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 : ""; let 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 : ""; let i = new DataLegendSeriesContext(); i.e = ((() => { let $ret = new List$1(DataLegendSeriesValueInfo.$, 0); $ret.add(g); $ret.add(h); return $ret; })()); i.h = this.mn(); return i; } kz(a, b) { let 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.kz(a, b); } mo(a) { let b = this.no(a); if (b == HighDensityScatterSeries.$$p[10]) { return this.zu; } if (b == HighDensityScatterSeries.$$p[14]) { return this.z2; } return super.mo(a); } get xz() { return this.xy; } set xz(a) { if (this.xy != a) { let b = this.xz; this.xy = a; this.raisePropertyChanged("YColumn", b, this.xz); } } aah() { if (this.xo == null) { return; } this.xo.t(); let a = this.xo; a.progressiveThunkCompleted = delegateRemove(a.progressiveThunkCompleted, runOn(this, this.z4)); this.xo = null; } rq(a, b, c, d) { super.rq(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) { let 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]: let 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) { let 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]: let 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) { let 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; } } aab() { 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)); } x5(a) { if (typeCast(NumericYAxis.$, a) !== null) { return true; } return false; } x4(a) { if (typeCast(NumericXAxis.$, a) !== null) { return true; } return false; } z7(a, b) { this.aah(); this.r8(false); } get yr() { return this.yj - this.yn; } get yq() { return this.yi - this.ym; } get yp() { return this.yh - this.yl; } get yo() { return this.yg - this.yk; } hk(a, b, c) { let d = super.hk(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; } get zf() { return this.y9; } set zf(a) { let b = this.y9; this.y9 = a; this.raisePropertyChanged("ProgressiveStatus", b, this.y9); } r9(a) { super.r9(a); this.z9(a, this.cw); } x0() { if (TestRandomness.instance.testRandomnessSource != null) { return TestRandomness.instance.testRandomnessSource; } return new DefaultRandomnessSource(0); } z9(a, b) { if (this.d7(b)) { return; } if (this.xo == null && !this.x7) { let c = new List$1(KDPointData.$, 2, this.xx.count); let d = this.xq; let e = this.xs; let f = new Rect(0, 0, 0, 1, 1); let g = new Rect(0, 0, 0, 1, 1); let h = new ScalerParams(1, f, g, d.dn); let i = new ScalerParams(1, f, g, e.dn); let j; let k; for (let l = 0; l < this.xx.count; l++) { j = d.f6(this.xx.item(l), h); k = e.f6(this.xz.item(l), i); if (!isNaN_(j) && !isNaN_(k) && !isInfinity(j) && !isInfinity(k)) { c.add(((() => { let $ret = new KDPointData(); $ret.a = j; $ret.b = k; $ret.c = l; return $ret; })())); } } 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()); let m = this.xo; m.progressiveThunkCompleted = delegateCombine(m.progressiveThunkCompleted, runOn(this, this.z4)); if (!this.xo.h(this.j8)) { let n = this.xo; n.progressiveThunkCompleted = delegateRemove(n.progressiveThunkCompleted, runOn(this, this.z4)); } this.q0(); } else { let o = dateNow(); this.xo = new KDTree2D(0, c.toArray(), 1, this.x0()); let p = dateNow(); } } if (this.x6 && !this.x7) { this.aaa(b); } else { this.aac(b); } } po(a, b, c, d) { super.po(a, b, c, d); this.aah(); let 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(); } z6(a) { let b = a; let c = this.y7 * this.y6; if (this.x3) { if (this._itemIndexes == null || this._itemIndexes.length != c) { this._itemIndexes = new Array(c); for (let d = 0; d < c; d++) { this._itemIndexes[d] = 0; } } else { for (let e = 0; e < c; e++) { this._itemIndexes[e] = 0; } } } } aac(a) { let b; let c; let d = null; if (a.t) { d = this._itemIndexes; } let e = a.getViewInfo(c, b); c = e.p0; b = e.p1; let f = a; let 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); let h = this.y7 * this.y6; if (this.xm == null || this.xm.length != h) { this.xm = new Array(h); this.xj = new Array(h); } let i = this.xm.length; let j = this.xm; let k = this.xj; for (let l = 0; l < i; l++) { j[l] = 0; k[l] = 0; } this.zb = truncate(Math.round(this.ik)); this.xl = f.ce(); let m = this.xl.length; let n = this.xl; for (let o = 0; o < m; o++) { n[o] = 0; } let p = this.y2; let 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(); } } aaa(a) { if (this.xo == null) { return; } this.aac(a); } z4(a, b) { this.xn.co(() => { 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)) { let 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)); } } } }); } z8(a) { let b = arrayShallowClone(this.xx.asArray()); this.xq.k1(boxArray$1(b), 0, b.length, this.xt); let c = arrayShallowClone(this.xz.asArray()); this.za = 0; let d = this.y8; let e = this.x1; let f = this.xm.length; this.xs.k1(boxArray$1(c), 0, c.length, this.xu); let g = 255 << 24 | truncate(this.yn) << 16 | truncate(this.ym) << 8 | truncate(this.yl); for (let h = 0; h < b.length; h++) { let i = truncate(b[h]); let 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) { let k = i - d; let l = i + d; l = l > (this.y7 - 1) ? (this.y7 - 1) : l; k = k < 0 ? 0 : k; let m = j + d; let n = j - d; for (let o = k; o <= l; o++) { for (let p = n; p <= m; p++) { let 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 { let 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(); } aaj(a) { let b; let c; let 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(); } let e = c.left; let f = c.right; let g = c.top; let 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; let i = this.getEffectiveViewport1(a); this.ya = (i.left - this.yt) / this.yv; this.yb = (i.top - this.yu) / this.ys; let j = (i.right - this.yt) / this.yv; this.yc = j - this.ya; let 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; } let l = this.ik / b.width * c.width; let m = this.ik / b.height * c.height; let n = Math.min(l, m); let o = ((() => { let $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); let p; this.za = 0; for (let q = 0; q < this.x8.count; q++) { p = this.x8._inner[q]; this.aae(p); } this.aad(); } aae(a) { if (a.g) { return; } let b = a.e != null && a.e.a; let c = a.a == null ? 0 : a.a.length; let d = (a.h - c) + 1; if (b && d > 0) { } else { d = 1; } this.aag(a.b, d, b, a.e); if (c > 0 && !b) { let e; for (let f = 0; f < c; f++) { e = a.a[f]; this.aag(e, d, false, a.e); } } if (a.e != null) { a.e.a = false; } } gj(a) { let b = this.dc != null ? this.dc.yr : Rect.empty; let c = this.dc != null ? this.dc.y9 : Rect.empty; let d = new Rect(0, 0, 0, 1, 1); let e = this.w6(this.cw); let f = new ScalerParams(0, d, d, this.xq.dn, e); let g = new ScalerParams(0, d, d, this.xs.dn, e); let h = !b.isEmpty && !c.isEmpty && this.dp != null ? this.dp.indexOf(a) : -1; let i = this.xq != null && this.xx != null && h < this.xx.count ? this.xq.f6(this.xx.item(h), f) : NaN; let 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; } aag(a, b, c, d) { let e = this.zd(b); let f = a.c; let g = this.y8; if (c) { let h = d.d; let i = d.b; let j = d.e; let 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; } let l = truncate((this.yt + this.yv * (h - this.yx) / this.yz)); let m = truncate((this.yt + this.yv * (i - this.yx) / this.yz)); let n = truncate((this.yu + this.ys * (j - this.yy) / this.yw)); let 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; } let p = ((m - l) + 1) * ((o - n) + 1); let q = b / p; let r = q; for (let s = l; s <= m; s++) { for (let t = n; t <= o; t++) { this.aaf(f, s, t, q, r); } } } else { let u = a.a; let v = a.b; if (this.x2) { u = this.ya + this.yc * u; v = this.yb + this.x9 * v; } let w = truncate((this.yt + this.yv * (u - this.yx) / this.yz)); let x = truncate((this.yu + this.ys * (v - this.yy) / this.yw)); w = truncate(Math.floor(w)); x = truncate(Math.floor(x)); if (this.x1) { let y = w - g; let z = w + g; let aa = x + g; let ab = x - g; let ac = ((z - y) + 1) * ((aa - ab) + 1); let ad = b / ac; let ae = ad; for (let af = y; af <= z; af++) { for (let ag = ab; ag <= aa; ag++) { this.aaf(f, af, ag, ad, ae); } } } else { this.aaf(f, w, x, b, 1); } } } zc(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))); } zd(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))); } y0(a) { return (a >> 24 & 255) / 255; } aaf(a, b, c, d, e) { if (b < 0 || b >= this.y7 || c < 0 || c >= this.y6) { return; } let 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); } aad() { let a = 0; let b = 0; let c = this.yf; let d = this.ye; let e = this.yd; let f = this.xm.length; let g = this.xm; let h = this.xj; let i = this.xl; let j = NaN; let k = NaN; let l = 0; let m = 0; for (let 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; } } z5(a) { let b = a; b.cm(); } ct() { return new HighDensityScatterSeriesView(this); } rh(a) { super.rh(a); this.xn = a; } ay(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; } s8(a, b) { if (this.dc != null) { let c = this.getEffectiveViewport1(this.cw); this.x2 = !c.isEmpty; } this.r8(false); } s9(a, b) { this.r8(false); } kw(a) { if (!this.x3 || this._itemIndexes == null || this.dc == null || this.dp == null || this._itemIndexes.length != (this.y7 * this.y6)) { return null; } let b = this.dc.yr; let c = (a.x - b.left) / b.width; let d = (a.y - b.top) / b.height; let e = truncate(Math.round(this.xd.left + (this.xd.width * c))); let f = truncate(Math.round(this.xd.top + (this.xd.height * d))); let g = this.zg(e, f); if (g < 0 || g > this._itemIndexes.length - 1) { return null; } let h = this._itemIndexes[g] - 1; if (h < 0 || h > this.dp.count) { return null; } return this.dp.item(h); } zg(a, b) { let c = (this.y7 * b) + a; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } let 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; } aai(a, b, c) { this.xl = a; this.y7 = b; this.y6 = c; } get_hd() { return true; } set_hd(a) { super.set_hd(a); } pi(a, b) { super.pi(a, b); this.xn.cn(); if (this.cv != null) { this.cv.cn(); } this.q0(); } sa(a, b) { super.sa(a, b); if (!this.g6) { this.cw.be(b); return; } this.cw.be(b); if (this.d7(this.cv)) { return; } let c = typeCast(HighDensityScatterSeriesView.$, this.cv); let d = new ScatterFrame(); this.z9(false, c); this.g6 = false; } r7(a, b, c, d, e) { super.r7(a, b, c, d, e); let f = this.ba.a$k.item(d); let g = f; f.bd(c); if (this.d7(g)) { return; } if (this.xv == null) { this.xv = new ScatterFrame(); } this.z9(false, f); } pf() { super.pf(); this.xq = null; this.xs = null; } } HighDensityScatterSeries.$t = /*@__PURE__*/ markType(HighDensityScatterSeries, 'HighDensityScatterSeries', Series.$); HighDensityScatterSeries.$$p = /*@__PURE__*/ 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; })(); /** * @hidden */ export let HighDensityScatterSeriesView = /*@__PURE__*/ (() => { class HighDensityScatterSeriesView extends SeriesView { constructor(a) { super(a); this.cf = null; this.cd = null; this.cl = 0; this.ck = 0; this.ci = null; this.cj = null; this.cg = null; this.cf = a; } a4() { super.a4(); if (!this.t) { this.cf.aa0 = Defaults.bf; this.cf.aaz = Defaults.be; this.cf.vz = Defaults.ba; this.cf.wf = Defaults.a9; } } cq() { this.cf.aai(this.cd, this.cl, this.ck); } cm() { if (this.ci == null) { this.ci = this.f.j8.createElement("canvas"); let a = this.f.j8.get2DCanvasContext(this.ci); this.cg = new RenderingContext(new CanvasViewRenderer(), a); } let b; if (this.s) { b = this.b9; } else { b = this.f.dc.yx(); } let c = truncate(Math.round(b.left)); let d = truncate(Math.round(b.top)); let e = truncate(Math.round(b.width)); let f = truncate(Math.round(b.height)); let g = this.cl; let 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); let imageDataArray_ = this.cj.data; this.cd = imageDataArray_; } this.cf.aai(this.cd, this.cl, this.ck); } ce() { return this.cd; } cp() { let a = truncate(Math.round(this.b9.left)); let b = truncate(Math.round(this.b9.left)); let c = truncate(Math.round(this.b9.width)); let d = truncate(Math.round(this.b9.height)); this.cg.h().putImageData(this.cj, 0, 0); this.a2(); } co(a) { if (this.f.j8 != null) { this.f.j8.setTimeout(a, 0); } else { window.setTimeout(a, 0); } } bj(a, b) { super.bj(a, b); if (b) { if (!this.cf.ge) { return; } let 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; } let d = truncate(Math.round(this.b9.left)); let e = truncate(Math.round(this.b9.top)); let f = truncate(Math.round(this.b9.width)); let g = truncate(Math.round(this.b9.height)); this.m.o(this.ci.getNativeElement(), this.f._opacity, d, e, f, g, d, e, f, g); } ch(a, b) { return Color.e(toNullable(Color.$, a), toNullable(Color.$, null)) && Color.e(toNullable(Color.$, b), toNullable(Color.$, null)); } cn() { if (this.cd != null) { for (let a = 0; a < this.cd.length; a++) { this.cd[a] = 0; } this.cp(); } } ax(a) { super.ax(a); if (this.cd == null) { this.f.bc.exportSeriesPixelsData(a, null, this.cl, this.ck); return; } let b = new Array(intDivide(this.cd.length, 4)); let c; for (let 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 = /*@__PURE__*/ markType(HighDensityScatterSeriesView, 'HighDensityScatterSeriesView', SeriesView.$); return HighDensityScatterSeriesView; })();