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
JavaScript
/*
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;
}
jl() {
if (!isNaN_(this.jk)) {
return super.jl();
}
return Defaults.ad;
}
constructor() {
super();
this.xg = null;
this.xi = null;
this.ys = 0;
this.xl = false;
this.x7 = Defaults.bf.o;
this.x6 = Defaults.bf.n;
this.x5 = Defaults.bf.m;
this.x4 = Defaults.bf.l;
this.x3 = Defaults.be.o;
this.x2 = Defaults.be.n;
this.x1 = Defaults.be.m;
this.x0 = Defaults.be.l;
this.w8 = null;
this.xd = null;
this.xe = null;
this.w9 = null;
this.xb = null;
this.xn = false;
this.yt = 0;
this.yv = 0;
this.yp = 0;
this.yo = 0;
this.progressiveLoadStatusChanged = null;
this.xs = null;
this.xy = 0;
this.xx = 0;
this.xz = 0;
this.ye = 0;
this.yc = 0;
this.yd = 0;
this.yf = 0;
this.yh = 0;
this.yj = 0;
this.yi = 0;
this.yg = 0;
this.xu = 0;
this.xv = 0;
this.xw = 0;
this.xt = 0;
this.yr = 0;
this.yq = 0;
this.w5 = null;
this.yu = 0;
this.xm = false;
this._itemIndexes = null;
this.w6 = null;
this.w3 = null;
this.xf = null;
this.ab = HighDensityScatterSeries.$;
this.f9 = false;
}
get_fx() {
return true;
}
get xh() {
return this.xg;
}
set xh(a) {
if (this.xg != a) {
let b = this.xh;
this.xg = a;
this.raisePropertyChanged("XColumn", b, this.xh);
}
}
getDataLegendSeriesContextAt(a, b) {
let c = { $type: Point_$type, x: a, y: b };
let d = this.ko(c);
let e = d == null ? NaN : this.iy(d, "XMemberPath");
let f = d == null ? NaN : this.iy(d, "YMemberPath");
let g = new DataLegendSeriesValueInfo();
g.l = e;
g.a = 13;
g.q = "X";
g.r = this.ze != null ? this.ze : "X";
g.s = this.za != null ? this.za : "X:";
g.t = this.zc != null ? this.zc : "";
let h = new DataLegendSeriesValueInfo();
h.l = f;
h.a = 14;
h.q = "Y";
h.r = this.zm != null ? this.zm : "Y";
h.s = this.zi != null ? this.zi : "Y:";
h.t = this.zk != null ? this.zk : "";
let i = new DataLegendSeriesContext();
i.e = ((() => {
let $ret = new List$1(DataLegendSeriesValueInfo.$, 0);
$ret.add(g);
$ret.add(h);
return $ret;
})());
i.h = this.me();
return i;
}
kr(a, b) {
let c = this.nf(b);
if (c == HighDensityScatterSeries.$$p[10]) {
return this.ks(a, b, this.ze);
}
if (c == HighDensityScatterSeries.$$p[14]) {
return this.ks(a, b, this.zm);
}
return super.kr(a, b);
}
mf(a) {
let b = this.nf(a);
if (b == HighDensityScatterSeries.$$p[10]) {
return this.ze;
}
if (b == HighDensityScatterSeries.$$p[14]) {
return this.zm;
}
return super.mf(a);
}
get xj() {
return this.xi;
}
set xj(a) {
if (this.xi != a) {
let b = this.xj;
this.xi = a;
this.raisePropertyChanged("YColumn", b, this.xj);
}
}
z1() {
if (this.w8 == null) {
return;
}
this.w8.t();
let a = this.w8;
a.progressiveThunkCompleted = delegateRemove(a.progressiveThunkCompleted, runOn(this, this.zo));
this.w8 = null;
}
rc(a, b, c, d) {
super.rc(a, b, c, d);
switch (b) {
case HighDensityScatterSeries.$$p[8]:
case HighDensityScatterSeries.$$p[12]:
case HighDensityScatterSeries.$$p[9]:
case HighDensityScatterSeries.$$p[13]:
this.qh();
break;
case "SeriesViewer":
if (this.dc != null) {
let e = this.getEffectiveViewport1(this.cw);
this.xm = !e.isEmpty;
}
break;
case "FastItemsSource":
this.z1();
if (typeCast(IFastItemsSource_$type, c) != null) {
c.deregisterColumn(this.xh);
c.deregisterColumn(this.xj);
this.xh = null;
this.xj = null;
}
if (typeCast(IFastItemsSource_$type, d) != null) {
this.xh = this.dl(this.ze);
this.xj = this.dl(this.zm);
}
if ((this.xc != null && !this.xc.c1()) || (this.xa != null && !this.xa.c1())) {
this.ru(this.gh && c != null);
}
this.qo();
break;
case HighDensityScatterSeries.$$p[7]:
let f = this.w9;
this.w9 = this.xa;
this.z1();
if (f != null) {
f.rangeChanged = delegateRemove(f.rangeChanged, runOn(this, this.zr));
}
if (this.w9 != null) {
let g = this.w9;
g.rangeChanged = delegateCombine(g.rangeChanged, runOn(this, this.zr));
}
if (c != null) {
c.b0(this);
}
if (d != null) {
d.ct(this);
}
if ((this.xa != null && !this.xa.c1()) || (d == null && c != null)) {
this.ru(false);
}
break;
case HighDensityScatterSeries.$$p[11]:
let h = this.xb;
this.xb = this.xc;
this.z1();
if (h != null) {
h.rangeChanged = delegateRemove(h.rangeChanged, runOn(this, this.zr));
}
if (this.xb != null) {
let i = this.xb;
i.rangeChanged = delegateCombine(i.rangeChanged, runOn(this, this.zr));
}
if (c != null) {
c.b0(this);
}
if (d != null) {
d.ct(this);
}
if ((this.xc != null && !this.xc.c1()) || (d == null && c != null)) {
this.ru(false);
}
break;
case "MouseOverEnabled":
this.xn = this.f9;
this.ru(false);
break;
case HighDensityScatterSeries.$$p[10]:
if (this.dp != null) {
this.dp.deregisterColumn(this.xh);
this.xh = this.dl(this.ze);
}
break;
case "XColumn":
this.z1();
if (this.xa != null && !this.xa.c1()) {
this.ru(false);
}
this.qo();
break;
case HighDensityScatterSeries.$$p[14]:
if (this.dp != null) {
this.dp.deregisterColumn(this.xj);
this.xj = this.dl(this.zm);
}
break;
case "YColumn":
this.z1();
if (this.xc != null && !this.xc.c1()) {
this.ru(false);
}
this.qo();
break;
case HighDensityScatterSeries.$$p[6]:
this.z1();
this.ru(false);
this.qn();
break;
case HighDensityScatterSeries.$$p[3]:
this.ru(false);
this.qn();
break;
case HighDensityScatterSeries.$$p[1]:
this.ru(false);
this.qn();
break;
case HighDensityScatterSeries.$$p[0]:
case HighDensityScatterSeries.$$p[2]:
if (!this.w7.ch(this.aak, this.aaj)) {
return;
}
this.zv();
this.ru(false);
this.qn();
break;
case HighDensityScatterSeries.$$p[4]:
this.ys = Math.max(typeGetValue(d) - 1, 0);
this.xl = this.ys > 0;
this.ru(false);
this.qn();
break;
case HighDensityScatterSeries.$$p[5]:
this.ru(false);
this.qn();
break;
}
}
zv() {
this.x4 = this.aak.l;
this.x7 = this.aak.o;
this.x6 = this.aak.n;
this.x5 = this.aak.m;
this.x0 = this.aaj.l;
this.x3 = this.aaj.o;
this.x2 = this.aaj.n;
this.x1 = this.aaj.m;
this.v0 = BrushUtil.j(truncate(this.x4), truncate(this.x7), truncate(this.x6), truncate(this.x5));
this.vk = BrushUtil.j(truncate(this.x0), truncate(this.x3), truncate(this.x2), truncate(this.x1));
}
xp(a) {
if (typeCast(NumericYAxis.$, a) !== null) {
return true;
}
return false;
}
xo(a) {
if (typeCast(NumericXAxis.$, a) !== null) {
return true;
}
return false;
}
zr(a, b) {
this.z1();
this.ru(false);
}
get yb() {
return this.x3 - this.x7;
}
get ya() {
return this.x2 - this.x6;
}
get x9() {
return this.x1 - this.x5;
}
get x8() {
return this.x0 - this.x4;
}
hf(a, b, c) {
let d = super.hf(a, b, c);
if (this.xc == null || this.xa == null || this.xa.bi == null || this.xc.bi == null || this.xj == null || this.xh == null || this.xj.count < 1 || this.xh.count < 1 || this.xj.count != this.xh.count || this.xa.l4 == this.xa.l3 || this.xc.l4 == this.xc.l3 || this.wx.isEmpty) {
d = false;
}
return d;
}
get yz() {
return this.yt;
}
set yz(a) {
let b = this.yt;
this.yt = a;
this.raisePropertyChanged("ProgressiveStatus", b, this.yt);
}
rv(a) {
super.rv(a);
this.zt(a, this.cw);
}
xk() {
if (TestRandomness.instance.testRandomnessSource != null) {
return TestRandomness.instance.testRandomnessSource;
}
return new DefaultRandomnessSource(0);
}
zt(a, b) {
if (this.d7(b)) {
return;
}
if (this.w8 == null && !this.xr) {
let c = new List$1(KDPointData.$, 2, this.xh.count);
let d = this.xa;
let e = this.xc;
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.xh.count; l++) {
j = d.el(this.xh.item(l), h);
k = e.el(this.xj.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.xq) {
this.yo = 1;
this.yp = truncate(logBase(c.count, 2)) + 3;
this.yz = truncate(((this.yo / this.yp) * 100));
if (this.progressiveLoadStatusChanged != null) {
this.progressiveLoadStatusChanged(this, new ProgressiveLoadStatusEventArgs(this.yz));
}
this.w8 = KDTree2D.b(c.toArray(), 1, this.xk());
let m = this.w8;
m.progressiveThunkCompleted = delegateCombine(m.progressiveThunkCompleted, runOn(this, this.zo));
if (!this.w8.h(this.j0)) {
let n = this.w8;
n.progressiveThunkCompleted = delegateRemove(n.progressiveThunkCompleted, runOn(this, this.zo));
}
this.qn();
}
else {
let o = dateNow();
this.w8 = new KDTree2D(0, c.toArray(), 1, this.xk());
let p = dateNow();
}
}
if (this.xq && !this.xr) {
this.zu(b);
}
else {
this.zw(b);
}
}
pd(a, b, c, d) {
super.pd(a, b, c, d);
this.z1();
let e = false;
if (this.xa != null && !this.xa.c1()) {
e = true;
}
if (this.xc != null && !this.xc.c1()) {
e = true;
}
if (e) {
this.ru(false);
}
this.qo();
}
zq(a) {
let b = a;
let c = this.yr * this.yq;
if (this.xn) {
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;
}
}
}
}
zw(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.xd = new ScalerParams(0, b, c, this.w9.ch, g);
this.xe = new ScalerParams(0, b, c, this.xb.ch, g);
this.zp(a);
this.zq(a);
let h = this.yr * this.yq;
if (this.w6 == null || this.w6.length != h) {
this.w6 = new Array(h);
this.w3 = new Array(h);
}
let i = this.w6.length;
let j = this.w6;
let k = this.w3;
for (let l = 0; l < i; l++) {
j[l] = 0;
k[l] = 0;
}
this.yv = truncate(Math.round(this.ie));
this.w5 = f.ce();
let m = this.w5.length;
let n = this.w5;
for (let o = 0; o < m; o++) {
n[o] = 0;
}
let p = this.ym;
let q = this.yl;
if (isNaN_(p) || isInfinity(p)) {
p = 0;
}
if (isNaN_(q) || isInfinity(q)) {
q = 50;
}
this.xy = Math.min(p, q);
this.xx = Math.max(p, q);
if (this.xy < 0) {
this.xy = 0;
}
if (this.xx < 0) {
this.xx = 0;
}
this.xz = this.xx - this.xy;
if (this.xr) {
this.zs(a);
}
else {
this.z3(a);
}
f.cp();
if (a.t) {
this._itemIndexes = d;
this.w7.cq();
}
}
zu(a) {
if (this.w8 == null) {
return;
}
this.zw(a);
}
zo(a, b) {
this.w7.co(() => {
if (this.yo < this.yp - 1) {
this.yo++;
}
this.yz = truncate(((this.yo / this.yp) * 100));
if (this.progressiveLoadStatusChanged != null) {
this.progressiveLoadStatusChanged(this, new ProgressiveLoadStatusEventArgs(this.yz));
}
this.zu(this.cw);
this.qn();
if (this.w8 != null) {
if (!this.w8.h(this.j0)) {
let c = this.w8;
c.progressiveThunkCompleted = delegateRemove(c.progressiveThunkCompleted, runOn(this, this.zo));
this.yz = 100;
if (this.progressiveLoadStatusChanged != null) {
this.progressiveLoadStatusChanged(this, new ProgressiveLoadStatusEventArgs(this.yz));
}
}
}
});
}
zs(a) {
let b = arrayShallowClone(this.xh.asArray());
this.xa.hq(boxArray$1(b), 0, b.length, this.xd);
let c = arrayShallowClone(this.xj.asArray());
this.yu = 0;
let d = this.ys;
let e = this.xl;
let f = this.w6.length;
this.xc.hq(boxArray$1(c), 0, c.length, this.xe);
let g = 255 << 24 | truncate(this.x7) << 16 | truncate(this.x6) << 8 | truncate(this.x5);
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.yr || j < 0 || j >= this.yq) {
continue;
}
if (e) {
let k = i - d;
let l = i + d;
l = l > (this.yr - 1) ? (this.yr - 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.yr) + o;
if (q < 0 || q > f - 1) {
continue;
}
this.w6[q] = this.w6[q] + 1;
this.w3[q] = 1;
this.yu++;
if (this.xn) {
this._itemIndexes[q] = h + 1;
}
}
}
}
else {
let r = (j * this.yr) + i;
this.w6[r] = this.w6[r] + 1;
this.w3[r] = 1;
this.yu++;
if (this.xn) {
this._itemIndexes[r] = h + 1;
}
}
}
this.zx();
}
z3(a) {
let b;
let c;
let d = a.getViewInfo(b, c);
b = d.p0;
c = d.p1;
if (this.w8 == null) {
return;
}
if (this.xs == null) {
this.xs = new List$1(KDTreeNode2D.$, 2, truncate(Math.round(b.width * b.height)));
}
else {
this.xs.clear();
}
let e = c.left;
let f = c.right;
let g = c.top;
let h = c.bottom;
this.yi = c.top;
this.yg = c.height;
this.yh = c.left;
this.yj = c.width;
this.ye = b.top;
this.yc = b.height;
this.yd = b.left;
this.yf = b.width;
let i = this.getEffectiveViewport1(a);
this.xu = (i.left - this.yd) / this.yf;
this.xv = (i.top - this.ye) / this.yc;
let j = (i.right - this.yd) / this.yf;
this.xw = j - this.xu;
let k = (i.bottom - this.ye) / this.yc;
this.xt = k - this.xv;
if (this.xm) {
e = (e - this.xu) / this.xw;
f = (f - this.xu) / this.xw;
g = (g - this.xv) / this.xt;
h = (h - this.xv) / this.xt;
}
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.w8.u(this.xs, o, 0, 1, 0, 1);
let p;
this.yu = 0;
for (let q = 0; q < this.xs.count; q++) {
p = this.xs._inner[q];
this.zy(p);
}
this.zx();
}
zy(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.z0(a.b, d, b, a.e);
if (c > 0 && !b) {
let e;
for (let f = 0; f < c; f++) {
e = a.a[f];
this.z0(e, d, false, a.e);
}
}
if (a.e != null) {
a.e.a = false;
}
}
ge(a) {
let b = this.dc != null ? this.dc.wt : Rect.empty;
let c = this.dc != null ? this.dc.xb : Rect.empty;
let d = new Rect(0, 0, 0, 1, 1);
let e = this.wq(this.cw);
let f = new ScalerParams(0, d, d, this.xa.ch, e);
let g = new ScalerParams(0, d, d, this.xc.ch, e);
let h = !b.isEmpty && !c.isEmpty && this.dp != null ? this.dp.indexOf(a) : -1;
let i = this.xa != null && this.xh != null && h < this.xh.count ? this.xa.el(this.xh.item(h), f) : NaN;
let j = this.xc != null && this.xj != null && h < this.xj.count ? this.xc.el(this.xj.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;
}
z0(a, b, c, d) {
let e = this.yx(b);
let f = a.c;
let g = this.ys;
if (c) {
let h = d.d;
let i = d.b;
let j = d.e;
let k = d.c;
if (this.xm) {
h = this.xu + this.xw * h;
i = this.xu + this.xw * i;
j = this.xv + this.xt * j;
k = this.xv + this.xt * k;
}
let l = truncate((this.yd + this.yf * (h - this.yh) / this.yj));
let m = truncate((this.yd + this.yf * (i - this.yh) / this.yj));
let n = truncate((this.ye + this.yc * (j - this.yi) / this.yg));
let o = truncate((this.ye + this.yc * (k - this.yi) / this.yg));
l = truncate(Math.floor(l));
m = truncate(Math.floor(m));
n = truncate(Math.floor(n));
o = truncate(Math.floor(o));
if (this.xl) {
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.zz(f, s, t, q, r);
}
}
}
else {
let u = a.a;
let v = a.b;
if (this.xm) {
u = this.xu + this.xw * u;
v = this.xv + this.xt * v;
}
let w = truncate((this.yd + this.yf * (u - this.yh) / this.yj));
let x = truncate((this.ye + this.yc * (v - this.yi) / this.yg));
w = truncate(Math.floor(w));
x = truncate(Math.floor(x));
if (this.xl) {
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.zz(f, af, ag, ad, ae);
}
}
}
else {
this.zz(f, w, x, b, 1);
}
}
}
yw(a, b) {
return truncate((Math.floor(255 * b))) << 24 | truncate(Math.floor(b * (this.x7 + a * this.yb))) << 16 | truncate(Math.floor(b * (this.x6 + a * this.ya))) << 8 | truncate(Math.floor(b * (this.x5 + a * this.x9)));
}
yx(a) {
return 255 << 24 | truncate(Math.floor((this.x7 + a * this.yb))) << 16 | truncate(Math.floor((this.x6 + a * this.ya))) << 8 | truncate(Math.floor((this.x5 + a * this.x9)));
}
yk(a) {
return (a >> 24 & 255) / 255;
}
zz(a, b, c, d, e) {
if (b < 0 || b >= this.yr || c < 0 || c >= this.yq) {
return;
}
let f = (c * this.yr) + b;
this.w6[f] = this.w6[f] + d;
this.w3[f] = this.w3[f] + e;
if (this.xn) {
this._itemIndexes[f] = a + 1;
}
this.yu += truncate(d);
}
zx() {
let a = 0;
let b = 0;
let c = this.xz;
let d = this.xy;
let e = this.xx;
let f = this.w6.length;
let g = this.w6;
let h = this.w3;
let i = this.w5;
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.yw(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;
}
}
zp(a) {
let b = a;
b.cm();
}
ct() {
return new HighDensityScatterSeriesView(this);
}
q3(a) {
super.q3(a);
this.w7 = a;
}
ay(a) {
if (a != null && a == this.xa && this.xh != null) {
return new AxisRange(this.xh.minimum, this.xh.maximum);
}
if (a != null && a == this.xc && this.xj != null) {
return new AxisRange(this.xj.minimum, this.xj.maximum);
}
return null;
}
su(a, b) {
if (this.dc != null) {
let c = this.getEffectiveViewport1(this.cw);
this.xm = !c.isEmpty;
}
this.ru(false);
}
sv(a, b) {
this.ru(false);
}
ko(a) {
if (!this.xn || this._itemIndexes == null || this.dc == null || this.dp == null || this._itemIndexes.length != (this.yr * this.yq)) {
return null;
}
let b = this.dc.wt;
let c = (a.x - b.left) / b.width;
let d = (a.y - b.top) / b.height;
let e = truncate(Math.round(this.wx.left + (this.wx.width * c)));
let f = truncate(Math.round(this.wx.top + (this.wx.height * d)));
let g = this.y0(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);
}
y0(a, b) {
let c = (this.yr * b) + a;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
let d = 1;
c = (this.yr * (b - d)) + a;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.yr * (b + d)) + a;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.yr * (b)) + a - 1;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.yr * (b)) + a + 1;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.yr * (b - d)) + a - 1;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.yr * (b + d)) + a + 1;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.yr * (b - d)) + a + 1;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.yr * (b + d)) + a - 1;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
return 0;
}
z2(a, b, c) {
this.w5 = a;
this.yr = b;
this.yq = c;
}
get_g8() {
return true;
}
set_g8(a) {
super.set_g8(a);
}
o7(a, b) {
super.o7(a, b);
this.w7.cn();
if (this.cv != null) {
this.cv.cn();
}
this.qn();
}
rw(a, b) {
super.rw(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.zt(false, c);
this.g1 = false;
}
rt(a, b, c, d, e) {
super.rt(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.xf == null) {
this.xf = new ScatterFrame();
}
this.zt(false, f);
}
o4() {
super.o4();
this.xa = null;
this.xc = null;
}
}
HighDensityScatterSeries.$t = /*@__PURE__*/ markType(HighDensityScatterSeries, 'HighDensityScatterSeries', Series.$);
HighDensityScatterSeries.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, HighDensityScatterSeries, 'raisePropertyChanged', ['HeatMaximumColor:aaj:z4', [Color.$, Defaults.be], 'HeatMaximum:yl:z5', [1, 50], 'HeatMinimumColor:aak:z6', [Color.$, Defaults.bf], 'HeatMinimum:ym:z7', [1, 0], 'PointExtent:yy:z8', [1, 1], 'ProgressiveLoad:xq:z9', [0, true], 'UseBruteForce:xr:aaa', [0, false], 'XAxis:xa:aab', [NumericXAxis.$, null], 'XMemberAsLegendLabel:za:aac', [2, null], 'XMemberAsLegendUnit:zc:aad', [2, null], 'XMemberPath:ze:aae', [2, null], 'YAxis:xc:aaf', [NumericYAxis.$, null], 'YMemberAsLegendLabel:zi:aag', [2, null], 'YMemberAsLegendUnit:zk:aah', [2, null], 'YMemberPath:zm:aai', [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.aak = Defaults.bf;
this.cf.aaj = Defaults.be;
this.cf.vk = Defaults.ba;
this.cf.v0 = Defaults.a9;
}
}
cq() {
this.cf.z2(this.cd, this.cl, this.ck);
}
cm() {
if (this.ci == null) {
this.ci = this.f.j0.createElement("canvas");
let a = this.f.j0.get2DCanvasContext(this.ci);
this.cg = new RenderingContext(new CanvasViewRenderer(), a);
}
let b;
if (this.s) {
b = this.b9;
}
else {
b = this.f.dc.wz();
}
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.z2(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.j0 != null) {
this.f.j0.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;
})();