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_fs() {
return true;
}
ju() {
if (!isNaN_(this.jt)) {
return super.ju();
}
return Defaults.ad;
}
constructor() {
super();
this.xy = null;
this.x0 = null;
this.za = 0;
this.x3 = false;
this.yp = Defaults.bf.o;
this.yo = Defaults.bf.n;
this.yn = Defaults.bf.m;
this.ym = Defaults.bf.l;
this.yl = Defaults.be.o;
this.yk = Defaults.be.n;
this.yj = Defaults.be.m;
this.yi = Defaults.be.l;
this.xq = null;
this.xv = null;
this.xw = null;
this.xr = null;
this.xt = null;
this.x5 = false;
this.zb = 0;
this.zd = 0;
this.y7 = 0;
this.y6 = 0;
this.progressiveLoadStatusChanged = null;
this.ya = null;
this.yg = 0;
this.yf = 0;
this.yh = 0;
this.yw = 0;
this.yu = 0;
this.yv = 0;
this.yx = 0;
this.yz = 0;
this.y1 = 0;
this.y0 = 0;
this.yy = 0;
this.yc = 0;
this.yd = 0;
this.ye = 0;
this.yb = 0;
this.y9 = 0;
this.y8 = 0;
this.xn = null;
this.zc = 0;
this.x4 = false;
this._itemIndexes = null;
this.xo = null;
this.xl = null;
this.xx = null;
this.ab = HighDensityScatterSeries.$;
this.gf = false;
}
get_f0() {
return true;
}
get xz() {
return this.xy;
}
set xz(a) {
if (this.xy != a) {
let b = this.xz;
this.xy = a;
this.raisePropertyChanged("XColumn", b, this.xz);
}
}
getDataLegendSeriesContextAt(a, b) {
let c = { $type: Point_$type, x: a, y: b };
let d = this.ky(c);
let e = d == null ? NaN : this.i6(d, "XMemberPath");
let f = d == null ? NaN : this.i6(d, "YMemberPath");
let g = new DataLegendSeriesValueInfo();
g.l = e;
g.a = 13;
g.q = "X";
g.r = this.zw != null ? this.zw : "X";
g.s = this.zs != null ? this.zs : "X:";
g.t = this.zu != null ? this.zu : "";
let h = new DataLegendSeriesValueInfo();
h.l = f;
h.a = 14;
h.q = "Y";
h.r = this.z4 != null ? this.z4 : "Y";
h.s = this.z0 != null ? this.z0 : "Y:";
h.t = this.z2 != null ? this.z2 : "";
let i = new DataLegendSeriesContext();
i.e = ((() => {
let $ret = new List$1(DataLegendSeriesValueInfo.$, 0);
$ret.add(g);
$ret.add(h);
return $ret;
})());
i.h = this.mp();
return i;
}
k1(a, b) {
let c = this.nq(b);
if (c == HighDensityScatterSeries.$$p[10]) {
return this.k2(a, b, this.zw);
}
if (c == HighDensityScatterSeries.$$p[14]) {
return this.k2(a, b, this.z4);
}
return super.k1(a, b);
}
mq(a) {
let b = this.nq(a);
if (b == HighDensityScatterSeries.$$p[10]) {
return this.zw;
}
if (b == HighDensityScatterSeries.$$p[14]) {
return this.z4;
}
return super.mq(a);
}
get x1() {
return this.x0;
}
set x1(a) {
if (this.x0 != a) {
let b = this.x1;
this.x0 = a;
this.raisePropertyChanged("YColumn", b, this.x1);
}
}
aaj() {
if (this.xq == null) {
return;
}
this.xq.t();
let a = this.xq;
a.progressiveThunkCompleted = delegateRemove(a.progressiveThunkCompleted, runOn(this, this.z6));
this.xq = null;
}
rs(a, b, c, d) {
super.rs(a, b, c, d);
switch (b) {
case HighDensityScatterSeries.$$p[8]:
case HighDensityScatterSeries.$$p[12]:
case HighDensityScatterSeries.$$p[9]:
case HighDensityScatterSeries.$$p[13]:
this.qw();
break;
case "SeriesViewer":
if (this.dc != null) {
let e = this.getEffectiveViewport1(this.cw);
this.x4 = !e.isEmpty;
}
break;
case "FastItemsSource":
this.aaj();
if (typeCast(IFastItemsSource_$type, c) != null) {
c.deregisterColumn(this.xz);
c.deregisterColumn(this.x1);
this.xz = null;
this.x1 = null;
}
if (typeCast(IFastItemsSource_$type, d) != null) {
this.xz = this.dl(this.zw);
this.x1 = this.dl(this.z4);
}
if ((this.xu != null && !this.xu.ee()) || (this.xs != null && !this.xs.ee())) {
this.sa(this.go && c != null);
}
this.q3();
break;
case HighDensityScatterSeries.$$p[7]:
let f = this.xr;
this.xr = this.xs;
this.aaj();
if (f != null) {
f.rangeChanged = delegateRemove(f.rangeChanged, runOn(this, this.z9));
}
if (this.xr != null) {
let g = this.xr;
g.rangeChanged = delegateCombine(g.rangeChanged, runOn(this, this.z9));
}
if (c != null) {
c.cx(this);
}
if (d != null) {
d.d4(this);
}
if ((this.xs != null && !this.xs.ee()) || (d == null && c != null)) {
this.sa(false);
}
break;
case HighDensityScatterSeries.$$p[11]:
let h = this.xt;
this.xt = this.xu;
this.aaj();
if (h != null) {
h.rangeChanged = delegateRemove(h.rangeChanged, runOn(this, this.z9));
}
if (this.xt != null) {
let i = this.xt;
i.rangeChanged = delegateCombine(i.rangeChanged, runOn(this, this.z9));
}
if (c != null) {
c.cx(this);
}
if (d != null) {
d.d4(this);
}
if ((this.xu != null && !this.xu.ee()) || (d == null && c != null)) {
this.sa(false);
}
break;
case "MouseOverEnabled":
this.x5 = this.gf;
this.sa(false);
break;
case HighDensityScatterSeries.$$p[10]:
if (this.dp != null) {
this.dp.deregisterColumn(this.xz);
this.xz = this.dl(this.zw);
}
break;
case "XColumn":
this.aaj();
if (this.xs != null && !this.xs.ee()) {
this.sa(false);
}
this.q3();
break;
case HighDensityScatterSeries.$$p[14]:
if (this.dp != null) {
this.dp.deregisterColumn(this.x1);
this.x1 = this.dl(this.z4);
}
break;
case "YColumn":
this.aaj();
if (this.xu != null && !this.xu.ee()) {
this.sa(false);
}
this.q3();
break;
case HighDensityScatterSeries.$$p[6]:
this.aaj();
this.sa(false);
this.q2();
break;
case HighDensityScatterSeries.$$p[3]:
this.sa(false);
this.q2();
break;
case HighDensityScatterSeries.$$p[1]:
this.sa(false);
this.q2();
break;
case HighDensityScatterSeries.$$p[0]:
case HighDensityScatterSeries.$$p[2]:
if (!this.xp.ch(this.aa2, this.aa1)) {
return;
}
this.aad();
this.sa(false);
this.q2();
break;
case HighDensityScatterSeries.$$p[4]:
this.za = Math.max(typeGetValue(d) - 1, 0);
this.x3 = this.za > 0;
this.sa(false);
this.q2();
break;
case HighDensityScatterSeries.$$p[5]:
this.sa(false);
this.q2();
break;
}
}
aad() {
this.ym = this.aa2.l;
this.yp = this.aa2.o;
this.yo = this.aa2.n;
this.yn = this.aa2.m;
this.yi = this.aa1.l;
this.yl = this.aa1.o;
this.yk = this.aa1.n;
this.yj = this.aa1.m;
this.wh = BrushUtil.l(truncate(this.ym), truncate(this.yp), truncate(this.yo), truncate(this.yn));
this.v1 = BrushUtil.l(truncate(this.yi), truncate(this.yl), truncate(this.yk), truncate(this.yj));
}
x7(a) {
if (typeCast(NumericYAxis.$, a) !== null) {
return true;
}
return false;
}
x6(a) {
if (typeCast(NumericXAxis.$, a) !== null) {
return true;
}
return false;
}
z9(a, b) {
this.aaj();
this.sa(false);
}
get yt() {
return this.yl - this.yp;
}
get ys() {
return this.yk - this.yo;
}
get yr() {
return this.yj - this.yn;
}
get yq() {
return this.yi - this.ym;
}
hm(a, b, c) {
let d = super.hm(a, b, c);
if (this.xu == null || this.xs == null || this.xs.b7 == null || this.xu.b7 == null || this.x1 == null || this.xz == null || this.x1.count < 1 || this.xz.count < 1 || this.x1.count != this.xz.count || this.xs.qy == this.xs.qx || this.xu.qy == this.xu.qx || this.xf.isEmpty) {
d = false;
}
return d;
}
get zh() {
return this.zb;
}
set zh(a) {
let b = this.zb;
this.zb = a;
this.raisePropertyChanged("ProgressiveStatus", b, this.zb);
}
sb(a) {
super.sb(a);
this.aab(a, this.cw);
}
x2() {
if (TestRandomness.instance.testRandomnessSource != null) {
return TestRandomness.instance.testRandomnessSource;
}
return new DefaultRandomnessSource(0);
}
aab(a, b) {
if (this.d7(b)) {
return;
}
if (this.xq == null && !this.x9) {
let c = new List$1(KDPointData.$, 2, this.xz.count);
let d = this.xs;
let e = this.xu;
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.xz.count; l++) {
j = d.f7(this.xz.item(l), h);
k = e.f7(this.x1.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.x8) {
this.y6 = 1;
this.y7 = truncate(logBase(c.count, 2)) + 3;
this.zh = truncate(((this.y6 / this.y7) * 100));
if (this.progressiveLoadStatusChanged != null) {
this.progressiveLoadStatusChanged(this, new ProgressiveLoadStatusEventArgs(this.zh));
}
this.xq = KDTree2D.b(c.toArray(), 1, this.x2());
let m = this.xq;
m.progressiveThunkCompleted = delegateCombine(m.progressiveThunkCompleted, runOn(this, this.z6));
if (!this.xq.h(this.ka)) {
let n = this.xq;
n.progressiveThunkCompleted = delegateRemove(n.progressiveThunkCompleted, runOn(this, this.z6));
}
this.q2();
}
else {
let o = dateNow();
this.xq = new KDTree2D(0, c.toArray(), 1, this.x2());
let p = dateNow();
}
}
if (this.x8 && !this.x9) {
this.aac(b);
}
else {
this.aae(b);
}
}
pq(a, b, c, d) {
super.pq(a, b, c, d);
this.aaj();
let e = false;
if (this.xs != null && !this.xs.ee()) {
e = true;
}
if (this.xu != null && !this.xu.ee()) {
e = true;
}
if (e) {
this.sa(false);
}
this.q3();
}
z8(a) {
let b = a;
let c = this.y9 * this.y8;
if (this.x5) {
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;
}
}
}
}
aae(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.xv = new ScalerParams(0, b, c, this.xr.dn, g);
this.xw = new ScalerParams(0, b, c, this.xt.dn, g);
this.z7(a);
this.z8(a);
let h = this.y9 * this.y8;
if (this.xo == null || this.xo.length != h) {
this.xo = new Array(h);
this.xl = new Array(h);
}
let i = this.xo.length;
let j = this.xo;
let k = this.xl;
for (let l = 0; l < i; l++) {
j[l] = 0;
k[l] = 0;
}
this.zd = truncate(Math.round(this.im));
this.xn = f.ce();
let m = this.xn.length;
let n = this.xn;
for (let o = 0; o < m; o++) {
n[o] = 0;
}
let p = this.y4;
let q = this.y3;
if (isNaN_(p) || isInfinity(p)) {
p = 0;
}
if (isNaN_(q) || isInfinity(q)) {
q = 50;
}
this.yg = Math.min(p, q);
this.yf = Math.max(p, q);
if (this.yg < 0) {
this.yg = 0;
}
if (this.yf < 0) {
this.yf = 0;
}
this.yh = this.yf - this.yg;
if (this.x9) {
this.aaa(a);
}
else {
this.aal(a);
}
f.cp();
if (a.t) {
this._itemIndexes = d;
this.xp.cq();
}
}
aac(a) {
if (this.xq == null) {
return;
}
this.aae(a);
}
z6(a, b) {
this.xp.co(() => {
if (this.y6 < this.y7 - 1) {
this.y6++;
}
this.zh = truncate(((this.y6 / this.y7) * 100));
if (this.progressiveLoadStatusChanged != null) {
this.progressiveLoadStatusChanged(this, new ProgressiveLoadStatusEventArgs(this.zh));
}
this.aac(this.cw);
this.q2();
if (this.xq != null) {
if (!this.xq.h(this.ka)) {
let c = this.xq;
c.progressiveThunkCompleted = delegateRemove(c.progressiveThunkCompleted, runOn(this, this.z6));
this.zh = 100;
if (this.progressiveLoadStatusChanged != null) {
this.progressiveLoadStatusChanged(this, new ProgressiveLoadStatusEventArgs(this.zh));
}
}
}
});
}
aaa(a) {
let b = arrayShallowClone(this.xz.asArray());
this.xs.k3(boxArray$1(b), 0, b.length, this.xv);
let c = arrayShallowClone(this.x1.asArray());
this.zc = 0;
let d = this.za;
let e = this.x3;
let f = this.xo.length;
this.xu.k3(boxArray$1(c), 0, c.length, this.xw);
let g = 255 << 24 | truncate(this.yp) << 16 | truncate(this.yo) << 8 | truncate(this.yn);
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.y9 || j < 0 || j >= this.y8) {
continue;
}
if (e) {
let k = i - d;
let l = i + d;
l = l > (this.y9 - 1) ? (this.y9 - 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.y9) + o;
if (q < 0 || q > f - 1) {
continue;
}
this.xo[q] = this.xo[q] + 1;
this.xl[q] = 1;
this.zc++;
if (this.x5) {
this._itemIndexes[q] = h + 1;
}
}
}
}
else {
let r = (j * this.y9) + i;
this.xo[r] = this.xo[r] + 1;
this.xl[r] = 1;
this.zc++;
if (this.x5) {
this._itemIndexes[r] = h + 1;
}
}
}
this.aaf();
}
aal(a) {
let b;
let c;
let d = a.getViewInfo(b, c);
b = d.p0;
c = d.p1;
if (this.xq == null) {
return;
}
if (this.ya == null) {
this.ya = new List$1(KDTreeNode2D.$, 2, truncate(Math.round(b.width * b.height)));
}
else {
this.ya.clear();
}
let e = c.left;
let f = c.right;
let g = c.top;
let h = c.bottom;
this.y0 = c.top;
this.yy = c.height;
this.yz = c.left;
this.y1 = c.width;
this.yw = b.top;
this.yu = b.height;
this.yv = b.left;
this.yx = b.width;
let i = this.getEffectiveViewport1(a);
this.yc = (i.left - this.yv) / this.yx;
this.yd = (i.top - this.yw) / this.yu;
let j = (i.right - this.yv) / this.yx;
this.ye = j - this.yc;
let k = (i.bottom - this.yw) / this.yu;
this.yb = k - this.yd;
if (this.x4) {
e = (e - this.yc) / this.ye;
f = (f - this.yc) / this.ye;
g = (g - this.yd) / this.yb;
h = (h - this.yd) / this.yb;
}
let l = this.im / b.width * c.width;
let m = this.im / 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.xq.u(this.ya, o, 0, 1, 0, 1);
let p;
this.zc = 0;
for (let q = 0; q < this.ya.count; q++) {
p = this.ya._inner[q];
this.aag(p);
}
this.aaf();
}
aag(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.aai(a.b, d, b, a.e);
if (c > 0 && !b) {
let e;
for (let f = 0; f < c; f++) {
e = a.a[f];
this.aai(e, d, false, a.e);
}
}
if (a.e != null) {
a.e.a = false;
}
}
gl(a) {
let b = this.dc != null ? this.dc.yv : Rect.empty;
let c = this.dc != null ? this.dc.zd : Rect.empty;
let d = new Rect(0, 0, 0, 1, 1);
let e = this.w8(this.cw);
let f = new ScalerParams(0, d, d, this.xs.dn, e);
let g = new ScalerParams(0, d, d, this.xu.dn, e);
let h = !b.isEmpty && !c.isEmpty && this.dp != null ? this.dp.indexOf(a) : -1;
let i = this.xs != null && this.xz != null && h < this.xz.count ? this.xs.f7(this.xz.item(h), f) : NaN;
let j = this.xu != null && this.x1 != null && h < this.x1.count ? this.xu.f7(this.x1.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;
}
aai(a, b, c, d) {
let e = this.zf(b);
let f = a.c;
let g = this.za;
if (c) {
let h = d.d;
let i = d.b;
let j = d.e;
let k = d.c;
if (this.x4) {
h = this.yc + this.ye * h;
i = this.yc + this.ye * i;
j = this.yd + this.yb * j;
k = this.yd + this.yb * k;
}
let l = truncate((this.yv + this.yx * (h - this.yz) / this.y1));
let m = truncate((this.yv + this.yx * (i - this.yz) / this.y1));
let n = truncate((this.yw + this.yu * (j - this.y0) / this.yy));
let o = truncate((this.yw + this.yu * (k - this.y0) / this.yy));
l = truncate(Math.floor(l));
m = truncate(Math.floor(m));
n = truncate(Math.floor(n));
o = truncate(Math.floor(o));
if (this.x3) {
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.aah(f, s, t, q, r);
}
}
}
else {
let u = a.a;
let v = a.b;
if (this.x4) {
u = this.yc + this.ye * u;
v = this.yd + this.yb * v;
}
let w = truncate((this.yv + this.yx * (u - this.yz) / this.y1));
let x = truncate((this.yw + this.yu * (v - this.y0) / this.yy));
w = truncate(Math.floor(w));
x = truncate(Math.floor(x));
if (this.x3) {
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.aah(f, af, ag, ad, ae);
}
}
}
else {
this.aah(f, w, x, b, 1);
}
}
}
ze(a, b) {
return truncate((Math.floor(255 * b))) << 24 | truncate(Math.floor(b * (this.yp + a * this.yt))) << 16 | truncate(Math.floor(b * (this.yo + a * this.ys))) << 8 | truncate(Math.floor(b * (this.yn + a * this.yr)));
}
zf(a) {
return 255 << 24 | truncate(Math.floor((this.yp + a * this.yt))) << 16 | truncate(Math.floor((this.yo + a * this.ys))) << 8 | truncate(Math.floor((this.yn + a * this.yr)));
}
y2(a) {
return (a >> 24 & 255) / 255;
}
aah(a, b, c, d, e) {
if (b < 0 || b >= this.y9 || c < 0 || c >= this.y8) {
return;
}
let f = (c * this.y9) + b;
this.xo[f] = this.xo[f] + d;
this.xl[f] = this.xl[f] + e;
if (this.x5) {
this._itemIndexes[f] = a + 1;
}
this.zc += truncate(d);
}
aaf() {
let a = 0;
let b = 0;
let c = this.yh;
let d = this.yg;
let e = this.yf;
let f = this.xo.length;
let g = this.xo;
let h = this.xl;
let i = this.xn;
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.ze(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;
}
}
z7(a) {
let b = a;
b.cm();
}
ct() {
return new HighDensityScatterSeriesView(this);
}
rj(a) {
super.rj(a);
this.xp = a;
}
ay(a) {
if (a != null && a == this.xs && this.xz != null) {
return new AxisRange(this.xz.minimum, this.xz.maximum);
}
if (a != null && a == this.xu && this.x1 != null) {
return new AxisRange(this.x1.minimum, this.x1.maximum);
}
return null;
}
ta(a, b) {
if (this.dc != null) {
let c = this.getEffectiveViewport1(this.cw);
this.x4 = !c.isEmpty;
}
this.sa(false);
}
tb(a, b) {
this.sa(false);
}
ky(a) {
if (!this.x5 || this._itemIndexes == null || this.dc == null || this.dp == null || this._itemIndexes.length != (this.y9 * this.y8)) {
return null;
}
let b = this.dc.yv;
let c = (a.x - b.left) / b.width;
let d = (a.y - b.top) / b.height;
let e = truncate(Math.round(this.xf.left + (this.xf.width * c)));
let f = truncate(Math.round(this.xf.top + (this.xf.height * d)));
let g = this.zi(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);
}
zi(a, b) {
let c = (this.y9 * b) + a;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
let d = 1;
c = (this.y9 * (b - d)) + a;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.y9 * (b + d)) + a;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.y9 * (b)) + a - 1;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.y9 * (b)) + a + 1;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.y9 * (b - d)) + a - 1;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.y9 * (b + d)) + a + 1;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.y9 * (b - d)) + a + 1;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.y9 * (b + d)) + a - 1;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
return 0;
}
aak(a, b, c) {
this.xn = a;
this.y9 = b;
this.y8 = c;
}
get_hf() {
return true;
}
set_hf(a) {
super.set_hf(a);
}
pk(a, b) {
super.pk(a, b);
this.xp.cn();
if (this.cv != null) {
this.cv.cn();
}
this.q2();
}
sc(a, b) {
super.sc(a, b);
if (!this.g8) {
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.aab(false, c);
this.g8 = false;
}
r9(a, b, c, d, e) {
super.r9(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.xx == null) {
this.xx = new ScatterFrame();
}
this.aab(false, f);
}
ph() {
super.ph();
this.xs = null;
this.xu = null;
}
}
HighDensityScatterSeries.$t = /*@__PURE__*/ markType(HighDensityScatterSeries, 'HighDensityScatterSeries', Series.$);
HighDensityScatterSeries.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, HighDensityScatterSeries, 'raisePropertyChanged', ['HeatMaximumColor:aa1:aam', [Color.$, Defaults.be], 'HeatMaximum:y3:aan', [1, 50], 'HeatMinimumColor:aa2:aao', [Color.$, Defaults.bf], 'HeatMinimum:y4:aap', [1, 0], 'PointExtent:zg:aaq', [1, 1], 'ProgressiveLoad:x8:aar', [0, true], 'UseBruteForce:x9:aas', [0, false], 'XAxis:xs:aat', [NumericXAxis.$, null], 'XMemberAsLegendLabel:zs:aau', [2, null], 'XMemberAsLegendUnit:zu:aav', [2, null], 'XMemberPath:zw:aaw', [2, null], 'YAxis:xu:aax', [NumericYAxis.$, null], 'YMemberAsLegendLabel:z0:aay', [2, null], 'YMemberAsLegendUnit:z2:aaz', [2, null], 'YMemberPath:z4:aa0', [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.aa2 = Defaults.bf;
this.cf.aa1 = Defaults.be;
this.cf.v1 = Defaults.ba;
this.cf.wh = Defaults.a9;
}
}
cq() {
this.cf.aak(this.cd, this.cl, this.ck);
}
cm() {
if (this.ci == null) {
this.ci = this.f.ka.createElement("canvas");
let a = this.f.ka.get2DCanvasContext(this.ci);
this.cg = new RenderingContext(new CanvasViewRenderer(), a);
}
let b;
if (this.s) {
b = this.b9;
}
else {
b = this.f.dc.y1();
}
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.aak(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.ka != null) {
this.f.ka.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;
})();