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_fs() { return true; } jt() { if (!isNaN_(this.js)) { return super.jt(); } return Defaults.ad; } constructor() { super(); 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; } get_f0() { return true; } get xy() { return this.xx; } set xy(a) { if (this.xx != a) { let b = this.xy; this.xx = a; this.raisePropertyChanged("XColumn", b, this.xy); } } getDataLegendSeriesContextAt(a, b) { let c = { $type: Point_$type, x: a, y: b }; let d = this.kx(c); let e = d == null ? NaN : this.i5(d, "XMemberPath"); let f = d == null ? NaN : this.i5(d, "YMemberPath"); let 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 : ""; let 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 : ""; let i = new DataLegendSeriesContext(); i.e = ((() => { let $ret = new List$1(DataLegendSeriesValueInfo.$, 0); $ret.add(g); $ret.add(h); return $ret; })()); i.h = this.mo(); return i; } k0(a, b) { let 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.k0(a, b); } mp(a) { let b = this.np(a); if (b == HighDensityScatterSeries.$$p[10]) { return this.zv; } if (b == HighDensityScatterSeries.$$p[14]) { return this.z3; } return super.mp(a); } get x0() { return this.xz; } set x0(a) { if (this.xz != a) { let b = this.x0; this.xz = a; this.raisePropertyChanged("YColumn", b, this.x0); } } aai() { if (this.xp == null) { return; } this.xp.t(); let a = this.xp; a.progressiveThunkCompleted = delegateRemove(a.progressiveThunkCompleted, runOn(this, this.z5)); this.xp = null; } rr(a, b, c, d) { super.rr(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) { let 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]: let 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) { let 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]: let 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) { let 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; } } aac() { 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)); } x6(a) { if (typeCast(NumericYAxis.$, a) !== null) { return true; } return false; } x5(a) { if (typeCast(NumericXAxis.$, a) !== null) { return true; } return false; } z8(a, b) { this.aai(); this.r9(false); } get ys() { return this.yk - this.yo; } get yr() { return this.yj - this.yn; } get yq() { return this.yi - this.ym; } get yp() { return this.yh - this.yl; } hl(a, b, c) { let d = super.hl(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; } get zg() { return this.za; } set zg(a) { let b = this.za; this.za = a; this.raisePropertyChanged("ProgressiveStatus", b, this.za); } sa(a) { super.sa(a); this.aaa(a, this.cw); } x1() { if (TestRandomness.instance.testRandomnessSource != null) { return TestRandomness.instance.testRandomnessSource; } return new DefaultRandomnessSource(0); } aaa(a, b) { if (this.d7(b)) { return; } if (this.xp == null && !this.x8) { let c = new List$1(KDPointData.$, 2, this.xy.count); let d = this.xr; let e = this.xt; 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.xy.count; l++) { j = d.f7(this.xy.item(l), h); k = e.f7(this.x0.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.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()); let m = this.xp; m.progressiveThunkCompleted = delegateCombine(m.progressiveThunkCompleted, runOn(this, this.z5)); if (!this.xp.h(this.j9)) { let n = this.xp; n.progressiveThunkCompleted = delegateRemove(n.progressiveThunkCompleted, runOn(this, this.z5)); } this.q1(); } else { let o = dateNow(); this.xp = new KDTree2D(0, c.toArray(), 1, this.x1()); let p = dateNow(); } } if (this.x7 && !this.x8) { this.aab(b); } else { this.aad(b); } } pp(a, b, c, d) { super.pp(a, b, c, d); this.aai(); let 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(); } z7(a) { let b = a; let c = this.y8 * this.y7; if (this.x4) { 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; } } } } aad(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.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); let h = this.y8 * this.y7; if (this.xn == null || this.xn.length != h) { this.xn = new Array(h); this.xk = new Array(h); } let i = this.xn.length; let j = this.xn; let k = this.xk; for (let l = 0; l < i; l++) { j[l] = 0; k[l] = 0; } this.zc = truncate(Math.round(this.il)); this.xm = f.ce(); let m = this.xm.length; let n = this.xm; for (let o = 0; o < m; o++) { n[o] = 0; } let p = this.y3; let 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(); } } aab(a) { if (this.xp == null) { return; } this.aad(a); } z5(a, b) { this.xo.co(() => { 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)) { let 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)); } } } }); } z9(a) { let b = arrayShallowClone(this.xy.asArray()); this.xr.k3(boxArray$1(b), 0, b.length, this.xu); let c = arrayShallowClone(this.x0.asArray()); this.zb = 0; let d = this.y9; let e = this.x2; let f = this.xn.length; this.xt.k3(boxArray$1(c), 0, c.length, this.xv); let g = 255 << 24 | truncate(this.yo) << 16 | truncate(this.yn) << 8 | truncate(this.ym); 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.y8 || j < 0 || j >= this.y7) { continue; } if (e) { let k = i - d; let l = i + d; l = l > (this.y8 - 1) ? (this.y8 - 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.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 { let 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(); } aak(a) { let b; let c; let 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(); } let e = c.left; let f = c.right; let g = c.top; let 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; let i = this.getEffectiveViewport1(a); this.yb = (i.left - this.yu) / this.yw; this.yc = (i.top - this.yv) / this.yt; let j = (i.right - this.yu) / this.yw; this.yd = j - this.yb; let 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; } let l = this.il / b.width * c.width; let m = this.il / 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.xp.u(this.x9, o, 0, 1, 0, 1); let p; this.zb = 0; for (let q = 0; q < this.x9.count; q++) { p = this.x9._inner[q]; this.aaf(p); } this.aae(); } aaf(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.aah(a.b, d, b, a.e); if (c > 0 && !b) { let e; for (let f = 0; f < c; f++) { e = a.a[f]; this.aah(e, d, false, a.e); } } if (a.e != null) { a.e.a = false; } } gk(a) { let b = this.dc != null ? this.dc.ys : Rect.empty; let c = this.dc != null ? this.dc.za : Rect.empty; let d = new Rect(0, 0, 0, 1, 1); let e = this.w7(this.cw); let f = new ScalerParams(0, d, d, this.xr.dn, e); let g = new ScalerParams(0, d, d, this.xt.dn, e); let h = !b.isEmpty && !c.isEmpty && this.dp != null ? this.dp.indexOf(a) : -1; let i = this.xr != null && this.xy != null && h < this.xy.count ? this.xr.f7(this.xy.item(h), f) : NaN; let 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; } aah(a, b, c, d) { let e = this.ze(b); let f = a.c; let g = this.y9; if (c) { let h = d.d; let i = d.b; let j = d.e; let 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; } let l = truncate((this.yu + this.yw * (h - this.yy) / this.y0)); let m = truncate((this.yu + this.yw * (i - this.yy) / this.y0)); let n = truncate((this.yv + this.yt * (j - this.yz) / this.yx)); let 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; } 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.aag(f, s, t, q, r); } } } else { let u = a.a; let v = a.b; if (this.x3) { u = this.yb + this.yd * u; v = this.yc + this.ya * v; } let w = truncate((this.yu + this.yw * (u - this.yy) / this.y0)); let x = truncate((this.yv + this.yt * (v - this.yz) / this.yx)); w = truncate(Math.floor(w)); x = truncate(Math.floor(x)); if (this.x2) { 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.aag(f, af, ag, ad, ae); } } } else { this.aag(f, w, x, b, 1); } } } zd(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))); } ze(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))); } y1(a) { return (a >> 24 & 255) / 255; } aag(a, b, c, d, e) { if (b < 0 || b >= this.y8 || c < 0 || c >= this.y7) { return; } let 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); } aae() { let a = 0; let b = 0; let c = this.yg; let d = this.yf; let e = this.ye; let f = this.xn.length; let g = this.xn; let h = this.xk; let i = this.xm; 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.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; } } z6(a) { let b = a; b.cm(); } ct() { return new HighDensityScatterSeriesView(this); } ri(a) { super.ri(a); this.xo = a; } ay(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; } s9(a, b) { if (this.dc != null) { let c = this.getEffectiveViewport1(this.cw); this.x3 = !c.isEmpty; } this.r9(false); } ta(a, b) { this.r9(false); } kx(a) { if (!this.x4 || this._itemIndexes == null || this.dc == null || this.dp == null || this._itemIndexes.length != (this.y8 * this.y7)) { return null; } let b = this.dc.ys; let c = (a.x - b.left) / b.width; let d = (a.y - b.top) / b.height; let e = truncate(Math.round(this.xe.left + (this.xe.width * c))); let f = truncate(Math.round(this.xe.top + (this.xe.height * d))); let g = this.zh(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); } zh(a, b) { let c = (this.y8 * b) + a; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } let 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; } aaj(a, b, c) { this.xm = a; this.y8 = b; this.y7 = c; } get_he() { return true; } set_he(a) { super.set_he(a); } pj(a, b) { super.pj(a, b); this.xo.cn(); if (this.cv != null) { this.cv.cn(); } this.q1(); } sb(a, b) { super.sb(a, b); if (!this.g7) { 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.aaa(false, c); this.g7 = false; } r8(a, b, c, d, e) { super.r8(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.xw == null) { this.xw = new ScatterFrame(); } this.aaa(false, f); } pg() { super.pg(); this.xr = null; this.xt = null; } } HighDensityScatterSeries.$t = /*@__PURE__*/ markType(HighDensityScatterSeries, 'HighDensityScatterSeries', Series.$); HighDensityScatterSeries.$$p = /*@__PURE__*/ 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; })(); /** * @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.aa1 = Defaults.bf; this.cf.aa0 = Defaults.be; this.cf.v0 = Defaults.ba; this.cf.wg = Defaults.a9; } } cq() { this.cf.aaj(this.cd, this.cl, this.ck); } cm() { if (this.ci == null) { this.ci = this.f.j9.createElement("canvas"); let a = this.f.j9.get2DCanvasContext(this.ci); this.cg = new RenderingContext(new CanvasViewRenderer(), a); } let b; if (this.s) { b = this.b9; } else { b = this.f.dc.yy(); } 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.aaj(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.j9 != null) { this.f.j9.setTimeout(a, 0); } else { window.setTimeout(a, 0); } } bj(a, b) { super.bj(a, b); if (b) { if (!this.cf.gf) { 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; })();