igniteui-angular-charts
Version:
Ignite UI Angular charting components for building rich data visualizations for modern web apps.
1,389 lines • 74.1 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 { MarkerSeries } from "./MarkerSeries";
import { ISupportsErrorBars_$type } from "./ISupportsErrorBars";
import { ITrendLineSeries_$type } from "./ITrendLineSeries";
import { ScatterAxisInfoCache } from "./ScatterAxisInfoCache";
import { NumericXAxis } from "./NumericXAxis";
import { DependencyProperty } from "igniteui-angular-core";
import { NumericYAxis } from "./NumericYAxis";
import { Series } from "./Series";
import { TrendLineType_$type } from "igniteui-angular-core";
import { Brush } from "igniteui-angular-core";
import { PenLineCap_$type } from "igniteui-angular-core";
import { DoubleCollection } from "igniteui-angular-core";
import { CollisionAvoidanceType_$type } from "./CollisionAvoidanceType";
import { ScatterItemSearchMode_$type } from "./ScatterItemSearchMode";
import { ScatterErrorBarSettings } from "./ScatterErrorBarSettings";
import { HighlightingInfo } from "igniteui-angular-core";
import { ScatterFrame } from "./ScatterFrame";
import { Base, runOn, delegateCombine, enumGetBox, Number_$type, typeCast, fromEnum, Point_$type, markType, markDep, PointUtil } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { SeriesPointOfInterest } from "./SeriesPointOfInterest";
import { ScalerParams } from "./ScalerParams";
import { Rect } from "igniteui-angular-core";
import { Marker } from "./Marker";
import { MarkerSeriesView } from "./MarkerSeriesView";
import { SeriesLayerPropertyOverlay } from "./SeriesLayerPropertyOverlay";
import { IFastItemsSource_$type } from "igniteui-angular-core";
import { Clipper } from "igniteui-angular-core";
import { OwnedPoint } from "./OwnedPoint";
import { Dictionary$2 } from "igniteui-angular-core";
import { AxisRange } from "./AxisRange";
import { GeometryUtil } from "igniteui-angular-core";
import { HashPool$2 } from "igniteui-angular-core";
import { DataContext } from "igniteui-angular-core";
import { TrendResolutionParams } from "./TrendResolutionParams";
import { ScatterTrendLineManager } from "./ScatterTrendLineManager";
import { Thickness } from "igniteui-angular-core";
import { Size } from "igniteui-angular-core";
import { AssigningScatterStyleEventArgs } from "./AssigningScatterStyleEventArgs";
import { AssigningScatterMarkerStyleEventArgs } from "./AssigningScatterMarkerStyleEventArgs";
import { ChartSelection } from "./ChartSelection";
import { SeriesRenderManager } from "./SeriesRenderManager";
import { ErrorBarsHelper } from "./ErrorBarsHelper";
import { PathGeometry } from "igniteui-angular-core";
import { DataLegendSeriesValueInfo } from "igniteui-angular-core";
import { DataLegendSeriesContext } from "igniteui-angular-core";
import { PropertyMetadata } from "igniteui-angular-core";
import { truncate, isNaN_, isInfinity } from "igniteui-angular-core";
import { boxArray$1, arrayShallowClone } from "igniteui-angular-core";
import { Path } from "igniteui-angular-core";
import { DataTemplateMeasureInfo } from "igniteui-angular-core";
import { NumericMarkerManager } from "./NumericMarkerManager";
import { stringIsNullOrEmpty } from "igniteui-angular-core";
/**
* @hidden
*/
export let ScatterBase = /*@__PURE__*/ (() => {
class ScatterBase extends MarkerSeries {
constructor() {
super();
this.yv = null;
this.ze = null;
this.zf = null;
this.ack = null;
this.acl = null;
this.y4 = 1;
this.yl = null;
this.ym = null;
this.y1 = null;
this.y3 = null;
this.yz = null;
this.zk = false;
this.zj = false;
this.zc = null;
this.zd = null;
this.assigningScatterStyle = null;
this.assigningScatterMarkerStyle = null;
this.y8 = null;
this.y2 = null;
this.yy = null;
this.zi = true;
this.zx = 0;
this.zy = 0;
this.zz = 0;
this.z0 = 0;
this.y5 = this.y6();
this.y8 = new ScatterSeriesRenderManager();
this.y2 = new ScatterFrame();
this.acl = Rect.empty;
this.ack = Rect.empty;
}
cs() {
return new ScatterBaseView(this);
}
o1() {
super.o1();
this.xAxis = null;
this.yAxis = null;
}
q0(a) {
super.q0(a);
this.yw = a;
}
get_fv() {
return true;
}
ai() {
return [this.xAxis, this.yAxis];
}
kp(a, b) {
let c = this.nc(b);
if (c == ScatterBase.$$p[12]) {
return this.kq(a, b, this.aas);
}
if (c == ScatterBase.$$p[16]) {
return this.kq(a, b, this.aa0);
}
if (c == ScatterBase.$$p[1]) {
return this.kq(a, b, this.aac);
}
if (c == ScatterBase.$$p[2]) {
return this.kq(a, b, this.aae);
}
return null;
}
mc(a) {
let b = this.nc(a);
if (b == ScatterBase.$$p[12]) {
return this.aas;
}
if (b == ScatterBase.$$p[16]) {
return this.aa0;
}
if (b == ScatterBase.$$p[1]) {
return this.aac;
}
if (b == ScatterBase.$$p[2]) {
return this.aae;
}
return super.mc(a);
}
eb(a, b, c, d, e) {
if (!this.hasMarkers) {
return false;
}
let f = this.xAxis;
let g = new ScalerParams(1, this.db.v4, this.wr, f.ch);
g.c = this.getEffectiveViewport1(this.cv);
let h = this.yAxis;
let i = new ScalerParams(1, this.db.v4, this.wr, h.ch);
i.c = this.getEffectiveViewport1(this.cv);
a.clear();
this.w5.cj((j) => {
if (j._visibility == 0) {
let k = new SeriesPointOfInterest();
let l = j.n;
let m = j.o;
if (l < this.wr.left || l > this.wr.right || m < this.wr.top || m > this.wr.bottom) {
return;
}
k.d = f.eo(l, g);
k.e = h.eo(m, i);
k.b = j.content;
k.g = this.vf;
k.c = j.ak;
if (this.g8) {
k.g = this.vm(j.ak);
}
a.add(k);
}
});
return true;
}
b2() {
if (this.b3 == 0) {
if (this.z8 <= 2000) {
return 1;
}
else {
return super.b2();
}
}
else {
return super.b2();
}
}
wo(a) {
if (!this.hasMarkers || !this.xf()) {
return Rect.empty;
}
let b = this.w5.b1(this.v6(a));
if (b != null) {
return this.w5.cu(b);
}
return Rect.empty;
}
gv(a, b) {
if (this.xg(a, b)) {
return true;
}
return false;
}
get zg() {
return this.ze;
}
set zg(a) {
if (this.ze != a) {
let b = this.zg;
this.ze = a;
this.raisePropertyChanged("XColumn", b, this.zg);
}
}
get zh() {
return this.zf;
}
set zh(a) {
if (this.zf != a) {
let b = this.zh;
this.zf = a;
this.raisePropertyChanged("YColumn", b, this.zh);
}
}
ga() {
return this.highlightedItemsSource != null || (this.aac != null && this.aae != null);
}
zv() {
return false;
}
hs() {
let a = super.hs();
{
let b = ((() => {
let $ret = new SeriesLayerPropertyOverlay();
$ret.ad = "YMemberPath";
$ret.p = true;
$ret.y = "HighlightedYMemberPath";
$ret.q = true;
return $ret;
})());
b.valueResolving = delegateCombine(b.valueResolving, runOn(this, this.aa8));
a.add(b);
}
{
let c = ((() => {
let $ret = new SeriesLayerPropertyOverlay();
$ret.ad = "XMemberPath";
$ret.p = true;
$ret.y = "HighlightedXMemberPath";
$ret.q = true;
return $ret;
})());
c.valueResolving = delegateCombine(c.valueResolving, runOn(this, this.aa7));
a.add(c);
}
if (this.zv()) {
let d = ((() => {
let $ret = new SeriesLayerPropertyOverlay();
$ret.r = true;
$ret.ad = "DashArray";
$ret.p = true;
$ret.x = ((() => {
let $ret = new DoubleCollection();
$ret.add(5);
$ret.add(5);
return $ret;
})());
$ret.q = true;
return $ret;
})());
a.add(d);
}
if (!this.zv()) {
let e = ((() => {
let $ret = new SeriesLayerPropertyOverlay();
$ret.r = true;
$ret.ad = "Brush";
$ret.p = true;
$ret.y = "ActualBrush";
$ret.q = true;
return $ret;
})());
e.valueResolving = delegateCombine(e.valueResolving, runOn(this, this.rz));
a.add(e);
}
if (!this.zv()) {
let f = ((() => {
let $ret = new SeriesLayerPropertyOverlay();
$ret.r = true;
$ret.ad = "Outline";
$ret.p = true;
$ret.y = "ActualOutline";
$ret.q = true;
return $ret;
})());
f.valueResolving = delegateCombine(f.valueResolving, runOn(this, this.rz));
a.add(f);
}
return a;
}
aa7(a, b) {
if (this.aac != null) {
b.value = this.aac;
return;
}
b.value = this.aas;
}
aa8(a, b) {
if (this.aae != null) {
b.value = this.aae;
return;
}
b.value = this.aa0;
}
get ach() {
return this.c(ScatterBase.abs);
}
set ach(a) {
this.h(ScatterBase.abs, a);
}
get GetErrorBarsXAxis() {
return this.xAxis;
}
get GetErrorBarsYAxis() {
return this.yAxis;
}
qa() {
super.qa();
if (this.xAxis != null) {
this.xAxis.ib(false);
}
if (this.yAxis != null) {
this.yAxis.ib(false);
}
}
q8(a, b, c, d) {
super.q8(a, b, c, d);
if (this.yw.c2.g$b(a, b, c, d)) {
this.rq(false);
this.qk();
}
switch (b) {
case ScatterBase.$$p[10]:
case ScatterBase.$$p[14]:
case ScatterBase.$$p[11]:
case ScatterBase.$$p[15]:
this.qe();
break;
case "FastItemsSource":
if (typeCast(IFastItemsSource_$type, c) != null) {
c.deregisterColumn(this.zg);
c.deregisterColumn(this.zh);
this.zg = null;
this.zh = null;
}
if (typeCast(IFastItemsSource_$type, d) != null) {
this.zg = this.dk(this.aas);
this.zh = this.dk(this.aa0);
}
if ((this.yAxis != null && !this.yAxis.c1()) || (this.xAxis != null && !this.xAxis.c1())) {
this.rq(this.gf && c != null);
}
break;
case ScatterBase.$$p[9]:
if (c != null) {
c.b0(this);
}
if (d != null) {
d.ct(this);
}
if ((this.xAxis != null && !this.xAxis.c1()) || (d == null && c != null)) {
this.rq(false);
}
this.qk();
break;
case ScatterBase.$$p[13]:
if (c != null) {
c.b0(this);
}
if (d != null) {
d.ct(this);
}
if ((this.yAxis != null && !this.yAxis.c1()) || (d == null && c != null)) {
this.rq(false);
}
this.qk();
break;
case ScatterBase.$$p[12]:
if (this.dn != null) {
this.dn.deregisterColumn(this.zg);
this.zg = this.dk(this.aas);
}
break;
case "XColumn":
this.yw.c2.g$i();
if (this.xAxis != null && !this.xAxis.c1()) {
this.rq(this.gf && this.d7);
}
break;
case ScatterBase.$$p[16]:
if (this.dn != null) {
this.dn.deregisterColumn(this.zh);
this.zh = this.dk(this.aa0);
}
break;
case "YColumn":
this.yw.c2.g$i();
if (this.yAxis != null && !this.yAxis.c1()) {
this.rq(this.gf && this.d7);
}
break;
case ScatterBase.$$p[7]:
this.rq(false);
this.qk();
break;
case ScatterBase.$$p[8]:
this.rq(false);
this.qk();
break;
case "TransitionProgress":
this.y3.c(this.jp, this.y1, this.yz);
this.aa2();
try {
if (this.d5(this.cv)) {
return;
}
if ((Math.round(this.jp * 100000) / 100000) == 1) {
this.abp(this.yz, this.yw);
}
else {
this.abp(this.y3, this.yw);
}
if (this.db != null) {
this.db.qo(this);
}
}
finally {
this.abq();
}
break;
case "TrendLineBrush":
this.re(b);
break;
case ScatterBase.$$p[0]:
if (this.yx != null) {
this.yx.r = this;
}
this.rq(false);
this.qk();
break;
case "TrendLineType":
this.qk();
break;
case ScatterBase.$$p[4]:
this.zk = this.zs();
this.rq(false);
break;
case ScatterBase.$$p[3]:
this.zj = this.zr();
this.rq(false);
break;
case ScatterBase.$$p[5]:
this.y5 = this.y6();
break;
}
}
zs() {
return this.zo;
}
zr() {
return this.zn;
}
zm(a) {
if (typeCast(NumericYAxis.$, a) !== null) {
return true;
}
return false;
}
zl(a) {
if (typeCast(NumericXAxis.$, a) !== null) {
return true;
}
return false;
}
abq() {
this.ack = Rect.empty;
this.acl = Rect.empty;
}
aa2() {
let a = this.getViewInfo(this.ack, this.acl);
this.ack = a.p0;
this.acl = a.p1;
}
zq(a, b) {
if (b != 3) {
return true;
}
if (a == null) {
return true;
}
if (this.aas == a || this.aa0 == a) {
return true;
}
return false;
}
pa(a, b, c, d) {
let e = false;
if (!this.zq(d, a)) {
return;
}
this.yw.c2.g$e(a, b, c, d);
if (this.xAxis != null && !this.xAxis.c1()) {
e = true;
}
if (this.yAxis != null && !this.yAxis.c1()) {
e = true;
}
if (a == 0 || a == 2 || a == 3 || a == 4) {
this.zi = true;
}
else if (a == 1) {
for (let f = b; f < b + c; f++) {
this.zx += this.zg.item(f);
this.zy += this.zh.item(f);
}
this.zz = this.zx / this.zg.count;
this.z0 = this.zy / this.zh.count;
}
if (e) {
this.rq(true);
}
}
abh(a) {
this.abi(a, null);
}
abi(a, b) {
let c = this.zg != null ? this.zg.count : 0;
let d = this.zh != null ? this.zh.count : 0;
let e = Math.min(c, d);
if (e <= this.z8) {
a.m.clear();
let f = new List$1(OwnedPoint.$, 0);
for (let g of fromEnum(a.u.values)) {
f.add(g);
}
let h = this.dn;
f.aa((i, j) => {
let k = h.indexOf(i.a);
let l = h.indexOf(j.a);
if (k < l) {
return -1;
}
if (k > l) {
return 1;
}
return 0;
});
if (b != null) {
b.i = a.m;
}
for (let i of fromEnum(f)) {
if (h.indexOf(i.a) >= 0) {
if (b != null) {
b.j(i.c);
}
else {
a.m.add({ $type: Point_$type, x: i.c.x, y: i.c.y });
}
}
}
}
}
ay(a) {
if (a != null && a == this.xAxis && this.zg != null) {
return new AxisRange(this.zg.minimum, this.zg.maximum);
}
if (a != null && a == this.yAxis && this.zh != null) {
return new AxisRange(this.zh.minimum, this.zh.maximum);
}
return null;
}
km(a) {
let b = this.j2(a);
if (this.dn != null && b >= 0 && b < this.dn.count) {
return this.dn.item(b);
}
return null;
}
get y5() {
return this.y4;
}
set y5(a) {
let b = this.y4;
this.y4 = a;
if (b != this.y4) {
this.raisePropertyChanged("ActualItemSearchMode", enumGetBox(ScatterItemSearchMode_$type, b), enumGetBox(ScatterItemSearchMode_$type, this.y4));
}
}
y6() {
if (this.y7 != 0) {
return this.y7;
}
return this.zp ? 4 : 1;
}
j2(a) {
let b = truncate(Math.round(this.iq(a)));
return b;
}
iq(a) {
switch (this.y5) {
case 1: return this.z4(a);
case 3: return this.z5(a);
case 2: return this.z2(a);
case 4: return this.z3(a);
case 5: return this.z1(a);
}
return -1;
}
z3(a) {
return this.z6(a, false);
}
z2(a) {
let b = this.v6(a);
let c = b.x;
let d = b.y;
if (this.dn == null || this.xAxis == null || this.yAxis == null || this.zg == null || this.zh == null) {
return -1;
}
if (this.dn.count > this.z7) {
return -1;
}
this.aa5();
let e = this.yl;
let f = this.ym;
if (e == null || f == null) {
return -1;
}
let g = 1.7976931348623157E+308;
let h = -1;
for (let i = 0; i < this.zg.count; i++) {
let j = e[i];
let k = f[i];
let l = (c - j) * (c - j) + (d - k) * (d - k);
if (l < g) {
g = l;
h = i;
}
}
return h;
}
aa5() {
let a = this.cv.by;
let b = this.cv.bx;
let c = this.getEffectiveViewport();
if (this.yv == null) {
return;
}
let d = new ScalerParams(0, a, b, this.yv.d, c);
let e = ((() => {
let $ret = new ScalerParams(0, a, b, this.yv.e, c);
$ret.b = this.ix();
return $ret;
})());
if (this.yl == null || this.ym == null) {
let f = arrayShallowClone(this.zg.asArray());
let g = arrayShallowClone(this.zh.asArray());
this.xAxis.hq(boxArray$1(f), 0, f.length, d);
this.yAxis.hq(boxArray$1(g), 0, g.length, e);
this.yl = f;
this.ym = g;
}
}
get_zp() {
return false;
}
get zp() {
return this.get_zp();
}
z6(a, b) {
if (!this.zp) {
return -1;
}
let c = { $type: Point_$type, x: 0, y: 0 };
let d = true;
let e = this.y0();
if (e == null) {
return -1;
}
if (e.m == null) {
return -1;
}
if (this.dn == null || this.dn.count > this.z7) {
return -1;
}
this.aa5();
let f = this.yl;
let g = this.ym;
if (f == null || g == null) {
return -1;
}
let h = this.v6(a);
let i = 1.7976931348623157E+308;
let j = -1;
for (let k = 0; k < this.yl.length; k++) {
let l = { $type: Point_$type, x: this.yl[k], y: this.ym[k] };
if (k > 0) {
if (!b || e.j.containsKey(this.dn.item(k)) || e.j.containsKey(this.dn.item(k - 1))) {
let m = GeometryUtil.h(h, c, l);
if (m < i) {
i = m;
j = k;
}
}
}
c = l;
}
if (j >= 0) {
let n = { $type: Point_$type, x: this.yl[j], y: this.ym[j] };
let o = { $type: Point_$type, x: this.yl[j - 1], y: this.ym[j - 1] };
if (!b || (e.j.containsKey(this.dn.item(j)) && e.j.containsKey(this.dn.item(j - 1)))) {
let p = GeometryUtil.m(h, o, n);
return (j - 1) + p;
}
else if (e.j.containsKey(this.dn.item(j))) {
return j;
}
else {
return j - 1;
}
}
return -1;
}
z5(a) {
return this.z6(a, true);
}
z1(a) {
let b = this.v6(a);
let c = b.x;
let d = b.y;
if (this.yw.c3.e > this.z7) {
return -1;
}
let e = -1;
this.w5.ck((f) => {
let g = this.yw.cu(f);
let h = g.left;
let i = g.top;
let j = g.width;
let k = g.height;
if (this.xc) {
let l = h + j / 2;
let m = i + k / 2;
let n = (j / 2) * (j / 2);
let o = (c - l) * (c - l) + (d - m) * (d - m);
if (o < n) {
if (e == -1) {
e = f.ak;
}
}
}
else {
if (c > h && c < h + j && d > i && d < i + k) {
if (e == -1) {
e = f.ak;
}
}
}
});
return e;
}
z4(a) {
let b = null;
let c = 1.7976931348623157E+308;
let d = this.v6(a);
let e = d.x;
let f = d.y;
if (this.yw.c3.e > this.z7) {
return -1;
}
this.yw.da((g) => {
if (g._visibility == 0) {
let h = this.yw.cu(g);
let i = h.left + h.width / 2;
let j = h.top + h.height / 2;
let k = (e - i) * (e - i) + (f - j) * (f - j);
if (k < c) {
c = k;
b = g;
}
}
});
if (b != null) {
return b.ak;
}
return -1;
}
wb(a, b, c) {
if (this.xAxis == null || this.yAxis == null || this.zg == null || this.zh == null) {
return { $type: Point_$type, x: NaN, y: NaN };
}
let d = this.cv.by;
let e = this.cv.bx;
let f = this.getEffectiveViewport();
let g = new ScalerParams(0, d, e, this.xAxis.ch, f);
let h = ((() => {
let $ret = new ScalerParams(0, d, e, this.yAxis.ch, f);
$ret.b = this.ix();
return $ret;
})());
if (b) {
let i = this.iq(a);
if (i == -1) {
return { $type: Point_$type, x: NaN, y: NaN };
}
let j = truncate(Math.floor(i));
let k = truncate(Math.ceil(i));
if (j < 0) {
j = 0;
}
if (k < 0) {
k = 0;
}
if (k > this.dn.count - 1) {
k = this.dn.count - 1;
}
if (j > this.dn.count - 1) {
j = this.dn.count - 1;
}
if (k == j) {
let l = this.xAxis.el(this.zg.item(j), g);
let m = this.yAxis.el(this.zh.item(j), h);
return { $type: Point_$type, x: l, y: m };
}
let n = i - Math.floor(i);
let o = this.xAxis.el(this.zg.item(j), g);
let p = this.yAxis.el(this.zh.item(j), h);
let q = this.xAxis.el(this.zg.item(k), g);
let r = this.yAxis.el(this.zh.item(k), h);
let s = q - o;
let t = r - p;
return { $type: Point_$type, x: o + s * n, y: p + t * n };
}
else {
let u = this.j2(a);
if (u == -1) {
return { $type: Point_$type, x: NaN, y: NaN };
}
let v = this.xAxis.el(this.zg.item(u), g);
let w = this.yAxis.el(this.zh.item(u), h);
return { $type: Point_$type, x: v, y: w };
}
}
gc(a) {
let b = this.db != null ? this.db.v4 : Rect.empty;
b = b.copy();
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.xAxis.ch, e);
let g = ((() => {
let $ret = new ScalerParams(0, d, d, this.yAxis.ch, e);
$ret.b = this.ix();
return $ret;
})());
let h = !b.isEmpty && !c.isEmpty && this.dn != null ? this.dn.indexOf(a) : -1;
let i = this.xAxis != null && this.zg != null && h < this.zg.count ? this.xAxis.el(this.zg.item(h), f) : NaN;
let j = this.yAxis != null && this.zh != null && h < this.zh.count ? this.yAxis.el(this.zh.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;
}
sp(a, b) {
this.rq(false);
}
sq(a, b) {
this.rq(false);
}
y0() {
let a = this.yz;
if (this.d3()) {
if (this.dc.g) {
this.dc.t();
}
a = this.y3;
}
return a;
}
aa3(a, b, c, d, e) {
b.g = new Dictionary$2(Base.$, OwnedPoint.$, 1, c);
let f = this.getEffectiveViewport1(a);
let g = this.dn;
let h;
let i;
let j = ((() => {
let $ret = new ScalerParams(0, d, e, this.yv.d, f);
$ret.c = this.getEffectiveViewport1(a);
return $ret;
})());
let k = ((() => {
let $ret = new ScalerParams(0, d, e, this.yv.e, f);
$ret.c = this.getEffectiveViewport1(a);
$ret.b = this.ix();
return $ret;
})());
let l = false;
let m = 0;
if (this.db != null) {
if (this.db.f4()) {
let n = this.db.m4(d, j);
l = n.c;
m = n.d;
}
}
for (let o = 0; o < c; o++) {
h = this.zg.item(o);
i = this.zh.item(o);
let p = { $type: Point_$type, x: this.yv.a.el(h, j), y: this.yv.b.el(i, k) };
if (l) {
if (p.x < e.left || p.x > e.right) {
if (p.x + m >= e.left && p.x + m <= e.right) {
p = { $type: Point_$type, x: p.x + m, y: i };
}
}
}
if (!isInfinity(p.x) && !isInfinity(p.y)) {
let q = g.item(o);
if (!b.g.containsKey(q)) {
let r = { $type: Point_$type, x: h, y: i };
let s = { $type: Point_$type, x: p.x, y: p.y };
b.g.addItem(q, ((() => {
let $ret = new OwnedPoint();
$ret.a = q;
$ret.b = r;
$ret.c = s;
return $ret;
})()));
}
}
}
}
abe(a, b) {
this.yl = null;
this.ym = null;
a.j.clear();
a.n.clear();
a.h.clear();
a.l.clear();
a.i.clear();
a.k.clear();
let c = Math.min(this.zg != null ? this.zg.count : 0, this.zh != null ? this.zh.count : 0);
let d = b.by;
let e = b.bx;
let f = this.getEffectiveViewport1(b);
let g = new ScalerParams(0, d, e, this.xAxis.ch, f);
g.c = this.getEffectiveViewport1(b);
let h = ((() => {
let $ret = new ScalerParams(0, d, e, this.yAxis.ch, f);
$ret.b = this.ix();
return $ret;
})());
h.c = this.getEffectiveViewport1(b);
if (c < 1) {
return;
}
this.yv = ((() => {
let $ret = new ScatterAxisInfoCache();
$ret.a = this.xAxis;
$ret.b = this.yAxis;
$ret.d = this.xAxis.ch;
$ret.e = this.yAxis.ch;
$ret.c = this.dn;
return $ret;
})());
let i = b;
if (c <= this.z8) {
this.aa3(i, a, c, d, e);
}
if (this.xf()) {
b.c0.l(a.j, this.z8, d, e, this.ic);
}
let j = ((() => {
let $ret = new Clipper(0, e, false);
$ret.i = a.n;
return $ret;
})());
let k = this.wi(b);
let l = this.xAxis.eo(k.left, g);
let m = this.xAxis.eo(k.right, g);
b.c2.h(a.n, this.trendLineType, this.zg, this.zh, this.trendLinePeriod, (n) => this.xAxis.el(n, g), (n) => this.yAxis.el(n, h), ((() => {
let $ret = new TrendResolutionParams();
$ret.d = this.ic;
$ret.i = e;
$ret.h = f;
$ret.j = d;
return $ret;
})()), j, l, m);
this.abc(a, b);
}
o4(a, b) {
super.o4(a, b);
let c = b;
c.c9(a);
}
get_fd() {
return true;
}
za(a, b, c) {
return null;
}
zb(a, b, c) {
if (this.dn == null) {
return null;
}
let d = this.y0();
let e = this.yw.b1(this.v6(b));
let f = -1;
if (e == null) {
if (a != null) {
f = this.dn.indexOf(a);
}
else {
return null;
}
}
else {
f = e.ak;
}
if (f == -1) {
return null;
}
let g = new HighlightingInfo();
g.i = this;
g.g = f;
g.f = f;
g.c = false;
g.d = true;
if (c != null && c.g == g.g && c.f == g.f) {
return c;
}
return g;
}
wu(a, b) {
if (this.w7 != 1 && this.w7 != 13) {
let c = this.w5.cv();
let d = (c.width / 2) + (this.xi / 2);
let e = (c.height / 2) + (this.xi / 2);
let f = d;
let g = d;
let h = e;
let i = e;
if (a == 2 || a == 4) {
f = 0;
}
if (a == 2 || a == 3) {
g = 0;
}
if (b == 2 || b == 3) {
h = 0;
}
if (b == 2 || b == 4) {
i = 0;
}
return new Thickness(1, f, h, g, i);
}
return new Thickness(1, 0, 0, 0, 0);
}
y9(a, b, c) {
let d = new HighlightingInfo();
d.i = this;
d.g = 0;
d.f = this.dn.count - 1;
d.c = true;
if (c != null && c.g == d.g && c.f == d.f) {
return c;
}
return d;
}
dg(a, b, c) {
if (this.ed && this.fy(this.bx) && !c) {
let d = this.za(a, b, this.zc);
this.zc = d;
return d;
}
else {
let e = this.y9(a, b, this.zc);
this.zc = e;
return e;
}
}
dh(a, b, c) {
if (this.fy(this.bx) && !c) {
let d = this.zb(a, b, this.zd);
this.zd = d;
return d;
}
else {
let e = this.y9(a, b, this.zd);
e.d = true;
this.zd = e;
return e;
}
}
zu() {
return (this.assigningScatterStyle != null && this.zk) || this.d2 || (this.bx != 1) || (this.cp != 1) || (this.co != 1);
}
zt() {
return (this.assigningScatterMarkerStyle != null && this.zj) || this.d2 || (this.bx != 1) || (this.cp != 1) || (this.co != 1);
}
abp(a, b) {
this.qw();
let c = b.bx;
this.yv = ((() => {
let $ret = new ScatterAxisInfoCache();
$ret.a = this.xAxis;
$ret.b = this.yAxis;
$ret.d = this.xAxis.ch;
$ret.e = this.yAxis.ch;
return $ret;
})());
if (this.xf()) {
b.c0.j(a.j, this.xh);
if (this.zt()) {
this.aa4(b, a);
}
}
b.cr();
let d = ((() => {
let $ret = new Clipper(1, NaN, c.bottom, NaN, c.top, false);
$ret.i = b.c2.g$j.an;
return $ret;
})());
b.c2.g$h(a.n, d);
this.abm(a, b);
}
ak(a, b) {
let c = new List$1(ChartSelection.$, 0);
this.p3(a, c, b);
return c.toArray();
}
p3(a, b, c) {
this.aa6(a, b, c, 0, null);
}
aa6(a, b, c, d, e) {
let f = this.wq(a);
let g = this.dn.count;
let h = this.yv.a;
let i = this.yv.b;
let j = this.wi(this.cv);
let k = new ScalerParams(0, f, this.db.wk, h.ch, this.getEffectiveViewport());
let l = new ScalerParams(0, f, this.db.wk, i.ch, this.getEffectiveViewport());
if (d == 0) {
for (let m = 0; m < g; m++) {
let n = h.el(this.zg.item(m), k);
let o = i.el(this.zh.item(m), l);
if (n < j.width && n > 0 && o < j.height && o > 0) {
if (c == 7 || c == 6) {
b.add(((() => {
let $ret = new ChartSelection();
$ret.series = this;
return $ret;
})()));
return;
}
else if (c == 2 || c == 1) {
b.add(((() => {
let $ret = new ChartSelection();
$ret.item = this.dn.item(m);
return $ret;
})()));
}
else {
b.add(((() => {
let $ret = new ChartSelection();
$ret.item = this.dn.item(m);
$ret.series = this;
return $ret;
})()));
}
}
}
}
else {
for (let p = 0; p < g; p++) {
let q = h.el(this.zg.item(p), k);
let r = i.el(this.zh.item(p), l);
let s = e.item(p) / f.height;
let t = e.item(p) / f.width;
let u = new Rect(0, q - t / 2, r - s / 2, t, s);
if (j.intersectsWith(u)) {
if (c == 7 || c == 6) {
b.add(((() => {
let $ret = new ChartSelection();
$ret.series = this;
return $ret;
})()));
return;
}
else if (c == 2 || c == 1) {
b.add(((() => {
let $ret = new ChartSelection();
$ret.item = this.dn.item(p);
return $ret;
})()));
}
else {
b.add(((() => {
let $ret = new ChartSelection();
$ret.item = this.dn.item(p);
$ret.series = this;
return $ret;
})()));
}
}
}
}
}
yo(a, b) {
return this.yp(a, b);
}
yp(a, b) {
if (b < a || a < 0 || a > this.zg.count || b < 0 || b > this.zg.count) {
return null;
}
let c = new Array((b - a) + 1);
for (let d = a; d <= b; d++) {
let e = d;
c[d - a] = this.dn.item(d);
}
return c;
}
aa4(a, b) {
a.b7 = true;
this.y8.ay(this, this.zt(), runOn(this, this.yo));
let c = this.y8.d;
let d = c != null;
let e = this.getEffectiveViewport1(a);
let f = this.dn == null ? 0 : this.dn.count;
this.yw.cj((g) => {
if (g._visibility == 0) {
let h = g.ak;
let i = g.content;
if (i == null) {
i = new DataContext();
g.content = i;
}
if (d) {
this.aa9(h, f, a.q);
}
this.y8.ac(g, i);
}
});
}
aba(a, b, c) {
let d = this.bx != 1;
let e = this.cp != 1;
let f = this.co != 1;
this.y8.a0(this.y8.b, a, b, false);
this.y8.ab(this.ia);
let g = this.y8.ax;
let h = null;
let i = null;
let j = null;
let k = this.dn;
if (d && this.db != null) {
h = this.db.dl.getHighlightingInfo(this, k, g.z, g.y, false);
g.c = h;
}
if (e && this.db != null) {
h = this.db.dm.getHighlightingInfo(this, k, g.z, g.y, false);
g.d = h;
}
if (f && this.db != null) {
h = this.db.dk.getHighlightingInfo(this, k, g.z, g.y, false);
g.b = h;
}
g.h = c;
this.abk(g);
this.y8.z(this, h, i, j, c, d, e, f, a < 0);
}
aa9(a, b, c) {
let d = this.bx != 1;
let e = this.cp != 1;
let f = this.co != 1;
this.y8.a0(this.y8.d, a, b, true);
this.y8.aa(this.ia);
let g = this.y8.aw;
let h = null;
let i = null;
let j = null;
let k = this.dn;
let l = null;
let m = null;
let n = null;
if (d && this.db != null) {
h = this.db.dl.getHighlightingInfo(this, k, g.z, g.y, true);
if (this.db.dl.isCrossContextHighlight(this)) {
l = this.db.dl.getHighlightingInfo(this, k, g.z, g.y, true);
}
g.c = h;
}
if (e && this.db != null) {
i = this.db.dm.getHighlightingInfo(this, k, g.z, g.y, true);
if (i == null && this.bn != null) {
i = this.db.dm.getHighlightingInfo(this.bn, this.bn.dn, g.z, g.y, true);
}
if (i == null && this.bk != null) {
i = this.db.dm.getHighlightingInfo(this.bk, this.bk.dn, g.z, g.y, true);
}
if (this.db.dm.isCrossContextHighlight(this)) {
m = this.db.dm.getHighlightingInfo(this, k, g.z, g.y, true);
}
g.d = i;
}
if (f && this.db != null) {
j = this.db.dk.getHighlightingInfo(this, k, g.z, g.y, true);
if (this.db.dk.isCrossContextHighlight(this)) {
n = this.db.dk.getHighlightingInfo(this, k, g.z, g.y, true);
}
g.d = i;
}
g.h = c;
this.abj(g);
this.y8.y(this, h, i, j, c, d, e, f, g.v, this.db.dl.totalHighWaterMark, g.x, this.db.dm.totalHighWaterMark, g.t, this.db.dk.totalHighWaterMark);
}
abk(a) {
if (this.assigningScatterStyle != null && this.zk) {
this.assigningScatterStyle(this, a);
}
}
abj(a) {
if (this.assigningScatterMarkerStyle != null && this.zj) {
this.assigningScatterMarkerStyle(this, a);
}
}
abc(a, b) {
let c = new ErrorBarsHelper(this, b);
if (this.yx == null) {
return;
}
let d = this.yx.u;
let e = this.yx.v;
let f = 0;
let g = 0;
let h = 0;
let i = 0;
for (let j of fromEnum(a.j.keys)) {
let k = a.j.item(j);
if (d != null) {
switch (d.getCalculatorType()) {
case 1:
let l = this.abf(k, c, d, h, i, true);
h = l.p3;
i = l.p4;
break;
case 0:
let m = this.abd(k, c, d, h, i, true);
h = m.p3;
i = m.p4;
break;
case 2:
let n = this.abb(k, c, d, j, h, i, true);
h = n.p4;
i = n.p5;
break;