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_fp() { return true; } jn() { if (!isNaN_(this.jm)) { return super.jn(); } return Defaults.ad; } constructor() { super(); this.xm = null; this.xo = null; this.yy = 0; this.xr = false; this.yd = Defaults.bf.o; this.yc = Defaults.bf.n; this.yb = Defaults.bf.m; this.ya = Defaults.bf.l; this.x9 = Defaults.be.o; this.x8 = Defaults.be.n; this.x7 = Defaults.be.m; this.x6 = Defaults.be.l; this.xe = null; this.xj = null; this.xk = null; this.xf = null; this.xh = null; this.xt = false; this.yz = 0; this.y1 = 0; this.yv = 0; this.yu = 0; this.progressiveLoadStatusChanged = null; this.xy = null; this.x4 = 0; this.x3 = 0; this.x5 = 0; this.yk = 0; this.yi = 0; this.yj = 0; this.yl = 0; this.yn = 0; this.yp = 0; this.yo = 0; this.ym = 0; this.x0 = 0; this.x1 = 0; this.x2 = 0; this.xz = 0; this.yx = 0; this.yw = 0; this.xb = null; this.y0 = 0; this.xs = false; this._itemIndexes = null; this.xc = null; this.w9 = null; this.xl = null; this.ab = HighDensityScatterSeries.$; this.f9 = false; } get_fx() { return true; } get xn() { return this.xm; } set xn(a) { if (this.xm != a) { let b = this.xn; this.xm = a; this.raisePropertyChanged("XColumn", b, this.xn); } } getDataLegendSeriesContextAt(a, b) { let c = { $type: Point_$type, x: a, y: b }; let d = this.kr(c); let e = d == null ? NaN : this.iz(d, "XMemberPath"); let f = d == null ? NaN : this.iz(d, "YMemberPath"); let g = new DataLegendSeriesValueInfo(); g.l = e; g.a = 13; g.q = "X"; g.r = this.zk != null ? this.zk : "X"; g.s = this.zg != null ? this.zg : "X:"; g.t = this.zi != null ? this.zi : ""; let h = new DataLegendSeriesValueInfo(); h.l = f; h.a = 14; h.q = "Y"; h.r = this.zs != null ? this.zs : "Y"; h.s = this.zo != null ? this.zo : "Y:"; h.t = this.zq != null ? this.zq : ""; let i = new DataLegendSeriesContext(); i.e = ((() => { let $ret = new List$1(DataLegendSeriesValueInfo.$, 0); $ret.add(g); $ret.add(h); return $ret; })()); i.h = this.mh(); return i; } ku(a, b) { let c = this.ni(b); if (c == HighDensityScatterSeries.$$p[10]) { return this.kv(a, b, this.zk); } if (c == HighDensityScatterSeries.$$p[14]) { return this.kv(a, b, this.zs); } return super.ku(a, b); } mi(a) { let b = this.ni(a); if (b == HighDensityScatterSeries.$$p[10]) { return this.zk; } if (b == HighDensityScatterSeries.$$p[14]) { return this.zs; } return super.mi(a); } get xp() { return this.xo; } set xp(a) { if (this.xo != a) { let b = this.xp; this.xo = a; this.raisePropertyChanged("YColumn", b, this.xp); } } z7() { if (this.xe == null) { return; } this.xe.t(); let a = this.xe; a.progressiveThunkCompleted = delegateRemove(a.progressiveThunkCompleted, runOn(this, this.zu)); this.xe = null; } rh(a, b, c, d) { super.rh(a, b, c, d); switch (b) { case HighDensityScatterSeries.$$p[8]: case HighDensityScatterSeries.$$p[12]: case HighDensityScatterSeries.$$p[9]: case HighDensityScatterSeries.$$p[13]: this.qm(); break; case "SeriesViewer": if (this.dc != null) { let e = this.getEffectiveViewport1(this.cw); this.xs = !e.isEmpty; } break; case "FastItemsSource": this.z7(); if (typeCast(IFastItemsSource_$type, c) != null) { c.deregisterColumn(this.xn); c.deregisterColumn(this.xp); this.xn = null; this.xp = null; } if (typeCast(IFastItemsSource_$type, d) != null) { this.xn = this.dl(this.zk); this.xp = this.dl(this.zs); } if ((this.xi != null && !this.xi.d2()) || (this.xg != null && !this.xg.d2())) { this.rz(this.gh && c != null); } this.qt(); break; case HighDensityScatterSeries.$$p[7]: let f = this.xf; this.xf = this.xg; this.z7(); if (f != null) { f.rangeChanged = delegateRemove(f.rangeChanged, runOn(this, this.zx)); } if (this.xf != null) { let g = this.xf; g.rangeChanged = delegateCombine(g.rangeChanged, runOn(this, this.zx)); } if (c != null) { c.cq(this); } if (d != null) { d.du(this); } if ((this.xg != null && !this.xg.d2()) || (d == null && c != null)) { this.rz(false); } break; case HighDensityScatterSeries.$$p[11]: let h = this.xh; this.xh = this.xi; this.z7(); if (h != null) { h.rangeChanged = delegateRemove(h.rangeChanged, runOn(this, this.zx)); } if (this.xh != null) { let i = this.xh; i.rangeChanged = delegateCombine(i.rangeChanged, runOn(this, this.zx)); } if (c != null) { c.cq(this); } if (d != null) { d.du(this); } if ((this.xi != null && !this.xi.d2()) || (d == null && c != null)) { this.rz(false); } break; case "MouseOverEnabled": this.xt = this.f9; this.rz(false); break; case HighDensityScatterSeries.$$p[10]: if (this.dp != null) { this.dp.deregisterColumn(this.xn); this.xn = this.dl(this.zk); } break; case "XColumn": this.z7(); if (this.xg != null && !this.xg.d2()) { this.rz(false); } this.qt(); break; case HighDensityScatterSeries.$$p[14]: if (this.dp != null) { this.dp.deregisterColumn(this.xp); this.xp = this.dl(this.zs); } break; case "YColumn": this.z7(); if (this.xi != null && !this.xi.d2()) { this.rz(false); } this.qt(); break; case HighDensityScatterSeries.$$p[6]: this.z7(); this.rz(false); this.qs(); break; case HighDensityScatterSeries.$$p[3]: this.rz(false); this.qs(); break; case HighDensityScatterSeries.$$p[1]: this.rz(false); this.qs(); break; case HighDensityScatterSeries.$$p[0]: case HighDensityScatterSeries.$$p[2]: if (!this.xd.ch(this.aaq, this.aap)) { return; } this.z1(); this.rz(false); this.qs(); break; case HighDensityScatterSeries.$$p[4]: this.yy = Math.max(typeGetValue(d) - 1, 0); this.xr = this.yy > 0; this.rz(false); this.qs(); break; case HighDensityScatterSeries.$$p[5]: this.rz(false); this.qs(); break; } } z1() { this.ya = this.aaq.l; this.yd = this.aaq.o; this.yc = this.aaq.n; this.yb = this.aaq.m; this.x6 = this.aap.l; this.x9 = this.aap.o; this.x8 = this.aap.n; this.x7 = this.aap.m; this.v6 = BrushUtil.j(truncate(this.ya), truncate(this.yd), truncate(this.yc), truncate(this.yb)); this.vq = BrushUtil.j(truncate(this.x6), truncate(this.x9), truncate(this.x8), truncate(this.x7)); } xv(a) { if (typeCast(NumericYAxis.$, a) !== null) { return true; } return false; } xu(a) { if (typeCast(NumericXAxis.$, a) !== null) { return true; } return false; } zx(a, b) { this.z7(); this.rz(false); } get yh() { return this.x9 - this.yd; } get yg() { return this.x8 - this.yc; } get yf() { return this.x7 - this.yb; } get ye() { return this.x6 - this.ya; } hf(a, b, c) { let d = super.hf(a, b, c); if (this.xi == null || this.xg == null || this.xg.b0 == null || this.xi.b0 == null || this.xp == null || this.xn == null || this.xp.count < 1 || this.xn.count < 1 || this.xp.count != this.xn.count || this.xg.pr == this.xg.pq || this.xi.pr == this.xi.pq || this.w3.isEmpty) { d = false; } return d; } get y5() { return this.yz; } set y5(a) { let b = this.yz; this.yz = a; this.raisePropertyChanged("ProgressiveStatus", b, this.yz); } r0(a) { super.r0(a); this.zz(a, this.cw); } xq() { if (TestRandomness.instance.testRandomnessSource != null) { return TestRandomness.instance.testRandomnessSource; } return new DefaultRandomnessSource(0); } zz(a, b) { if (this.d7(b)) { return; } if (this.xe == null && !this.xx) { let c = new List$1(KDPointData.$, 2, this.xn.count); let d = this.xg; let e = this.xi; 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.df); let i = new ScalerParams(1, f, g, e.df); let j; let k; for (let l = 0; l < this.xn.count; l++) { j = d.ft(this.xn.item(l), h); k = e.ft(this.xp.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.xw) { this.yu = 1; this.yv = truncate(logBase(c.count, 2)) + 3; this.y5 = truncate(((this.yu / this.yv) * 100)); if (this.progressiveLoadStatusChanged != null) { this.progressiveLoadStatusChanged(this, new ProgressiveLoadStatusEventArgs(this.y5)); } this.xe = KDTree2D.b(c.toArray(), 1, this.xq()); let m = this.xe; m.progressiveThunkCompleted = delegateCombine(m.progressiveThunkCompleted, runOn(this, this.zu)); if (!this.xe.h(this.j3)) { let n = this.xe; n.progressiveThunkCompleted = delegateRemove(n.progressiveThunkCompleted, runOn(this, this.zu)); } this.qs(); } else { let o = dateNow(); this.xe = new KDTree2D(0, c.toArray(), 1, this.xq()); let p = dateNow(); } } if (this.xw && !this.xx) { this.z0(b); } else { this.z2(b); } } ph(a, b, c, d) { super.ph(a, b, c, d); this.z7(); let e = false; if (this.xg != null && !this.xg.d2()) { e = true; } if (this.xi != null && !this.xi.d2()) { e = true; } if (e) { this.rz(false); } this.qt(); } zw(a) { let b = a; let c = this.yx * this.yw; if (this.xt) { 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; } } } } z2(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.xj = new ScalerParams(0, b, c, this.xf.df, g); this.xk = new ScalerParams(0, b, c, this.xh.df, g); this.zv(a); this.zw(a); let h = this.yx * this.yw; if (this.xc == null || this.xc.length != h) { this.xc = new Array(h); this.w9 = new Array(h); } let i = this.xc.length; let j = this.xc; let k = this.w9; for (let l = 0; l < i; l++) { j[l] = 0; k[l] = 0; } this.y1 = truncate(Math.round(this.ie)); this.xb = f.ce(); let m = this.xb.length; let n = this.xb; for (let o = 0; o < m; o++) { n[o] = 0; } let p = this.ys; let q = this.yr; if (isNaN_(p) || isInfinity(p)) { p = 0; } if (isNaN_(q) || isInfinity(q)) { q = 50; } this.x4 = Math.min(p, q); this.x3 = Math.max(p, q); if (this.x4 < 0) { this.x4 = 0; } if (this.x3 < 0) { this.x3 = 0; } this.x5 = this.x3 - this.x4; if (this.xx) { this.zy(a); } else { this.z9(a); } f.cp(); if (a.t) { this._itemIndexes = d; this.xd.cq(); } } z0(a) { if (this.xe == null) { return; } this.z2(a); } zu(a, b) { this.xd.co(() => { if (this.yu < this.yv - 1) { this.yu++; } this.y5 = truncate(((this.yu / this.yv) * 100)); if (this.progressiveLoadStatusChanged != null) { this.progressiveLoadStatusChanged(this, new ProgressiveLoadStatusEventArgs(this.y5)); } this.z0(this.cw); this.qs(); if (this.xe != null) { if (!this.xe.h(this.j3)) { let c = this.xe; c.progressiveThunkCompleted = delegateRemove(c.progressiveThunkCompleted, runOn(this, this.zu)); this.y5 = 100; if (this.progressiveLoadStatusChanged != null) { this.progressiveLoadStatusChanged(this, new ProgressiveLoadStatusEventArgs(this.y5)); } } } }); } zy(a) { let b = arrayShallowClone(this.xn.asArray()); this.xg.j6(boxArray$1(b), 0, b.length, this.xj); let c = arrayShallowClone(this.xp.asArray()); this.y0 = 0; let d = this.yy; let e = this.xr; let f = this.xc.length; this.xi.j6(boxArray$1(c), 0, c.length, this.xk); let g = 255 << 24 | truncate(this.yd) << 16 | truncate(this.yc) << 8 | truncate(this.yb); 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.yx || j < 0 || j >= this.yw) { continue; } if (e) { let k = i - d; let l = i + d; l = l > (this.yx - 1) ? (this.yx - 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.yx) + o; if (q < 0 || q > f - 1) { continue; } this.xc[q] = this.xc[q] + 1; this.w9[q] = 1; this.y0++; if (this.xt) { this._itemIndexes[q] = h + 1; } } } } else { let r = (j * this.yx) + i; this.xc[r] = this.xc[r] + 1; this.w9[r] = 1; this.y0++; if (this.xt) { this._itemIndexes[r] = h + 1; } } } this.z3(); } z9(a) { let b; let c; let d = a.getViewInfo(b, c); b = d.p0; c = d.p1; if (this.xe == null) { return; } if (this.xy == null) { this.xy = new List$1(KDTreeNode2D.$, 2, truncate(Math.round(b.width * b.height))); } else { this.xy.clear(); } let e = c.left; let f = c.right; let g = c.top; let h = c.bottom; this.yo = c.top; this.ym = c.height; this.yn = c.left; this.yp = c.width; this.yk = b.top; this.yi = b.height; this.yj = b.left; this.yl = b.width; let i = this.getEffectiveViewport1(a); this.x0 = (i.left - this.yj) / this.yl; this.x1 = (i.top - this.yk) / this.yi; let j = (i.right - this.yj) / this.yl; this.x2 = j - this.x0; let k = (i.bottom - this.yk) / this.yi; this.xz = k - this.x1; if (this.xs) { e = (e - this.x0) / this.x2; f = (f - this.x0) / this.x2; g = (g - this.x1) / this.xz; h = (h - this.x1) / this.xz; } let l = this.ie / b.width * c.width; let m = this.ie / 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.xe.u(this.xy, o, 0, 1, 0, 1); let p; this.y0 = 0; for (let q = 0; q < this.xy.count; q++) { p = this.xy._inner[q]; this.z4(p); } this.z3(); } z4(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.z6(a.b, d, b, a.e); if (c > 0 && !b) { let e; for (let f = 0; f < c; f++) { e = a.a[f]; this.z6(e, d, false, a.e); } } if (a.e != null) { a.e.a = false; } } ge(a) { let b = this.dc != null ? this.dc.xn : Rect.empty; let c = this.dc != null ? this.dc.x5 : Rect.empty; let d = new Rect(0, 0, 0, 1, 1); let e = this.ww(this.cw); let f = new ScalerParams(0, d, d, this.xg.df, e); let g = new ScalerParams(0, d, d, this.xi.df, e); let h = !b.isEmpty && !c.isEmpty && this.dp != null ? this.dp.indexOf(a) : -1; let i = this.xg != null && this.xn != null && h < this.xn.count ? this.xg.ft(this.xn.item(h), f) : NaN; let j = this.xi != null && this.xp != null && h < this.xp.count ? this.xi.ft(this.xp.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; } z6(a, b, c, d) { let e = this.y3(b); let f = a.c; let g = this.yy; if (c) { let h = d.d; let i = d.b; let j = d.e; let k = d.c; if (this.xs) { h = this.x0 + this.x2 * h; i = this.x0 + this.x2 * i; j = this.x1 + this.xz * j; k = this.x1 + this.xz * k; } let l = truncate((this.yj + this.yl * (h - this.yn) / this.yp)); let m = truncate((this.yj + this.yl * (i - this.yn) / this.yp)); let n = truncate((this.yk + this.yi * (j - this.yo) / this.ym)); let o = truncate((this.yk + this.yi * (k - this.yo) / this.ym)); l = truncate(Math.floor(l)); m = truncate(Math.floor(m)); n = truncate(Math.floor(n)); o = truncate(Math.floor(o)); if (this.xr) { 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.z5(f, s, t, q, r); } } } else { let u = a.a; let v = a.b; if (this.xs) { u = this.x0 + this.x2 * u; v = this.x1 + this.xz * v; } let w = truncate((this.yj + this.yl * (u - this.yn) / this.yp)); let x = truncate((this.yk + this.yi * (v - this.yo) / this.ym)); w = truncate(Math.floor(w)); x = truncate(Math.floor(x)); if (this.xr) { 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.z5(f, af, ag, ad, ae); } } } else { this.z5(f, w, x, b, 1); } } } y2(a, b) { return truncate((Math.floor(255 * b))) << 24 | truncate(Math.floor(b * (this.yd + a * this.yh))) << 16 | truncate(Math.floor(b * (this.yc + a * this.yg))) << 8 | truncate(Math.floor(b * (this.yb + a * this.yf))); } y3(a) { return 255 << 24 | truncate(Math.floor((this.yd + a * this.yh))) << 16 | truncate(Math.floor((this.yc + a * this.yg))) << 8 | truncate(Math.floor((this.yb + a * this.yf))); } yq(a) { return (a >> 24 & 255) / 255; } z5(a, b, c, d, e) { if (b < 0 || b >= this.yx || c < 0 || c >= this.yw) { return; } let f = (c * this.yx) + b; this.xc[f] = this.xc[f] + d; this.w9[f] = this.w9[f] + e; if (this.xt) { this._itemIndexes[f] = a + 1; } this.y0 += truncate(d); } z3() { let a = 0; let b = 0; let c = this.x5; let d = this.x4; let e = this.x3; let f = this.xc.length; let g = this.xc; let h = this.w9; let i = this.xb; 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.y2(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; } } zv(a) { let b = a; b.cm(); } ct() { return new HighDensityScatterSeriesView(this); } q8(a) { super.q8(a); this.xd = a; } ay(a) { if (a != null && a == this.xg && this.xn != null) { return new AxisRange(this.xn.minimum, this.xn.maximum); } if (a != null && a == this.xi && this.xp != null) { return new AxisRange(this.xp.minimum, this.xp.maximum); } return null; } sz(a, b) { if (this.dc != null) { let c = this.getEffectiveViewport1(this.cw); this.xs = !c.isEmpty; } this.rz(false); } s0(a, b) { this.rz(false); } kr(a) { if (!this.xt || this._itemIndexes == null || this.dc == null || this.dp == null || this._itemIndexes.length != (this.yx * this.yw)) { return null; } let b = this.dc.xn; let c = (a.x - b.left) / b.width; let d = (a.y - b.top) / b.height; let e = truncate(Math.round(this.w3.left + (this.w3.width * c))); let f = truncate(Math.round(this.w3.top + (this.w3.height * d))); let g = this.y6(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); } y6(a, b) { let c = (this.yx * b) + a; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } let d = 1; c = (this.yx * (b - d)) + a; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } c = (this.yx * (b + d)) + a; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } c = (this.yx * (b)) + a - 1; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } c = (this.yx * (b)) + a + 1; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } c = (this.yx * (b - d)) + a - 1; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } c = (this.yx * (b + d)) + a + 1; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } c = (this.yx * (b - d)) + a + 1; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } c = (this.yx * (b + d)) + a - 1; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } return 0; } z8(a, b, c) { this.xb = a; this.yx = b; this.yw = c; } get_g8() { return true; } set_g8(a) { super.set_g8(a); } pb(a, b) { super.pb(a, b); this.xd.cn(); if (this.cv != null) { this.cv.cn(); } this.qs(); } r1(a, b) { super.r1(a, b); if (!this.g1) { 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.zz(false, c); this.g1 = false; } ry(a, b, c, d, e) { super.ry(a, b, c, d, e); let f = this.ba.a$j.item(d); let g = f; f.bd(c); if (this.d7(g)) { return; } if (this.xl == null) { this.xl = new ScatterFrame(); } this.zz(false, f); } o8() { super.o8(); this.xg = null; this.xi = null; } } HighDensityScatterSeries.$t = /*@__PURE__*/ markType(HighDensityScatterSeries, 'HighDensityScatterSeries', Series.$); HighDensityScatterSeries.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, HighDensityScatterSeries, 'raisePropertyChanged', ['HeatMaximumColor:aap:aaa', [Color.$, Defaults.be], 'HeatMaximum:yr:aab', [1, 50], 'HeatMinimumColor:aaq:aac', [Color.$, Defaults.bf], 'HeatMinimum:ys:aad', [1, 0], 'PointExtent:y4:aae', [1, 1], 'ProgressiveLoad:xw:aaf', [0, true], 'UseBruteForce:xx:aag', [0, false], 'XAxis:xg:aah', [NumericXAxis.$, null], 'XMemberAsLegendLabel:zg:aai', [2, null], 'XMemberAsLegendUnit:zi:aaj', [2, null], 'XMemberPath:zk:aak', [2, null], 'YAxis:xi:aal', [NumericYAxis.$, null], 'YMemberAsLegendLabel:zo:aam', [2, null], 'YMemberAsLegendUnit:zq:aan', [2, null], 'YMemberPath:zs:aao', [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.aaq = Defaults.bf; this.cf.aap = Defaults.be; this.cf.vq = Defaults.ba; this.cf.v6 = Defaults.a9; } } cq() { this.cf.z8(this.cd, this.cl, this.ck); } cm() { if (this.ci == null) { this.ci = this.f.j3.createElement("canvas"); let a = this.f.j3.get2DCanvasContext(this.ci); this.cg = new RenderingContext(new CanvasViewRenderer(), a); } let b; if (this.s) { b = this.b9; } else { b = this.f.dc.xt(); } 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.z8(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.j3 != null) { this.f.j3.setTimeout(a, 0); } else { window.setTimeout(a, 0); } } bj(a, b) { super.bj(a, b); if (b) { if (!this.cf.f9) { 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; })();