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_fo() { return true; } jk() { if (!isNaN_(this.jj)) { return super.jk(); } return Defaults.q; } constructor() { super(); this.xd = null; this.xf = null; this.yp = 0; this.xi = false; this.x4 = Defaults.aq.o; this.x3 = Defaults.aq.n; this.x2 = Defaults.aq.m; this.x1 = Defaults.aq.l; this.x0 = Defaults.ap.o; this.xz = Defaults.ap.n; this.xy = Defaults.ap.m; this.xx = Defaults.ap.l; this.w5 = null; this.xa = null; this.xb = null; this.w6 = null; this.w8 = null; this.xk = false; this.yq = 0; this.ys = 0; this.ym = 0; this.yl = 0; this.progressiveLoadStatusChanged = null; this.xp = null; this.xv = 0; this.xu = 0; this.xw = 0; this.yb = 0; this.x9 = 0; this.ya = 0; this.yc = 0; this.ye = 0; this.yg = 0; this.yf = 0; this.yd = 0; this.xr = 0; this.xs = 0; this.xt = 0; this.xq = 0; this.yo = 0; this.yn = 0; this.w2 = null; this.yr = 0; this.xj = false; this._itemIndexes = null; this.w3 = null; this.w0 = null; this.xc = null; this.ab = HighDensityScatterSeries.$; this.f8 = false; } get_fw() { return true; } get xe() { return this.xd; } set xe(a) { if (this.xd != a) { let b = this.xe; this.xd = a; this.raisePropertyChanged("XColumn", b, this.xe); } } getDataLegendSeriesContextAt(a, b) { let c = { $type: Point_$type, x: a, y: b }; let d = this.kn(c); let e = d == null ? NaN : this.ix(d, "XMemberPath"); let f = d == null ? NaN : this.ix(d, "YMemberPath"); let g = new DataLegendSeriesValueInfo(); g.l = e; g.a = 13; g.q = "X"; g.r = this.zb != null ? this.zb : "X"; g.s = this.y7 != null ? this.y7 : "X:"; g.t = this.y9 != null ? this.y9 : ""; let h = new DataLegendSeriesValueInfo(); h.l = f; h.a = 14; h.q = "Y"; h.r = this.zj != null ? this.zj : "Y"; h.s = this.zf != null ? this.zf : "Y:"; h.t = this.zh != null ? this.zh : ""; let i = new DataLegendSeriesContext(); i.e = ((() => { let $ret = new List$1(DataLegendSeriesValueInfo.$, 0); $ret.add(g); $ret.add(h); return $ret; })()); i.h = this.mc(); return i; } kq(a, b) { let c = this.nd(b); if (c == HighDensityScatterSeries.$$p[10]) { return this.kr(a, b, this.zb); } if (c == HighDensityScatterSeries.$$p[14]) { return this.kr(a, b, this.zj); } return super.kq(a, b); } md(a) { let b = this.nd(a); if (b == HighDensityScatterSeries.$$p[10]) { return this.zb; } if (b == HighDensityScatterSeries.$$p[14]) { return this.zj; } return super.md(a); } get xg() { return this.xf; } set xg(a) { if (this.xf != a) { let b = this.xg; this.xf = a; this.raisePropertyChanged("YColumn", b, this.xg); } } zy() { if (this.w5 == null) { return; } this.w5.t(); let a = this.w5; a.progressiveThunkCompleted = delegateRemove(a.progressiveThunkCompleted, runOn(this, this.zl)); this.w5 = null; } ra(a, b, c, d) { super.ra(a, b, c, d); switch (b) { case HighDensityScatterSeries.$$p[8]: case HighDensityScatterSeries.$$p[12]: case HighDensityScatterSeries.$$p[9]: case HighDensityScatterSeries.$$p[13]: this.qf(); break; case "SeriesViewer": if (this.dc != null) { let e = this.getEffectiveViewport1(this.cw); this.xj = !e.isEmpty; } break; case "FastItemsSource": this.zy(); if (typeCast(IFastItemsSource_$type, c) != null) { c.deregisterColumn(this.xe); c.deregisterColumn(this.xg); this.xe = null; this.xg = null; } if (typeCast(IFastItemsSource_$type, d) != null) { this.xe = this.dl(this.zb); this.xg = this.dl(this.zj); } if ((this.w9 != null && !this.w9.c1()) || (this.w7 != null && !this.w7.c1())) { this.rs(this.gg && c != null); } this.qm(); break; case HighDensityScatterSeries.$$p[7]: let f = this.w6; this.w6 = this.w7; this.zy(); if (f != null) { f.rangeChanged = delegateRemove(f.rangeChanged, runOn(this, this.zo)); } if (this.w6 != null) { let g = this.w6; g.rangeChanged = delegateCombine(g.rangeChanged, runOn(this, this.zo)); } if (c != null) { c.b0(this); } if (d != null) { d.ct(this); } if ((this.w7 != null && !this.w7.c1()) || (d == null && c != null)) { this.rs(false); } break; case HighDensityScatterSeries.$$p[11]: let h = this.w8; this.w8 = this.w9; this.zy(); if (h != null) { h.rangeChanged = delegateRemove(h.rangeChanged, runOn(this, this.zo)); } if (this.w8 != null) { let i = this.w8; i.rangeChanged = delegateCombine(i.rangeChanged, runOn(this, this.zo)); } if (c != null) { c.b0(this); } if (d != null) { d.ct(this); } if ((this.w9 != null && !this.w9.c1()) || (d == null && c != null)) { this.rs(false); } break; case "MouseOverEnabled": this.xk = this.f8; this.rs(false); break; case HighDensityScatterSeries.$$p[10]: if (this.dp != null) { this.dp.deregisterColumn(this.xe); this.xe = this.dl(this.zb); } break; case "XColumn": this.zy(); if (this.w7 != null && !this.w7.c1()) { this.rs(false); } this.qm(); break; case HighDensityScatterSeries.$$p[14]: if (this.dp != null) { this.dp.deregisterColumn(this.xg); this.xg = this.dl(this.zj); } break; case "YColumn": this.zy(); if (this.w9 != null && !this.w9.c1()) { this.rs(false); } this.qm(); break; case HighDensityScatterSeries.$$p[6]: this.zy(); this.rs(false); this.ql(); break; case HighDensityScatterSeries.$$p[3]: this.rs(false); this.ql(); break; case HighDensityScatterSeries.$$p[1]: this.rs(false); this.ql(); break; case HighDensityScatterSeries.$$p[0]: case HighDensityScatterSeries.$$p[2]: if (!this.w4.b8(this.aah, this.aag)) { return; } this.zs(); this.rs(false); this.ql(); break; case HighDensityScatterSeries.$$p[4]: this.yp = Math.max(typeGetValue(d) - 1, 0); this.xi = this.yp > 0; this.rs(false); this.ql(); break; case HighDensityScatterSeries.$$p[5]: this.rs(false); this.ql(); break; } } zs() { this.x1 = this.aah.l; this.x4 = this.aah.o; this.x3 = this.aah.n; this.x2 = this.aah.m; this.xx = this.aag.l; this.x0 = this.aag.o; this.xz = this.aag.n; this.xy = this.aag.m; this.vx = BrushUtil.h(truncate(this.x1), truncate(this.x4), truncate(this.x3), truncate(this.x2)); this.vh = BrushUtil.h(truncate(this.xx), truncate(this.x0), truncate(this.xz), truncate(this.xy)); } xm(a) { if (typeCast(NumericYAxis.$, a) !== null) { return true; } return false; } xl(a) { if (typeCast(NumericXAxis.$, a) !== null) { return true; } return false; } zo(a, b) { this.zy(); this.rs(false); } get x8() { return this.x0 - this.x4; } get x7() { return this.xz - this.x3; } get x6() { return this.xy - this.x2; } get x5() { return this.xx - this.x1; } he(a, b, c) { let d = super.he(a, b, c); if (this.w9 == null || this.w7 == null || this.w7.bi == null || this.w9.bi == null || this.xg == null || this.xe == null || this.xg.count < 1 || this.xe.count < 1 || this.xg.count != this.xe.count || this.w7.l4 == this.w7.l3 || this.w9.l4 == this.w9.l3 || this.wu.isEmpty) { d = false; } return d; } get yw() { return this.yq; } set yw(a) { let b = this.yq; this.yq = a; this.raisePropertyChanged("ProgressiveStatus", b, this.yq); } rt(a) { super.rt(a); this.zq(a, this.cw); } xh() { if (TestRandomness.instance.testRandomnessSource != null) { return TestRandomness.instance.testRandomnessSource; } return new DefaultRandomnessSource(0); } zq(a, b) { if (this.d6(b)) { return; } if (this.w5 == null && !this.xo) { let c = new List$1(KDPointData.$, 2, this.xe.count); let d = this.w7; let e = this.w9; 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.ch); let i = new ScalerParams(1, f, g, e.ch); let j; let k; for (let l = 0; l < this.xe.count; l++) { j = d.el(this.xe.item(l), h); k = e.el(this.xg.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.xn) { this.yl = 1; this.ym = truncate(logBase(c.count, 2)) + 3; this.yw = truncate(((this.yl / this.ym) * 100)); if (this.progressiveLoadStatusChanged != null) { this.progressiveLoadStatusChanged(this, new ProgressiveLoadStatusEventArgs(this.yw)); } this.w5 = KDTree2D.b(c.toArray(), 1, this.xh()); let m = this.w5; m.progressiveThunkCompleted = delegateCombine(m.progressiveThunkCompleted, runOn(this, this.zl)); if (!this.w5.h(this.jz)) { let n = this.w5; n.progressiveThunkCompleted = delegateRemove(n.progressiveThunkCompleted, runOn(this, this.zl)); } this.ql(); } else { let o = dateNow(); this.w5 = new KDTree2D(0, c.toArray(), 1, this.xh()); let p = dateNow(); } } if (this.xn && !this.xo) { this.zr(b); } else { this.zt(b); } } pb(a, b, c, d) { super.pb(a, b, c, d); this.zy(); let e = false; if (this.w7 != null && !this.w7.c1()) { e = true; } if (this.w9 != null && !this.w9.c1()) { e = true; } if (e) { this.rs(false); } this.qm(); } zn(a) { let b = a; let c = this.yo * this.yn; if (this.xk) { 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; } } } } zt(a) { let b; let c; let d = null; if (a.r) { d = this._itemIndexes; } let e = a.getViewInfo(c, b); c = e.p0; b = e.p1; let f = a; let g = this.getEffectiveViewport1(a); this.xa = new ScalerParams(0, b, c, this.w6.ch, g); this.xb = new ScalerParams(0, b, c, this.w8.ch, g); this.zm(a); this.zn(a); let h = this.yo * this.yn; if (this.w3 == null || this.w3.length != h) { this.w3 = new Array(h); this.w0 = new Array(h); } let i = this.w3.length; let j = this.w3; let k = this.w0; for (let l = 0; l < i; l++) { j[l] = 0; k[l] = 0; } this.ys = truncate(Math.round(this.id)); this.w2 = f.b5(); let m = this.w2.length; let n = this.w2; for (let o = 0; o < m; o++) { n[o] = 0; } let p = this.yj; let q = this.yi; if (isNaN_(p) || isInfinity(p)) { p = 0; } if (isNaN_(q) || isInfinity(q)) { q = 50; } this.xv = Math.min(p, q); this.xu = Math.max(p, q); if (this.xv < 0) { this.xv = 0; } if (this.xu < 0) { this.xu = 0; } this.xw = this.xu - this.xv; if (this.xo) { this.zp(a); } else { this.z0(a); } f.cg(); if (a.r) { this._itemIndexes = d; this.w4.ch(); } } zr(a) { if (this.w5 == null) { return; } this.zt(a); } zl(a, b) { this.w4.cf(() => { if (this.yl < this.ym - 1) { this.yl++; } this.yw = truncate(((this.yl / this.ym) * 100)); if (this.progressiveLoadStatusChanged != null) { this.progressiveLoadStatusChanged(this, new ProgressiveLoadStatusEventArgs(this.yw)); } this.zr(this.cw); this.ql(); if (this.w5 != null) { if (!this.w5.h(this.jz)) { let c = this.w5; c.progressiveThunkCompleted = delegateRemove(c.progressiveThunkCompleted, runOn(this, this.zl)); this.yw = 100; if (this.progressiveLoadStatusChanged != null) { this.progressiveLoadStatusChanged(this, new ProgressiveLoadStatusEventArgs(this.yw)); } } } }); } zp(a) { let b = arrayShallowClone(this.xe.asArray()); this.w7.hq(boxArray$1(b), 0, b.length, this.xa); let c = arrayShallowClone(this.xg.asArray()); this.yr = 0; let d = this.yp; let e = this.xi; let f = this.w3.length; this.w9.hq(boxArray$1(c), 0, c.length, this.xb); let g = 255 << 24 | truncate(this.x4) << 16 | truncate(this.x3) << 8 | truncate(this.x2); 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.yo || j < 0 || j >= this.yn) { continue; } if (e) { let k = i - d; let l = i + d; l = l > (this.yo - 1) ? (this.yo - 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.yo) + o; if (q < 0 || q > f - 1) { continue; } this.w3[q] = this.w3[q] + 1; this.w0[q] = 1; this.yr++; if (this.xk) { this._itemIndexes[q] = h + 1; } } } } else { let r = (j * this.yo) + i; this.w3[r] = this.w3[r] + 1; this.w0[r] = 1; this.yr++; if (this.xk) { this._itemIndexes[r] = h + 1; } } } this.zu(); } z0(a) { let b; let c; let d = a.getViewInfo(b, c); b = d.p0; c = d.p1; if (this.w5 == null) { return; } if (this.xp == null) { this.xp = new List$1(KDTreeNode2D.$, 2, truncate(Math.round(b.width * b.height))); } else { this.xp.clear(); } let e = c.left; let f = c.right; let g = c.top; let h = c.bottom; this.yf = c.top; this.yd = c.height; this.ye = c.left; this.yg = c.width; this.yb = b.top; this.x9 = b.height; this.ya = b.left; this.yc = b.width; let i = this.getEffectiveViewport1(a); this.xr = (i.left - this.ya) / this.yc; this.xs = (i.top - this.yb) / this.x9; let j = (i.right - this.ya) / this.yc; this.xt = j - this.xr; let k = (i.bottom - this.yb) / this.x9; this.xq = k - this.xs; if (this.xj) { e = (e - this.xr) / this.xt; f = (f - this.xr) / this.xt; g = (g - this.xs) / this.xq; h = (h - this.xs) / this.xq; } let l = this.id / b.width * c.width; let m = this.id / 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.w5.u(this.xp, o, 0, 1, 0, 1); let p; this.yr = 0; for (let q = 0; q < this.xp.count; q++) { p = this.xp._inner[q]; this.zv(p); } this.zu(); } zv(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.zx(a.b, d, b, a.e); if (c > 0 && !b) { let e; for (let f = 0; f < c; f++) { e = a.a[f]; this.zx(e, d, false, a.e); } } if (a.e != null) { a.e.a = false; } } gd(a) { let b = this.dc != null ? this.dc.v5 : Rect.empty; let c = this.dc != null ? this.dc.wn : Rect.empty; let d = new Rect(0, 0, 0, 1, 1); let e = this.wn(this.cw); let f = new ScalerParams(0, d, d, this.w7.ch, e); let g = new ScalerParams(0, d, d, this.w9.ch, e); let h = !b.isEmpty && !c.isEmpty && this.dp != null ? this.dp.indexOf(a) : -1; let i = this.w7 != null && this.xe != null && h < this.xe.count ? this.w7.el(this.xe.item(h), f) : NaN; let j = this.w9 != null && this.xg != null && h < this.xg.count ? this.w9.el(this.xg.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; } zx(a, b, c, d) { let e = this.yu(b); let f = a.c; let g = this.yp; if (c) { let h = d.d; let i = d.b; let j = d.e; let k = d.c; if (this.xj) { h = this.xr + this.xt * h; i = this.xr + this.xt * i; j = this.xs + this.xq * j; k = this.xs + this.xq * k; } let l = truncate((this.ya + this.yc * (h - this.ye) / this.yg)); let m = truncate((this.ya + this.yc * (i - this.ye) / this.yg)); let n = truncate((this.yb + this.x9 * (j - this.yf) / this.yd)); let o = truncate((this.yb + this.x9 * (k - this.yf) / this.yd)); l = truncate(Math.floor(l)); m = truncate(Math.floor(m)); n = truncate(Math.floor(n)); o = truncate(Math.floor(o)); if (this.xi) { 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.zw(f, s, t, q, r); } } } else { let u = a.a; let v = a.b; if (this.xj) { u = this.xr + this.xt * u; v = this.xs + this.xq * v; } let w = truncate((this.ya + this.yc * (u - this.ye) / this.yg)); let x = truncate((this.yb + this.x9 * (v - this.yf) / this.yd)); w = truncate(Math.floor(w)); x = truncate(Math.floor(x)); if (this.xi) { 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.zw(f, af, ag, ad, ae); } } } else { this.zw(f, w, x, b, 1); } } } yt(a, b) { return truncate((Math.floor(255 * b))) << 24 | truncate(Math.floor(b * (this.x4 + a * this.x8))) << 16 | truncate(Math.floor(b * (this.x3 + a * this.x7))) << 8 | truncate(Math.floor(b * (this.x2 + a * this.x6))); } yu(a) { return 255 << 24 | truncate(Math.floor((this.x4 + a * this.x8))) << 16 | truncate(Math.floor((this.x3 + a * this.x7))) << 8 | truncate(Math.floor((this.x2 + a * this.x6))); } yh(a) { return (a >> 24 & 255) / 255; } zw(a, b, c, d, e) { if (b < 0 || b >= this.yo || c < 0 || c >= this.yn) { return; } let f = (c * this.yo) + b; this.w3[f] = this.w3[f] + d; this.w0[f] = this.w0[f] + e; if (this.xk) { this._itemIndexes[f] = a + 1; } this.yr += truncate(d); } zu() { let a = 0; let b = 0; let c = this.xw; let d = this.xv; let e = this.xu; let f = this.w3.length; let g = this.w3; let h = this.w0; let i = this.w2; 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.yt(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; } } zm(a) { let b = a; b.cd(); } ct() { return new HighDensityScatterSeriesView(this); } q1(a) { super.q1(a); this.w4 = a; } ay(a) { if (a != null && a == this.w7 && this.xe != null) { return new AxisRange(this.xe.minimum, this.xe.maximum); } if (a != null && a == this.w9 && this.xg != null) { return new AxisRange(this.xg.minimum, this.xg.maximum); } return null; } ss(a, b) { if (this.dc != null) { let c = this.getEffectiveViewport1(this.cw); this.xj = !c.isEmpty; } this.rs(false); } st(a, b) { this.rs(false); } kn(a) { if (!this.xk || this._itemIndexes == null || this.dc == null || this.dp == null || this._itemIndexes.length != (this.yo * this.yn)) { return null; } let b = this.dc.v5; let c = (a.x - b.left) / b.width; let d = (a.y - b.top) / b.height; let e = truncate(Math.round(this.wu.left + (this.wu.width * c))); let f = truncate(Math.round(this.wu.top + (this.wu.height * d))); let g = this.yx(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); } yx(a, b) { let c = (this.yo * b) + a; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } let d = 1; c = (this.yo * (b - d)) + a; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } c = (this.yo * (b + d)) + a; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } c = (this.yo * (b)) + a - 1; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } c = (this.yo * (b)) + a + 1; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } c = (this.yo * (b - d)) + a - 1; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } c = (this.yo * (b + d)) + a + 1; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } c = (this.yo * (b - d)) + a + 1; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } c = (this.yo * (b + d)) + a - 1; if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) { return c; } return 0; } zz(a, b, c) { this.w2 = a; this.yo = b; this.yn = c; } get_g7() { return true; } set_g7(a) { super.set_g7(a); } o5(a, b) { super.o5(a, b); this.w4.ce(); if (this.cv != null) { this.cv.ce(); } this.ql(); } ru(a, b) { super.ru(a, b); if (!this.g0) { this.cw.a7(b); return; } this.cw.a7(b); if (this.d6(this.cv)) { return; } let c = typeCast(HighDensityScatterSeriesView.$, this.cv); let d = new ScatterFrame(); this.zq(false, c); this.g0 = false; } rr(a, b, c, d, e) { super.rr(a, b, c, d, e); let f = this.ba.a$j.item(d); let g = f; f.a6(c); if (this.d6(g)) { return; } if (this.xc == null) { this.xc = new ScatterFrame(); } this.zq(false, f); } o2() { super.o2(); this.w7 = null; this.w9 = null; } } HighDensityScatterSeries.$t = /*@__PURE__*/ markType(HighDensityScatterSeries, 'HighDensityScatterSeries', Series.$); HighDensityScatterSeries.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, HighDensityScatterSeries, 'raisePropertyChanged', ['HeatMaximumColor:aag:z1', [Color.$, Defaults.ap], 'HeatMaximum:yi:z2', [1, 50], 'HeatMinimumColor:aah:z3', [Color.$, Defaults.aq], 'HeatMinimum:yj:z4', [1, 0], 'PointExtent:yv:z5', [1, 1], 'ProgressiveLoad:xn:z6', [0, true], 'UseBruteForce:xo:z7', [0, false], 'XAxis:w7:z8', [NumericXAxis.$, null], 'XMemberAsLegendLabel:y7:z9', [2, null], 'XMemberAsLegendUnit:y9:aaa', [2, null], 'XMemberPath:zb:aab', [2, null], 'YAxis:w9:aac', [NumericYAxis.$, null], 'YMemberAsLegendLabel:zf:aad', [2, null], 'YMemberAsLegendUnit:zh:aae', [2, null], 'YMemberPath:zj:aaf', [2, null]]); return HighDensityScatterSeries; })(); /** * @hidden */ export let HighDensityScatterSeriesView = /*@__PURE__*/ (() => { class HighDensityScatterSeriesView extends SeriesView { constructor(a) { super(a); this.b6 = null; this.b4 = null; this.cc = 0; this.cb = 0; this.b9 = null; this.ca = null; this.b7 = null; this.b6 = a; } ax() { super.ax(); if (!this.r) { this.b6.aah = Defaults.aq; this.b6.aag = Defaults.ap; this.b6.vh = Defaults.al; this.b6.vx = Defaults.ak; } } ch() { this.b6.zz(this.b4, this.cc, this.cb); } cd() { if (this.b9 == null) { this.b9 = this.f.jz.createElement("canvas"); let a = this.f.jz.get2DCanvasContext(this.b9); this.b7 = new RenderingContext(new CanvasViewRenderer(), a); } let b; if (this.q) { b = this.b1; } else { b = this.f.dc.wb(); } 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.cc; let h = this.cb; this.cc = e; this.cb = f; if (g != this.cc || h != this.cb || this.b4 == null) { this.b9.setAttribute("width", e.toString()); this.b9.setAttribute("height", f.toString()); this.ca = this.b7.h().getImageData(0, 0, e, f); let imageDataArray_ = this.ca.data; this.b4 = imageDataArray_; } this.b6.zz(this.b4, this.cc, this.cb); } b5() { return this.b4; } cg() { let a = truncate(Math.round(this.b1.left)); let b = truncate(Math.round(this.b1.left)); let c = truncate(Math.round(this.b1.width)); let d = truncate(Math.round(this.b1.height)); this.b7.h().putImageData(this.ca, 0, 0); this.av(); } cf(a) { if (this.f.jz != null) { this.f.jz.setTimeout(a, 0); } else { window.setTimeout(a, 0); } } bc(a, b) { super.bc(a, b); if (b) { if (!this.b6.f8) { return; } let c = new Rectangle(); c.n = this.b1.left; c.o = this.b1.top; c.width = this.b1.width; c.height = this.b1.height; c._fill = this.bv(); a.w(c); return; } if (this.b9 == null) { return; } let d = truncate(Math.round(this.b1.left)); let e = truncate(Math.round(this.b1.top)); let f = truncate(Math.round(this.b1.width)); let g = truncate(Math.round(this.b1.height)); this.l.o(this.b9.getNativeElement(), this.f._opacity, d, e, f, g, d, e, f, g); } b8(a, b) { return Color.e(toNullable(Color.$, a), toNullable(Color.$, null)) && Color.e(toNullable(Color.$, b), toNullable(Color.$, null)); } ce() { if (this.b4 != null) { for (let a = 0; a < this.b4.length; a++) { this.b4[a] = 0; } this.cg(); } } aq(a) { super.aq(a); if (this.b4 == null) { this.f.bc.exportSeriesPixelsData(a, null, this.cc, this.cb); return; } let b = new Array(intDivide(this.b4.length, 4)); let c; for (let d = 0; d < intDivide(this.b4.length, 4); d++) { c = d * 4; b[d] = this.b4[c + 3] << 24 | this.b4[c] << 16 | this.b4[c + 1] << 8 | this.b4[c + 2]; } this.f.bc.exportSeriesPixelsData(a, b, this.cc, this.cb); } } HighDensityScatterSeriesView.$t = /*@__PURE__*/ markType(HighDensityScatterSeriesView, 'HighDensityScatterSeriesView', SeriesView.$); return HighDensityScatterSeriesView; })();