igniteui-angular-charts
Version:
Ignite UI Angular charting components for building rich data visualizations for modern web apps.
1,158 lines (1,157 loc) • 42.9 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-angular-core";
import { NumericYAxis } from "./NumericYAxis";
import { Color } from "igniteui-angular-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-angular-core";
import { DataLegendSeriesValueInfo } from "igniteui-angular-core";
import { DataLegendSeriesContext } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { Rect } from "igniteui-angular-core";
import { IFastItemsSource_$type } from "igniteui-angular-core";
import { BrushUtil } from "igniteui-angular-core";
import { SeriesView } from "./SeriesView";
import { TestRandomness } from "igniteui-angular-core";
import { DefaultRandomnessSource } from "igniteui-angular-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-angular-core";
import { truncate, isNaN_, isInfinity, logBase, intDivide } from "igniteui-angular-core";
import { boxArray$1, arrayShallowClone } from "igniteui-angular-core";
import { dateNow } from "igniteui-angular-core";
import { RenderingContext } from "igniteui-angular-core";
import { CanvasViewRenderer } from "igniteui-angular-core";
import { Rectangle } from "igniteui-angular-core";
/**
* @hidden
*/
export let HighDensityScatterSeries = /*@__PURE__*/ (() => {
class HighDensityScatterSeries extends Series {
constructor() {
super();
this.xa = null;
this.xc = null;
this.ym = 0;
this.xf = false;
this.x1 = Defaults.aq.o;
this.x0 = Defaults.aq.n;
this.xz = Defaults.aq.m;
this.xy = Defaults.aq.l;
this.xx = Defaults.ap.o;
this.xw = Defaults.ap.n;
this.xv = Defaults.ap.m;
this.xu = Defaults.ap.l;
this.w2 = null;
this.w7 = null;
this.w8 = null;
this.w3 = null;
this.w5 = null;
this.xh = false;
this.yn = 0;
this.yp = 0;
this.yj = 0;
this.yi = 0;
this.progressiveLoadStatusChanged = null;
this.xm = null;
this.xs = 0;
this.xr = 0;
this.xt = 0;
this.x8 = 0;
this.x6 = 0;
this.x7 = 0;
this.x9 = 0;
this.yb = 0;
this.yd = 0;
this.yc = 0;
this.ya = 0;
this.xo = 0;
this.xp = 0;
this.xq = 0;
this.xn = 0;
this.yl = 0;
this.yk = 0;
this.wz = null;
this.yo = 0;
this.xg = false;
this._itemIndexes = null;
this.w0 = null;
this.wx = null;
this.w9 = null;
this.ab = HighDensityScatterSeries.$;
this.f7 = false;
}
bj() {
return new HighDensityScatterSeries();
}
get_fn() {
return true;
}
jj() {
if (!isNaN_(this.ji)) {
return super.jj();
}
return Defaults.q;
}
get_fv() {
return true;
}
get xb() {
return this.xa;
}
set xb(a) {
if (this.xa != a) {
let b = this.xb;
this.xa = a;
this.raisePropertyChanged("XColumn", b, this.xb);
}
}
getDataLegendSeriesContextAt(a, b) {
let c = { $type: Point_$type, x: a, y: b };
let d = this.km(c);
let e = d == null ? NaN : this.iw(d, "XMemberPath");
let f = d == null ? NaN : this.iw(d, "YMemberPath");
let g = new DataLegendSeriesValueInfo();
g.l = e;
g.a = 13;
g.q = "X";
g.r = this.y8 != null ? this.y8 : "X";
g.s = this.y4 != null ? this.y4 : "X:";
g.t = this.y6 != null ? this.y6 : "";
let h = new DataLegendSeriesValueInfo();
h.l = f;
h.a = 14;
h.q = "Y";
h.r = this.zg != null ? this.zg : "Y";
h.s = this.zc != null ? this.zc : "Y:";
h.t = this.ze != null ? this.ze : "";
let i = new DataLegendSeriesContext();
i.e = ((() => {
let $ret = new List$1(DataLegendSeriesValueInfo.$, 0);
$ret.add(g);
$ret.add(h);
return $ret;
})());
i.h = this.mb();
return i;
}
kp(a, b) {
let c = this.nc(b);
if (c == HighDensityScatterSeries.$$p[10]) {
return this.kq(a, b, this.y8);
}
if (c == HighDensityScatterSeries.$$p[14]) {
return this.kq(a, b, this.zg);
}
return super.kp(a, b);
}
mc(a) {
let b = this.nc(a);
if (b == HighDensityScatterSeries.$$p[10]) {
return this.y8;
}
if (b == HighDensityScatterSeries.$$p[14]) {
return this.zg;
}
return super.mc(a);
}
get xd() {
return this.xc;
}
set xd(a) {
if (this.xc != a) {
let b = this.xd;
this.xc = a;
this.raisePropertyChanged("YColumn", b, this.xd);
}
}
zv() {
if (this.w2 == null) {
return;
}
this.w2.t();
let a = this.w2;
a.progressiveThunkCompleted = delegateRemove(a.progressiveThunkCompleted, runOn(this, this.zi));
this.w2 = null;
}
q8(a, b, c, d) {
super.q8(a, b, c, d);
switch (b) {
case HighDensityScatterSeries.$$p[8]:
case HighDensityScatterSeries.$$p[12]:
case HighDensityScatterSeries.$$p[9]:
case HighDensityScatterSeries.$$p[13]:
this.qe();
break;
case "SeriesViewer":
if (this.db != null) {
let e = this.getEffectiveViewport1(this.cv);
this.xg = !e.isEmpty;
}
break;
case "FastItemsSource":
this.zv();
if (typeCast(IFastItemsSource_$type, c) != null) {
c.deregisterColumn(this.xb);
c.deregisterColumn(this.xd);
this.xb = null;
this.xd = null;
}
if (typeCast(IFastItemsSource_$type, d) != null) {
this.xb = this.dk(this.y8);
this.xd = this.dk(this.zg);
}
if ((this.w6 != null && !this.w6.c1()) || (this.w4 != null && !this.w4.c1())) {
this.rq(this.gf && c != null);
}
this.ql();
break;
case HighDensityScatterSeries.$$p[7]:
let f = this.w3;
this.w3 = this.w4;
this.zv();
if (f != null) {
f.rangeChanged = delegateRemove(f.rangeChanged, runOn(this, this.zl));
}
if (this.w3 != null) {
let g = this.w3;
g.rangeChanged = delegateCombine(g.rangeChanged, runOn(this, this.zl));
}
if (c != null) {
c.b0(this);
}
if (d != null) {
d.ct(this);
}
if ((this.w4 != null && !this.w4.c1()) || (d == null && c != null)) {
this.rq(false);
}
break;
case HighDensityScatterSeries.$$p[11]:
let h = this.w5;
this.w5 = this.w6;
this.zv();
if (h != null) {
h.rangeChanged = delegateRemove(h.rangeChanged, runOn(this, this.zl));
}
if (this.w5 != null) {
let i = this.w5;
i.rangeChanged = delegateCombine(i.rangeChanged, runOn(this, this.zl));
}
if (c != null) {
c.b0(this);
}
if (d != null) {
d.ct(this);
}
if ((this.w6 != null && !this.w6.c1()) || (d == null && c != null)) {
this.rq(false);
}
break;
case "MouseOverEnabled":
this.xh = this.f7;
this.rq(false);
break;
case HighDensityScatterSeries.$$p[10]:
if (this.dn != null) {
this.dn.deregisterColumn(this.xb);
this.xb = this.dk(this.y8);
}
break;
case "XColumn":
this.zv();
if (this.w4 != null && !this.w4.c1()) {
this.rq(false);
}
this.ql();
break;
case HighDensityScatterSeries.$$p[14]:
if (this.dn != null) {
this.dn.deregisterColumn(this.xd);
this.xd = this.dk(this.zg);
}
break;
case "YColumn":
this.zv();
if (this.w6 != null && !this.w6.c1()) {
this.rq(false);
}
this.ql();
break;
case HighDensityScatterSeries.$$p[6]:
this.zv();
this.rq(false);
this.qk();
break;
case HighDensityScatterSeries.$$p[3]:
this.rq(false);
this.qk();
break;
case HighDensityScatterSeries.$$p[1]:
this.rq(false);
this.qk();
break;
case HighDensityScatterSeries.$$p[0]:
case HighDensityScatterSeries.$$p[2]:
if (!this.w1.b4(this.aae, this.aad)) {
return;
}
this.zp();
this.rq(false);
this.qk();
break;
case HighDensityScatterSeries.$$p[4]:
this.ym = Math.max(typeGetValue(d) - 1, 0);
this.xf = this.ym > 0;
this.rq(false);
this.qk();
break;
case HighDensityScatterSeries.$$p[5]:
this.rq(false);
this.qk();
break;
}
}
zp() {
this.xy = this.aae.l;
this.x1 = this.aae.o;
this.x0 = this.aae.n;
this.xz = this.aae.m;
this.xu = this.aad.l;
this.xx = this.aad.o;
this.xw = this.aad.n;
this.xv = this.aad.m;
this.vu = BrushUtil.h(truncate(this.xy), truncate(this.x1), truncate(this.x0), truncate(this.xz));
this.ve = BrushUtil.h(truncate(this.xu), truncate(this.xx), truncate(this.xw), truncate(this.xv));
}
xj(a) {
if (typeCast(NumericYAxis.$, a) !== null) {
return true;
}
return false;
}
xi(a) {
if (typeCast(NumericXAxis.$, a) !== null) {
return true;
}
return false;
}
zl(a, b) {
this.zv();
this.rq(false);
}
get x5() {
return this.xx - this.x1;
}
get x4() {
return this.xw - this.x0;
}
get x3() {
return this.xv - this.xz;
}
get x2() {
return this.xu - this.xy;
}
hd(a, b, c) {
let d = super.hd(a, b, c);
if (this.w6 == null || this.w4 == null || this.w4.bi == null || this.w6.bi == null || this.xd == null || this.xb == null || this.xd.count < 1 || this.xb.count < 1 || this.xd.count != this.xb.count || this.w4.l4 == this.w4.l3 || this.w6.l4 == this.w6.l3 || this.wr.isEmpty) {
d = false;
}
return d;
}
get yt() {
return this.yn;
}
set yt(a) {
let b = this.yn;
this.yn = a;
this.raisePropertyChanged("ProgressiveStatus", b, this.yn);
}
rr(a) {
super.rr(a);
this.zn(a, this.cv);
}
xe() {
if (TestRandomness.instance.testRandomnessSource != null) {
return TestRandomness.instance.testRandomnessSource;
}
return new DefaultRandomnessSource(0);
}
zn(a, b) {
if (this.d5(b)) {
return;
}
if (this.w2 == null && !this.xl) {
let c = new List$1(KDPointData.$, 2, this.xb.count);
let d = this.w4;
let e = this.w6;
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.xb.count; l++) {
j = d.el(this.xb.item(l), h);
k = e.el(this.xd.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.xk) {
this.yi = 1;
this.yj = truncate(logBase(c.count, 2)) + 3;
this.yt = truncate(((this.yi / this.yj) * 100));
if (this.progressiveLoadStatusChanged != null) {
this.progressiveLoadStatusChanged(this, new ProgressiveLoadStatusEventArgs(this.yt));
}
this.w2 = KDTree2D.b(c.toArray(), 1, this.xe());
let m = this.w2;
m.progressiveThunkCompleted = delegateCombine(m.progressiveThunkCompleted, runOn(this, this.zi));
if (!this.w2.h(this.jy)) {
let n = this.w2;
n.progressiveThunkCompleted = delegateRemove(n.progressiveThunkCompleted, runOn(this, this.zi));
}
this.qk();
}
else {
let o = dateNow();
this.w2 = new KDTree2D(0, c.toArray(), 1, this.xe());
let p = dateNow();
}
}
if (this.xk && !this.xl) {
this.zo(b);
}
else {
this.zq(b);
}
}
pa(a, b, c, d) {
super.pa(a, b, c, d);
this.zv();
let e = false;
if (this.w4 != null && !this.w4.c1()) {
e = true;
}
if (this.w6 != null && !this.w6.c1()) {
e = true;
}
if (e) {
this.rq(false);
}
this.ql();
}
zk(a) {
let b = a;
let c = this.yl * this.yk;
if (this.xh) {
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;
}
}
}
}
zq(a) {
let b;
let c;
let d = null;
if (a.q) {
d = this._itemIndexes;
}
let e = a.getViewInfo(c, b);
c = e.p0;
b = e.p1;
let f = a;
let g = this.getEffectiveViewport1(a);
this.w7 = new ScalerParams(0, b, c, this.w3.ch, g);
this.w8 = new ScalerParams(0, b, c, this.w5.ch, g);
this.zj(a);
this.zk(a);
let h = this.yl * this.yk;
if (this.w0 == null || this.w0.length != h) {
this.w0 = new Array(h);
this.wx = new Array(h);
}
let i = this.w0.length;
let j = this.w0;
let k = this.wx;
for (let l = 0; l < i; l++) {
j[l] = 0;
k[l] = 0;
}
this.yp = truncate(Math.round(this.ic));
this.wz = f.b1();
let m = this.wz.length;
let n = this.wz;
for (let o = 0; o < m; o++) {
n[o] = 0;
}
let p = this.yg;
let q = this.yf;
if (isNaN_(p) || isInfinity(p)) {
p = 0;
}
if (isNaN_(q) || isInfinity(q)) {
q = 50;
}
this.xs = Math.min(p, q);
this.xr = Math.max(p, q);
if (this.xs < 0) {
this.xs = 0;
}
if (this.xr < 0) {
this.xr = 0;
}
this.xt = this.xr - this.xs;
if (this.xl) {
this.zm(a);
}
else {
this.zx(a);
}
f.cc();
if (a.q) {
this._itemIndexes = d;
this.w1.cd();
}
}
zo(a) {
if (this.w2 == null) {
return;
}
this.zq(a);
}
zi(a, b) {
this.w1.cb(() => {
if (this.yi < this.yj - 1) {
this.yi++;
}
this.yt = truncate(((this.yi / this.yj) * 100));
if (this.progressiveLoadStatusChanged != null) {
this.progressiveLoadStatusChanged(this, new ProgressiveLoadStatusEventArgs(this.yt));
}
this.zo(this.cv);
this.qk();
if (this.w2 != null) {
if (!this.w2.h(this.jy)) {
let c = this.w2;
c.progressiveThunkCompleted = delegateRemove(c.progressiveThunkCompleted, runOn(this, this.zi));
this.yt = 100;
if (this.progressiveLoadStatusChanged != null) {
this.progressiveLoadStatusChanged(this, new ProgressiveLoadStatusEventArgs(this.yt));
}
}
}
});
}
zm(a) {
let b = arrayShallowClone(this.xb.asArray());
this.w4.hq(boxArray$1(b), 0, b.length, this.w7);
let c = arrayShallowClone(this.xd.asArray());
this.yo = 0;
let d = this.ym;
let e = this.xf;
let f = this.w0.length;
this.w6.hq(boxArray$1(c), 0, c.length, this.w8);
let g = 255 << 24 | truncate(this.x1) << 16 | truncate(this.x0) << 8 | truncate(this.xz);
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.yl || j < 0 || j >= this.yk) {
continue;
}
if (e) {
let k = i - d;
let l = i + d;
l = l > (this.yl - 1) ? (this.yl - 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.yl) + o;
if (q < 0 || q > f - 1) {
continue;
}
this.w0[q] = this.w0[q] + 1;
this.wx[q] = 1;
this.yo++;
if (this.xh) {
this._itemIndexes[q] = h + 1;
}
}
}
}
else {
let r = (j * this.yl) + i;
this.w0[r] = this.w0[r] + 1;
this.wx[r] = 1;
this.yo++;
if (this.xh) {
this._itemIndexes[r] = h + 1;
}
}
}
this.zr();
}
zx(a) {
let b;
let c;
let d = a.getViewInfo(b, c);
b = d.p0;
c = d.p1;
if (this.w2 == null) {
return;
}
if (this.xm == null) {
this.xm = new List$1(KDTreeNode2D.$, 2, truncate(Math.round(b.width * b.height)));
}
else {
this.xm.clear();
}
let e = c.left;
let f = c.right;
let g = c.top;
let h = c.bottom;
this.yc = c.top;
this.ya = c.height;
this.yb = c.left;
this.yd = c.width;
this.x8 = b.top;
this.x6 = b.height;
this.x7 = b.left;
this.x9 = b.width;
let i = this.getEffectiveViewport1(a);
this.xo = (i.left - this.x7) / this.x9;
this.xp = (i.top - this.x8) / this.x6;
let j = (i.right - this.x7) / this.x9;
this.xq = j - this.xo;
let k = (i.bottom - this.x8) / this.x6;
this.xn = k - this.xp;
if (this.xg) {
e = (e - this.xo) / this.xq;
f = (f - this.xo) / this.xq;
g = (g - this.xp) / this.xn;
h = (h - this.xp) / this.xn;
}
let l = this.ic / b.width * c.width;
let m = this.ic / 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.w2.u(this.xm, o, 0, 1, 0, 1);
let p;
this.yo = 0;
for (let q = 0; q < this.xm.count; q++) {
p = this.xm._inner[q];
this.zs(p);
}
this.zr();
}
zs(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.zu(a.b, d, b, a.e);
if (c > 0 && !b) {
let e;
for (let f = 0; f < c; f++) {
e = a.a[f];
this.zu(e, d, false, a.e);
}
}
if (a.e != null) {
a.e.a = false;
}
}
gc(a) {
let b = this.db != null ? this.db.v4 : Rect.empty;
let c = this.db != null ? this.db.wk : Rect.empty;
let d = new Rect(0, 0, 0, 1, 1);
let e = this.wk(this.cv);
let f = new ScalerParams(0, d, d, this.w4.ch, e);
let g = new ScalerParams(0, d, d, this.w6.ch, e);
let h = !b.isEmpty && !c.isEmpty && this.dn != null ? this.dn.indexOf(a) : -1;
let i = this.w4 != null && this.xb != null && h < this.xb.count ? this.w4.el(this.xb.item(h), f) : NaN;
let j = this.w6 != null && this.xd != null && h < this.xd.count ? this.w6.el(this.xd.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.c3 != null) {
this.c3.au(this.db, b, true);
}
return h >= 0;
}
zu(a, b, c, d) {
let e = this.yr(b);
let f = a.c;
let g = this.ym;
if (c) {
let h = d.d;
let i = d.b;
let j = d.e;
let k = d.c;
if (this.xg) {
h = this.xo + this.xq * h;
i = this.xo + this.xq * i;
j = this.xp + this.xn * j;
k = this.xp + this.xn * k;
}
let l = truncate((this.x7 + this.x9 * (h - this.yb) / this.yd));
let m = truncate((this.x7 + this.x9 * (i - this.yb) / this.yd));
let n = truncate((this.x8 + this.x6 * (j - this.yc) / this.ya));
let o = truncate((this.x8 + this.x6 * (k - this.yc) / this.ya));
l = truncate(Math.floor(l));
m = truncate(Math.floor(m));
n = truncate(Math.floor(n));
o = truncate(Math.floor(o));
if (this.xf) {
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.zt(f, s, t, q, r);
}
}
}
else {
let u = a.a;
let v = a.b;
if (this.xg) {
u = this.xo + this.xq * u;
v = this.xp + this.xn * v;
}
let w = truncate((this.x7 + this.x9 * (u - this.yb) / this.yd));
let x = truncate((this.x8 + this.x6 * (v - this.yc) / this.ya));
w = truncate(Math.floor(w));
x = truncate(Math.floor(x));
if (this.xf) {
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.zt(f, af, ag, ad, ae);
}
}
}
else {
this.zt(f, w, x, b, 1);
}
}
}
yq(a, b) {
return truncate((Math.floor(255 * b))) << 24 | truncate(Math.floor(b * (this.x1 + a * this.x5))) << 16 | truncate(Math.floor(b * (this.x0 + a * this.x4))) << 8 | truncate(Math.floor(b * (this.xz + a * this.x3)));
}
yr(a) {
return 255 << 24 | truncate(Math.floor((this.x1 + a * this.x5))) << 16 | truncate(Math.floor((this.x0 + a * this.x4))) << 8 | truncate(Math.floor((this.xz + a * this.x3)));
}
ye(a) {
return (a >> 24 & 255) / 255;
}
zt(a, b, c, d, e) {
if (b < 0 || b >= this.yl || c < 0 || c >= this.yk) {
return;
}
let f = (c * this.yl) + b;
this.w0[f] = this.w0[f] + d;
this.wx[f] = this.wx[f] + e;
if (this.xh) {
this._itemIndexes[f] = a + 1;
}
this.yo += truncate(d);
}
zr() {
let a = 0;
let b = 0;
let c = this.xt;
let d = this.xs;
let e = this.xr;
let f = this.w0.length;
let g = this.w0;
let h = this.wx;
let i = this.wz;
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.yq(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;
}
}
zj(a) {
let b = a;
b.b9();
}
cs() {
return new HighDensityScatterSeriesView(this);
}
q0(a) {
super.q0(a);
this.w1 = a;
}
ay(a) {
if (a != null && a == this.w4 && this.xb != null) {
return new AxisRange(this.xb.minimum, this.xb.maximum);
}
if (a != null && a == this.w6 && this.xd != null) {
return new AxisRange(this.xd.minimum, this.xd.maximum);
}
return null;
}
sp(a, b) {
if (this.db != null) {
let c = this.getEffectiveViewport1(this.cv);
this.xg = !c.isEmpty;
}
this.rq(false);
}
sq(a, b) {
this.rq(false);
}
km(a) {
if (!this.xh || this._itemIndexes == null || this.db == null || this.dn == null || this._itemIndexes.length != (this.yl * this.yk)) {
return null;
}
let b = this.db.v4;
let c = (a.x - b.left) / b.width;
let d = (a.y - b.top) / b.height;
let e = truncate(Math.round(this.wr.left + (this.wr.width * c)));
let f = truncate(Math.round(this.wr.top + (this.wr.height * d)));
let g = this.yu(e, f);
if (g < 0 || g > this._itemIndexes.length - 1) {
return null;
}
let h = this._itemIndexes[g] - 1;
if (h < 0 || h > this.dn.count) {
return null;
}
return this.dn.item(h);
}
yu(a, b) {
let c = (this.yl * b) + a;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
let d = 1;
c = (this.yl * (b - d)) + a;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.yl * (b + d)) + a;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.yl * (b)) + a - 1;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.yl * (b)) + a + 1;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.yl * (b - d)) + a - 1;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.yl * (b + d)) + a + 1;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.yl * (b - d)) + a + 1;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.yl * (b + d)) + a - 1;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
return 0;
}
zw(a, b, c) {
this.wz = a;
this.yl = b;
this.yk = c;
}
get_g6() {
return true;
}
set_g6(a) {
super.set_g6(a);
}
o4(a, b) {
super.o4(a, b);
this.w1.ca();
if (this.cu != null) {
this.cu.ca();
}
this.qk();
}
rs(a, b) {
super.rs(a, b);
if (!this.gz) {
this.cv.a4(b);
return;
}
this.cv.a4(b);
if (this.d5(this.cu)) {
return;
}
let c = typeCast(HighDensityScatterSeriesView.$, this.cu);
let d = new ScatterFrame();
this.zn(false, c);
this.gz = false;
}
rp(a, b, c, d, e) {
super.rp(a, b, c, d, e);
let f = this.ba.a$j.item(d);
let g = f;
f.a3(c);
if (this.d5(g)) {
return;
}
if (this.w9 == null) {
this.w9 = new ScatterFrame();
}
this.zn(false, f);
}
o1() {
super.o1();
this.w4 = null;
this.w6 = null;
}
}
HighDensityScatterSeries.$t = markType(HighDensityScatterSeries, 'HighDensityScatterSeries', Series.$);
HighDensityScatterSeries.$$p = markDep(DependencyProperty, PropertyMetadata, HighDensityScatterSeries, 'raisePropertyChanged', ['HeatMaximumColor:aad:zy', [Color.$, Defaults.ap], 'HeatMaximum:yf:zz', [1, 50], 'HeatMinimumColor:aae:z0', [Color.$, Defaults.aq], 'HeatMinimum:yg:z1', [1, 0], 'PointExtent:ys:z2', [1, 1], 'ProgressiveLoad:xk:z3', [0, true], 'UseBruteForce:xl:z4', [0, false], 'XAxis:w4:z5', [NumericXAxis.$, null], 'XMemberAsLegendLabel:y4:z6', [2, null], 'XMemberAsLegendUnit:y6:z7', [2, null], 'XMemberPath:y8:z8', [2, null], 'YAxis:w6:z9', [NumericYAxis.$, null], 'YMemberAsLegendLabel:zc:aaa', [2, null], 'YMemberAsLegendUnit:ze:aab', [2, null], 'YMemberPath:zg:aac', [2, null]]);
return HighDensityScatterSeries;
})();
/**
* @hidden
*/
export let HighDensityScatterSeriesView = /*@__PURE__*/ (() => {
class HighDensityScatterSeriesView extends SeriesView {
constructor(a) {
super(a);
this.b2 = null;
this.b0 = null;
this.b8 = 0;
this.b7 = 0;
this.b5 = null;
this.b6 = null;
this.b3 = null;
this.b2 = a;
}
au() {
super.au();
if (!this.q) {
this.b2.aae = Defaults.aq;
this.b2.aad = Defaults.ap;
this.b2.ve = Defaults.al;
this.b2.vu = Defaults.ak;
}
}
cd() {
this.b2.zw(this.b0, this.b8, this.b7);
}
b9() {
if (this.b5 == null) {
this.b5 = this.e.jy.createElement("canvas");
let a = this.e.jy.get2DCanvasContext(this.b5);
this.b3 = new RenderingContext(new CanvasViewRenderer(), a);
}
let b;
if (this.p) {
b = this.bx;
}
else {
b = this.e.db.v9();
}
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.b8;
let h = this.b7;
this.b8 = e;
this.b7 = f;
if (g != this.b8 || h != this.b7 || this.b0 == null) {
this.b5.setAttribute("width", e.toString());
this.b5.setAttribute("height", f.toString());
this.b6 = this.b3.h().getImageData(0, 0, e, f);
let imageDataArray_ = this.b6.data;
this.b0 = imageDataArray_;
}
this.b2.zw(this.b0, this.b8, this.b7);
}
b1() {
return this.b0;
}
cc() {
let a = truncate(Math.round(this.bx.left));
let b = truncate(Math.round(this.bx.left));
let c = truncate(Math.round(this.bx.width));
let d = truncate(Math.round(this.bx.height));
this.b3.h().putImageData(this.b6, 0, 0);
this.as();
}
cb(a) {
if (this.e.jy != null) {
this.e.jy.setTimeout(a, 0);
}
else {
window.setTimeout(a, 0);
}
}
a8(a, b) {
super.a8(a, b);
if (b) {
if (!this.b2.f7) {
return;
}
let c = new Rectangle();
c.n = this.bx.left;
c.o = this.bx.top;
c.width = this.bx.width;
c.height = this.bx.height;
c._fill = this.br();
a.w(c);
return;
}
if (this.b5 == null) {
return;
}
let d = truncate(Math.round(this.bx.left));
let e = truncate(Math.round(this.bx.top));
let f = truncate(Math.round(this.bx.width));
let g = truncate(Math.round(this.bx.height));
this.k.o(this.b5.getNativeElement(), this.e._opacity, d, e, f, g, d, e, f, g);
}
b4(a, b) {
return Color.e(toNullable(Color.$, a), toNullable(Color.$, null)) && Color.e(toNullable(Color.$, b), toNullable(Color.$, null));
}
ca() {
if (this.b0 != null) {
for (let a = 0; a < this.b0.length; a++) {
this.b0[a] = 0;
}
this.cc();
}
}
an(a) {
super.an(a);
if (this.b0 == null) {
this.e.bc.exportSeriesPixelsData(a, null, this.b8, this.b7);
return;
}
let b = new Array(intDivide(this.b0.length, 4));
let c;
for (let d = 0; d < intDivide(this.b0.length, 4); d++) {
c = d * 4;
b[d] = this.b0[c + 3] << 24 | this.b0[c] << 16 | this.b0[c + 1] << 8 | this.b0[c + 2];
}
this.e.bc.exportSeriesPixelsData(a, b, this.b8, this.b7);
}
}
HighDensityScatterSeriesView.$t = markType(HighDensityScatterSeriesView, 'HighDensityScatterSeriesView', SeriesView.$);
return HighDensityScatterSeriesView;
})();