igniteui-angular-charts
Version:
Ignite UI Angular charting components for building rich data visualizations for modern web apps.
1,158 lines (1,157 loc) • 43 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.xv = null;
this.xx = null;
this.y7 = 0;
this.x0 = false;
this.ym = Defaults.bf.o;
this.yl = Defaults.bf.n;
this.yk = Defaults.bf.m;
this.yj = Defaults.bf.l;
this.yi = Defaults.be.o;
this.yh = Defaults.be.n;
this.yg = Defaults.be.m;
this.yf = Defaults.be.l;
this.xn = null;
this.xs = null;
this.xt = null;
this.xo = null;
this.xq = null;
this.x2 = false;
this.y8 = 0;
this.za = 0;
this.y4 = 0;
this.y3 = 0;
this.progressiveLoadStatusChanged = null;
this.x7 = null;
this.yd = 0;
this.yc = 0;
this.ye = 0;
this.yt = 0;
this.yr = 0;
this.ys = 0;
this.yu = 0;
this.yw = 0;
this.yy = 0;
this.yx = 0;
this.yv = 0;
this.x9 = 0;
this.ya = 0;
this.yb = 0;
this.x8 = 0;
this.y6 = 0;
this.y5 = 0;
this.xk = null;
this.y9 = 0;
this.x1 = false;
this._itemIndexes = null;
this.xl = null;
this.xi = null;
this.xu = null;
this.ab = HighDensityScatterSeries.$;
this.ge = false;
}
bk() {
return new HighDensityScatterSeries();
}
get_fr() {
return true;
}
js() {
if (!isNaN_(this.jr)) {
return super.js();
}
return Defaults.ad;
}
get_fz() {
return true;
}
get xw() {
return this.xv;
}
set xw(a) {
if (this.xv != a) {
let b = this.xw;
this.xv = a;
this.raisePropertyChanged("XColumn", b, this.xw);
}
}
getDataLegendSeriesContextAt(a, b) {
let c = { $type: Point_$type, x: a, y: b };
let d = this.kw(c);
let e = d == null ? NaN : this.i4(d, "XMemberPath");
let f = d == null ? NaN : this.i4(d, "YMemberPath");
let g = new DataLegendSeriesValueInfo();
g.l = e;
g.a = 13;
g.q = "X";
g.r = this.zt != null ? this.zt : "X";
g.s = this.zp != null ? this.zp : "X:";
g.t = this.zr != null ? this.zr : "";
let h = new DataLegendSeriesValueInfo();
h.l = f;
h.a = 14;
h.q = "Y";
h.r = this.z1 != null ? this.z1 : "Y";
h.s = this.zx != null ? this.zx : "Y:";
h.t = this.zz != null ? this.zz : "";
let i = new DataLegendSeriesContext();
i.e = ((() => {
let $ret = new List$1(DataLegendSeriesValueInfo.$, 0);
$ret.add(g);
$ret.add(h);
return $ret;
})());
i.h = this.mn();
return i;
}
kz(a, b) {
let c = this.no(b);
if (c == HighDensityScatterSeries.$$p[10]) {
return this.k0(a, b, this.zt);
}
if (c == HighDensityScatterSeries.$$p[14]) {
return this.k0(a, b, this.z1);
}
return super.kz(a, b);
}
mo(a) {
let b = this.no(a);
if (b == HighDensityScatterSeries.$$p[10]) {
return this.zt;
}
if (b == HighDensityScatterSeries.$$p[14]) {
return this.z1;
}
return super.mo(a);
}
get xy() {
return this.xx;
}
set xy(a) {
if (this.xx != a) {
let b = this.xy;
this.xx = a;
this.raisePropertyChanged("YColumn", b, this.xy);
}
}
aag() {
if (this.xn == null) {
return;
}
this.xn.t();
let a = this.xn;
a.progressiveThunkCompleted = delegateRemove(a.progressiveThunkCompleted, runOn(this, this.z3));
this.xn = null;
}
rp(a, b, c, d) {
super.rp(a, b, c, d);
switch (b) {
case HighDensityScatterSeries.$$p[8]:
case HighDensityScatterSeries.$$p[12]:
case HighDensityScatterSeries.$$p[9]:
case HighDensityScatterSeries.$$p[13]:
this.qt();
break;
case "SeriesViewer":
if (this.dc != null) {
let e = this.getEffectiveViewport1(this.cw);
this.x1 = !e.isEmpty;
}
break;
case "FastItemsSource":
this.aag();
if (typeCast(IFastItemsSource_$type, c) != null) {
c.deregisterColumn(this.xw);
c.deregisterColumn(this.xy);
this.xw = null;
this.xy = null;
}
if (typeCast(IFastItemsSource_$type, d) != null) {
this.xw = this.dl(this.zt);
this.xy = this.dl(this.z1);
}
if ((this.xr != null && !this.xr.ec()) || (this.xp != null && !this.xp.ec())) {
this.r7(this.gm && c != null);
}
this.q0();
break;
case HighDensityScatterSeries.$$p[7]:
let f = this.xo;
this.xo = this.xp;
this.aag();
if (f != null) {
f.rangeChanged = delegateRemove(f.rangeChanged, runOn(this, this.z6));
}
if (this.xo != null) {
let g = this.xo;
g.rangeChanged = delegateCombine(g.rangeChanged, runOn(this, this.z6));
}
if (c != null) {
c.cx(this);
}
if (d != null) {
d.d3(this);
}
if ((this.xp != null && !this.xp.ec()) || (d == null && c != null)) {
this.r7(false);
}
break;
case HighDensityScatterSeries.$$p[11]:
let h = this.xq;
this.xq = this.xr;
this.aag();
if (h != null) {
h.rangeChanged = delegateRemove(h.rangeChanged, runOn(this, this.z6));
}
if (this.xq != null) {
let i = this.xq;
i.rangeChanged = delegateCombine(i.rangeChanged, runOn(this, this.z6));
}
if (c != null) {
c.cx(this);
}
if (d != null) {
d.d3(this);
}
if ((this.xr != null && !this.xr.ec()) || (d == null && c != null)) {
this.r7(false);
}
break;
case "MouseOverEnabled":
this.x2 = this.ge;
this.r7(false);
break;
case HighDensityScatterSeries.$$p[10]:
if (this.dp != null) {
this.dp.deregisterColumn(this.xw);
this.xw = this.dl(this.zt);
}
break;
case "XColumn":
this.aag();
if (this.xp != null && !this.xp.ec()) {
this.r7(false);
}
this.q0();
break;
case HighDensityScatterSeries.$$p[14]:
if (this.dp != null) {
this.dp.deregisterColumn(this.xy);
this.xy = this.dl(this.z1);
}
break;
case "YColumn":
this.aag();
if (this.xr != null && !this.xr.ec()) {
this.r7(false);
}
this.q0();
break;
case HighDensityScatterSeries.$$p[6]:
this.aag();
this.r7(false);
this.qz();
break;
case HighDensityScatterSeries.$$p[3]:
this.r7(false);
this.qz();
break;
case HighDensityScatterSeries.$$p[1]:
this.r7(false);
this.qz();
break;
case HighDensityScatterSeries.$$p[0]:
case HighDensityScatterSeries.$$p[2]:
if (!this.xm.ch(this.aaz, this.aay)) {
return;
}
this.aaa();
this.r7(false);
this.qz();
break;
case HighDensityScatterSeries.$$p[4]:
this.y7 = Math.max(typeGetValue(d) - 1, 0);
this.x0 = this.y7 > 0;
this.r7(false);
this.qz();
break;
case HighDensityScatterSeries.$$p[5]:
this.r7(false);
this.qz();
break;
}
}
aaa() {
this.yj = this.aaz.l;
this.ym = this.aaz.o;
this.yl = this.aaz.n;
this.yk = this.aaz.m;
this.yf = this.aay.l;
this.yi = this.aay.o;
this.yh = this.aay.n;
this.yg = this.aay.m;
this.we = BrushUtil.j(truncate(this.yj), truncate(this.ym), truncate(this.yl), truncate(this.yk));
this.vy = BrushUtil.j(truncate(this.yf), truncate(this.yi), truncate(this.yh), truncate(this.yg));
}
x4(a) {
if (typeCast(NumericYAxis.$, a) !== null) {
return true;
}
return false;
}
x3(a) {
if (typeCast(NumericXAxis.$, a) !== null) {
return true;
}
return false;
}
z6(a, b) {
this.aag();
this.r7(false);
}
get yq() {
return this.yi - this.ym;
}
get yp() {
return this.yh - this.yl;
}
get yo() {
return this.yg - this.yk;
}
get yn() {
return this.yf - this.yj;
}
hk(a, b, c) {
let d = super.hk(a, b, c);
if (this.xr == null || this.xp == null || this.xp.b2 == null || this.xr.b2 == null || this.xy == null || this.xw == null || this.xy.count < 1 || this.xw.count < 1 || this.xy.count != this.xw.count || this.xp.qt == this.xp.qs || this.xr.qt == this.xr.qs || this.xc.isEmpty) {
d = false;
}
return d;
}
get ze() {
return this.y8;
}
set ze(a) {
let b = this.y8;
this.y8 = a;
this.raisePropertyChanged("ProgressiveStatus", b, this.y8);
}
r8(a) {
super.r8(a);
this.z8(a, this.cw);
}
xz() {
if (TestRandomness.instance.testRandomnessSource != null) {
return TestRandomness.instance.testRandomnessSource;
}
return new DefaultRandomnessSource(0);
}
z8(a, b) {
if (this.d7(b)) {
return;
}
if (this.xn == null && !this.x6) {
let c = new List$1(KDPointData.$, 2, this.xw.count);
let d = this.xp;
let e = this.xr;
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.xw.count; l++) {
j = d.f5(this.xw.item(l), h);
k = e.f5(this.xy.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.x5) {
this.y3 = 1;
this.y4 = truncate(logBase(c.count, 2)) + 3;
this.ze = truncate(((this.y3 / this.y4) * 100));
if (this.progressiveLoadStatusChanged != null) {
this.progressiveLoadStatusChanged(this, new ProgressiveLoadStatusEventArgs(this.ze));
}
this.xn = KDTree2D.b(c.toArray(), 1, this.xz());
let m = this.xn;
m.progressiveThunkCompleted = delegateCombine(m.progressiveThunkCompleted, runOn(this, this.z3));
if (!this.xn.h(this.j8)) {
let n = this.xn;
n.progressiveThunkCompleted = delegateRemove(n.progressiveThunkCompleted, runOn(this, this.z3));
}
this.qz();
}
else {
let o = dateNow();
this.xn = new KDTree2D(0, c.toArray(), 1, this.xz());
let p = dateNow();
}
}
if (this.x5 && !this.x6) {
this.z9(b);
}
else {
this.aab(b);
}
}
pn(a, b, c, d) {
super.pn(a, b, c, d);
this.aag();
let e = false;
if (this.xp != null && !this.xp.ec()) {
e = true;
}
if (this.xr != null && !this.xr.ec()) {
e = true;
}
if (e) {
this.r7(false);
}
this.q0();
}
z5(a) {
let b = a;
let c = this.y6 * this.y5;
if (this.x2) {
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;
}
}
}
}
aab(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.xs = new ScalerParams(0, b, c, this.xo.dn, g);
this.xt = new ScalerParams(0, b, c, this.xq.dn, g);
this.z4(a);
this.z5(a);
let h = this.y6 * this.y5;
if (this.xl == null || this.xl.length != h) {
this.xl = new Array(h);
this.xi = new Array(h);
}
let i = this.xl.length;
let j = this.xl;
let k = this.xi;
for (let l = 0; l < i; l++) {
j[l] = 0;
k[l] = 0;
}
this.za = truncate(Math.round(this.ik));
this.xk = f.ce();
let m = this.xk.length;
let n = this.xk;
for (let o = 0; o < m; o++) {
n[o] = 0;
}
let p = this.y1;
let q = this.y0;
if (isNaN_(p) || isInfinity(p)) {
p = 0;
}
if (isNaN_(q) || isInfinity(q)) {
q = 50;
}
this.yd = Math.min(p, q);
this.yc = Math.max(p, q);
if (this.yd < 0) {
this.yd = 0;
}
if (this.yc < 0) {
this.yc = 0;
}
this.ye = this.yc - this.yd;
if (this.x6) {
this.z7(a);
}
else {
this.aai(a);
}
f.cp();
if (a.t) {
this._itemIndexes = d;
this.xm.cq();
}
}
z9(a) {
if (this.xn == null) {
return;
}
this.aab(a);
}
z3(a, b) {
this.xm.co(() => {
if (this.y3 < this.y4 - 1) {
this.y3++;
}
this.ze = truncate(((this.y3 / this.y4) * 100));
if (this.progressiveLoadStatusChanged != null) {
this.progressiveLoadStatusChanged(this, new ProgressiveLoadStatusEventArgs(this.ze));
}
this.z9(this.cw);
this.qz();
if (this.xn != null) {
if (!this.xn.h(this.j8)) {
let c = this.xn;
c.progressiveThunkCompleted = delegateRemove(c.progressiveThunkCompleted, runOn(this, this.z3));
this.ze = 100;
if (this.progressiveLoadStatusChanged != null) {
this.progressiveLoadStatusChanged(this, new ProgressiveLoadStatusEventArgs(this.ze));
}
}
}
});
}
z7(a) {
let b = arrayShallowClone(this.xw.asArray());
this.xp.ky(boxArray$1(b), 0, b.length, this.xs);
let c = arrayShallowClone(this.xy.asArray());
this.y9 = 0;
let d = this.y7;
let e = this.x0;
let f = this.xl.length;
this.xr.ky(boxArray$1(c), 0, c.length, this.xt);
let g = 255 << 24 | truncate(this.ym) << 16 | truncate(this.yl) << 8 | truncate(this.yk);
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.y6 || j < 0 || j >= this.y5) {
continue;
}
if (e) {
let k = i - d;
let l = i + d;
l = l > (this.y6 - 1) ? (this.y6 - 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.y6) + o;
if (q < 0 || q > f - 1) {
continue;
}
this.xl[q] = this.xl[q] + 1;
this.xi[q] = 1;
this.y9++;
if (this.x2) {
this._itemIndexes[q] = h + 1;
}
}
}
}
else {
let r = (j * this.y6) + i;
this.xl[r] = this.xl[r] + 1;
this.xi[r] = 1;
this.y9++;
if (this.x2) {
this._itemIndexes[r] = h + 1;
}
}
}
this.aac();
}
aai(a) {
let b;
let c;
let d = a.getViewInfo(b, c);
b = d.p0;
c = d.p1;
if (this.xn == null) {
return;
}
if (this.x7 == null) {
this.x7 = new List$1(KDTreeNode2D.$, 2, truncate(Math.round(b.width * b.height)));
}
else {
this.x7.clear();
}
let e = c.left;
let f = c.right;
let g = c.top;
let h = c.bottom;
this.yx = c.top;
this.yv = c.height;
this.yw = c.left;
this.yy = c.width;
this.yt = b.top;
this.yr = b.height;
this.ys = b.left;
this.yu = b.width;
let i = this.getEffectiveViewport1(a);
this.x9 = (i.left - this.ys) / this.yu;
this.ya = (i.top - this.yt) / this.yr;
let j = (i.right - this.ys) / this.yu;
this.yb = j - this.x9;
let k = (i.bottom - this.yt) / this.yr;
this.x8 = k - this.ya;
if (this.x1) {
e = (e - this.x9) / this.yb;
f = (f - this.x9) / this.yb;
g = (g - this.ya) / this.x8;
h = (h - this.ya) / this.x8;
}
let l = this.ik / b.width * c.width;
let m = this.ik / 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.xn.u(this.x7, o, 0, 1, 0, 1);
let p;
this.y9 = 0;
for (let q = 0; q < this.x7.count; q++) {
p = this.x7._inner[q];
this.aad(p);
}
this.aac();
}
aad(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.aaf(a.b, d, b, a.e);
if (c > 0 && !b) {
let e;
for (let f = 0; f < c; f++) {
e = a.a[f];
this.aaf(e, d, false, a.e);
}
}
if (a.e != null) {
a.e.a = false;
}
}
gj(a) {
let b = this.dc != null ? this.dc.yr : Rect.empty;
let c = this.dc != null ? this.dc.y9 : Rect.empty;
let d = new Rect(0, 0, 0, 1, 1);
let e = this.w5(this.cw);
let f = new ScalerParams(0, d, d, this.xp.dn, e);
let g = new ScalerParams(0, d, d, this.xr.dn, e);
let h = !b.isEmpty && !c.isEmpty && this.dp != null ? this.dp.indexOf(a) : -1;
let i = this.xp != null && this.xw != null && h < this.xw.count ? this.xp.f5(this.xw.item(h), f) : NaN;
let j = this.xr != null && this.xy != null && h < this.xy.count ? this.xr.f5(this.xy.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;
}
aaf(a, b, c, d) {
let e = this.zc(b);
let f = a.c;
let g = this.y7;
if (c) {
let h = d.d;
let i = d.b;
let j = d.e;
let k = d.c;
if (this.x1) {
h = this.x9 + this.yb * h;
i = this.x9 + this.yb * i;
j = this.ya + this.x8 * j;
k = this.ya + this.x8 * k;
}
let l = truncate((this.ys + this.yu * (h - this.yw) / this.yy));
let m = truncate((this.ys + this.yu * (i - this.yw) / this.yy));
let n = truncate((this.yt + this.yr * (j - this.yx) / this.yv));
let o = truncate((this.yt + this.yr * (k - this.yx) / this.yv));
l = truncate(Math.floor(l));
m = truncate(Math.floor(m));
n = truncate(Math.floor(n));
o = truncate(Math.floor(o));
if (this.x0) {
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.aae(f, s, t, q, r);
}
}
}
else {
let u = a.a;
let v = a.b;
if (this.x1) {
u = this.x9 + this.yb * u;
v = this.ya + this.x8 * v;
}
let w = truncate((this.ys + this.yu * (u - this.yw) / this.yy));
let x = truncate((this.yt + this.yr * (v - this.yx) / this.yv));
w = truncate(Math.floor(w));
x = truncate(Math.floor(x));
if (this.x0) {
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.aae(f, af, ag, ad, ae);
}
}
}
else {
this.aae(f, w, x, b, 1);
}
}
}
zb(a, b) {
return truncate((Math.floor(255 * b))) << 24 | truncate(Math.floor(b * (this.ym + a * this.yq))) << 16 | truncate(Math.floor(b * (this.yl + a * this.yp))) << 8 | truncate(Math.floor(b * (this.yk + a * this.yo)));
}
zc(a) {
return 255 << 24 | truncate(Math.floor((this.ym + a * this.yq))) << 16 | truncate(Math.floor((this.yl + a * this.yp))) << 8 | truncate(Math.floor((this.yk + a * this.yo)));
}
yz(a) {
return (a >> 24 & 255) / 255;
}
aae(a, b, c, d, e) {
if (b < 0 || b >= this.y6 || c < 0 || c >= this.y5) {
return;
}
let f = (c * this.y6) + b;
this.xl[f] = this.xl[f] + d;
this.xi[f] = this.xi[f] + e;
if (this.x2) {
this._itemIndexes[f] = a + 1;
}
this.y9 += truncate(d);
}
aac() {
let a = 0;
let b = 0;
let c = this.ye;
let d = this.yd;
let e = this.yc;
let f = this.xl.length;
let g = this.xl;
let h = this.xi;
let i = this.xk;
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.zb(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;
}
}
z4(a) {
let b = a;
b.cm();
}
ct() {
return new HighDensityScatterSeriesView(this);
}
rg(a) {
super.rg(a);
this.xm = a;
}
ay(a) {
if (a != null && a == this.xp && this.xw != null) {
return new AxisRange(this.xw.minimum, this.xw.maximum);
}
if (a != null && a == this.xr && this.xy != null) {
return new AxisRange(this.xy.minimum, this.xy.maximum);
}
return null;
}
s7(a, b) {
if (this.dc != null) {
let c = this.getEffectiveViewport1(this.cw);
this.x1 = !c.isEmpty;
}
this.r7(false);
}
s8(a, b) {
this.r7(false);
}
kw(a) {
if (!this.x2 || this._itemIndexes == null || this.dc == null || this.dp == null || this._itemIndexes.length != (this.y6 * this.y5)) {
return null;
}
let b = this.dc.yr;
let c = (a.x - b.left) / b.width;
let d = (a.y - b.top) / b.height;
let e = truncate(Math.round(this.xc.left + (this.xc.width * c)));
let f = truncate(Math.round(this.xc.top + (this.xc.height * d)));
let g = this.zf(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);
}
zf(a, b) {
let c = (this.y6 * b) + a;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
let d = 1;
c = (this.y6 * (b - d)) + a;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.y6 * (b + d)) + a;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.y6 * (b)) + a - 1;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.y6 * (b)) + a + 1;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.y6 * (b - d)) + a - 1;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.y6 * (b + d)) + a + 1;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.y6 * (b - d)) + a + 1;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
c = (this.y6 * (b + d)) + a - 1;
if (c > 0 && c < this._itemIndexes.length && this._itemIndexes[c] > 0) {
return c;
}
return 0;
}
aah(a, b, c) {
this.xk = a;
this.y6 = b;
this.y5 = c;
}
get_hd() {
return true;
}
set_hd(a) {
super.set_hd(a);
}
ph(a, b) {
super.ph(a, b);
this.xm.cn();
if (this.cv != null) {
this.cv.cn();
}
this.qz();
}
r9(a, b) {
super.r9(a, b);
if (!this.g6) {
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.z8(false, c);
this.g6 = false;
}
r6(a, b, c, d, e) {
super.r6(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.xu == null) {
this.xu = new ScatterFrame();
}
this.z8(false, f);
}
pe() {
super.pe();
this.xp = null;
this.xr = null;
}
}
HighDensityScatterSeries.$t = markType(HighDensityScatterSeries, 'HighDensityScatterSeries', Series.$);
HighDensityScatterSeries.$$p = markDep(DependencyProperty, PropertyMetadata, HighDensityScatterSeries, 'raisePropertyChanged', ['HeatMaximumColor:aay:aaj', [Color.$, Defaults.be], 'HeatMaximum:y0:aak', [1, 50], 'HeatMinimumColor:aaz:aal', [Color.$, Defaults.bf], 'HeatMinimum:y1:aam', [1, 0], 'PointExtent:zd:aan', [1, 1], 'ProgressiveLoad:x5:aao', [0, true], 'UseBruteForce:x6:aap', [0, false], 'XAxis:xp:aaq', [NumericXAxis.$, null], 'XMemberAsLegendLabel:zp:aar', [2, null], 'XMemberAsLegendUnit:zr:aas', [2, null], 'XMemberPath:zt:aat', [2, null], 'YAxis:xr:aau', [NumericYAxis.$, null], 'YMemberAsLegendLabel:zx:aav', [2, null], 'YMemberAsLegendUnit:zz:aaw', [2, null], 'YMemberPath:z1:aax', [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.aaz = Defaults.bf;
this.cf.aay = Defaults.be;
this.cf.vy = Defaults.ba;
this.cf.we = Defaults.a9;
}
}
cq() {
this.cf.aah(this.cd, this.cl, this.ck);
}
cm() {
if (this.ci == null) {
this.ci = this.f.j8.createElement("canvas");
let a = this.f.j8.get2DCanvasContext(this.ci);
this.cg = new RenderingContext(new CanvasViewRenderer(), a);
}
let b;
if (this.s) {
b = this.b9;
}
else {
b = this.f.dc.yx();
}
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.aah(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.j8 != null) {
this.f.j8.setTimeout(a, 0);
}
else {
window.setTimeout(a, 0);
}
}
bj(a, b) {
super.bj(a, b);
if (b) {
if (!this.cf.ge) {
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 = markType(HighDensityScatterSeriesView, 'HighDensityScatterSeriesView', SeriesView.$);
return HighDensityScatterSeriesView;
})();