igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
1,421 lines • 73.5 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-react-core";
import { NumericYAxis } from "./NumericYAxis";
import { Series } from "./Series";
import { TrendLineType_$type } from "igniteui-react-core";
import { Brush } from "igniteui-react-core";
import { PenLineCap_$type } from "igniteui-react-core";
import { DoubleCollection } from "igniteui-react-core";
import { CollisionAvoidanceType_$type } from "./CollisionAvoidanceType";
import { ScatterItemSearchMode_$type } from "./ScatterItemSearchMode";
import { ScatterErrorBarSettings } from "./ScatterErrorBarSettings";
import { HighlightingInfo } from "igniteui-react-core";
import { ScatterFrame } from "./ScatterFrame";
import { Base, runOn, delegateCombine, enumGetBox, Number_$type, typeCast, fromEnum, Point_$type, markType, markDep, PointUtil } from "igniteui-react-core";
import { List$1 } from "igniteui-react-core";
import { SeriesPointOfInterest } from "./SeriesPointOfInterest";
import { ScalerParams } from "./ScalerParams";
import { Rect } from "igniteui-react-core";
import { Marker } from "./Marker";
import { MarkerSeriesView } from "./MarkerSeriesView";
import { SeriesLayerPropertyOverlay } from "./SeriesLayerPropertyOverlay";
import { IFastItemsSource_$type } from "igniteui-react-core";
import { Clipper } from "igniteui-react-core";
import { OwnedPoint } from "./OwnedPoint";
import { Dictionary$2 } from "igniteui-react-core";
import { AxisRange } from "./AxisRange";
import { CoreGeometryUtil } from "igniteui-react-core";
import { GeometryUtil } from "igniteui-react-core";
import { HashPool$2 } from "igniteui-react-core";
import { DataContext } from "igniteui-react-core";
import { ScatterTrendLineManager } from "./ScatterTrendLineManager";
import { TrendResolutionParams } from "./TrendResolutionParams";
import { Thickness } from "igniteui-react-core";
import { Size } from "igniteui-react-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-react-core";
import { DataLegendSeriesValueInfo } from "igniteui-react-core";
import { DataLegendSeriesContext } from "igniteui-react-core";
import { PropertyMetadata } from "igniteui-react-core";
import { truncate, isNaN_, isInfinity } from "igniteui-react-core";
import { boxArray$1, arrayShallowClone } from "igniteui-react-core";
import { Path } from "igniteui-react-core";
import { DataTemplateMeasureInfo } from "igniteui-react-core";
import { NumericMarkerManager } from "./NumericMarkerManager";
import { stringIsNullOrEmpty } from "igniteui-react-core";
/**
* @hidden
*/
export let ScatterBase = /*@__PURE__*/ (() => {
class ScatterBase extends MarkerSeries {
ct() {
return new ScatterBaseView(this);
}
pf() {
super.pf();
this.xAxis = null;
this.yAxis = null;
}
rh(a) {
super.rh(a);
this.zi = a;
}
get_fz() {
return true;
}
ai() {
return [this.xAxis, this.yAxis];
}
kz(a, b) {
let c = this.no(b);
if (c == ScatterBase.$$p[12]) {
return this.k0(a, b, this.abe);
}
if (c == ScatterBase.$$p[16]) {
return this.k0(a, b, this.abm);
}
if (c == ScatterBase.$$p[1]) {
return this.k0(a, b, this.aay);
}
if (c == ScatterBase.$$p[2]) {
return this.k0(a, b, this.aa0);
}
return null;
}
mo(a) {
let b = this.no(a);
if (b == ScatterBase.$$p[12]) {
return this.abe;
}
if (b == ScatterBase.$$p[16]) {
return this.abm;
}
if (b == ScatterBase.$$p[1]) {
return this.aay;
}
if (b == ScatterBase.$$p[2]) {
return this.aa0;
}
return super.mo(a);
}
ed(a, b, c, d, e) {
if (!this.hasMarkers) {
return false;
}
let f = this.xAxis;
let g = new ScalerParams(1, this.dc.yr, this.xd, f.dn);
g.c = this.getEffectiveViewport1(this.cw);
let h = this.yAxis;
let i = new ScalerParams(1, this.dc.yr, this.xd, h.dn);
i.c = this.getEffectiveViewport1(this.cw);
a.clear();
this.xr.cw((j) => {
if (j._visibility == 0) {
let k = new SeriesPointOfInterest();
let l = j.n;
let m = j.o;
if (!e && (l < this.xd.left || l > this.xd.right || m < this.xd.top || m > this.xd.bottom)) {
return;
}
k.d = f.f9(l, g);
k.e = h.f9(m, i);
k.b = j.content;
k.g = this.v0;
k.c = j.ak;
if (this.hf) {
k.g = this.v7(j.ak);
}
a.add(k);
}
});
return true;
}
b3() {
if (this.b4 == 0) {
{
return 1;
}
}
else {
return super.b3();
}
}
xa(a) {
if (!this.hasMarkers || !this.x1()) {
return Rect.empty;
}
let b = this.xr.ce(this.wr(a));
if (b != null) {
return this.xr.c7(b);
}
return Rect.empty;
}
g2(a, b) {
if (this.x2(a, b)) {
return true;
}
return false;
}
constructor() {
super();
this.zh = null;
this.z0 = null;
this.z1 = null;
this.ac6 = null;
this.ac7 = null;
this.zq = 1;
this.y7 = null;
this.y8 = null;
this.zn = null;
this.zp = null;
this.zl = null;
this.z6 = false;
this.z5 = false;
this.zy = null;
this.zz = null;
this.assigningScatterStyle = null;
this.assigningScatterMarkerStyle = null;
this.zu = null;
this.zo = null;
this.zk = null;
this.z4 = true;
this.aaj = 0;
this.aak = 0;
this.aal = 0;
this.aam = 0;
this.zr = this.zs();
this.zu = new ScatterSeriesRenderManager();
this.zo = new ScatterFrame();
this.ac7 = Rect.empty;
this.ac6 = Rect.empty;
}
get z2() {
return this.z0;
}
set z2(a) {
if (this.z0 != a) {
let b = this.z2;
this.z0 = a;
this.raisePropertyChanged("XColumn", b, this.z2);
}
}
get z3() {
return this.z1;
}
set z3(a) {
if (this.z1 != a) {
let b = this.z3;
this.z1 = a;
this.raisePropertyChanged("YColumn", b, this.z3);
}
}
gh() {
return this.highlightedItemsSource != null || (this.aay != null && this.aa0 != null);
}
aah() {
return false;
}
hz() {
let a = super.hz();
{
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.abu));
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.abt));
a.add(c);
}
if (this.aah()) {
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.aah()) {
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.si));
a.add(e);
}
if (!this.aah()) {
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.si));
a.add(f);
}
return a;
}
abt(a, b) {
if (this.aay != null) {
b.value = this.aay;
return;
}
b.value = this.abe;
}
abu(a, b) {
if (this.aa0 != null) {
b.value = this.aa0;
return;
}
b.value = this.abm;
}
get ac3() {
return this.c(ScatterBase.ace);
}
set ac3(a) {
this.h(ScatterBase.ace, a);
}
get GetErrorBarsXAxis() {
return this.xAxis;
}
get GetErrorBarsYAxis() {
return this.yAxis;
}
qp() {
super.qp();
if (this.xAxis != null) {
this.xAxis.ly(false);
}
if (this.yAxis != null) {
this.yAxis.ly(false);
}
}
rq(a, b, c, d) {
super.rq(a, b, c, d);
if (this.zi.df.g$e(a, b, c, d)) {
this.r8(false);
this.q0();
}
switch (b) {
case ScatterBase.$$p[10]:
case ScatterBase.$$p[14]:
case ScatterBase.$$p[11]:
case ScatterBase.$$p[15]:
this.qu();
break;
case "FastItemsSource":
if (typeCast(IFastItemsSource_$type, c) != null) {
c.deregisterColumn(this.z2);
c.deregisterColumn(this.z3);
this.z2 = null;
this.z3 = null;
}
if (typeCast(IFastItemsSource_$type, d) != null) {
this.z2 = this.dl(this.abe);
this.z3 = this.dl(this.abm);
}
if ((this.yAxis != null && !this.yAxis.ed()) || (this.xAxis != null && !this.xAxis.ed())) {
this.r8(this.gm && c != null);
}
break;
case ScatterBase.$$p[9]:
if (c != null) {
c.cx(this);
}
if (d != null) {
d.d3(this);
}
if ((this.xAxis != null && !this.xAxis.ed()) || (d == null && c != null)) {
this.r8(false);
}
this.q0();
break;
case ScatterBase.$$p[13]:
if (c != null) {
c.cx(this);
}
if (d != null) {
d.d3(this);
}
if ((this.yAxis != null && !this.yAxis.ed()) || (d == null && c != null)) {
this.r8(false);
}
this.q0();
break;
case ScatterBase.$$p[12]:
if (this.dp != null) {
this.dp.deregisterColumn(this.z2);
this.z2 = this.dl(this.abe);
}
break;
case "XColumn":
this.zi.df.g$m();
if (this.xAxis != null && !this.xAxis.ed()) {
this.r8(this.gm && this.d9);
}
break;
case ScatterBase.$$p[16]:
if (this.dp != null) {
this.dp.deregisterColumn(this.z3);
this.z3 = this.dl(this.abm);
}
break;
case "YColumn":
this.zi.df.g$m();
if (this.yAxis != null && !this.yAxis.ed()) {
this.r8(this.gm && this.d9);
}
break;
case ScatterBase.$$p[7]:
this.r8(false);
this.q0();
break;
case ScatterBase.$$p[8]:
this.r8(false);
this.q0();
break;
case "TransitionProgress":
this.zp.d(this.jz, this.zn, this.zl);
this.abo();
try {
if (this.d7(this.cw)) {
return;
}
if ((Math.round(this.jz * 100000) / 100000) == 1) {
this.acb(this.zl, this.zi);
}
else {
this.acb(this.zp, this.zi);
}
if (this.dc != null) {
this.dc.st(this);
}
}
finally {
this.acc();
}
break;
case "TrendLineBrush":
this.rw(b);
break;
case ScatterBase.$$p[0]:
if (this.zj != null) {
this.zj.r = this;
}
this.r8(false);
this.q0();
break;
case "TrendLineType":
this.q0();
break;
case ScatterBase.$$p[4]:
this.z6 = this.aae();
this.r8(false);
break;
case ScatterBase.$$p[3]:
this.z5 = this.aad();
this.r8(false);
break;
case ScatterBase.$$p[5]:
this.zr = this.zs();
break;
}
}
aae() {
return this.aaa;
}
aad() {
return this.z9;
}
z8(a) {
if (typeCast(NumericYAxis.$, a) !== null) {
return true;
}
return false;
}
z7(a) {
if (typeCast(NumericXAxis.$, a) !== null) {
return true;
}
return false;
}
acc() {
this.ac6 = Rect.empty;
this.ac7 = Rect.empty;
}
abo() {
let a = this.getViewInfo(this.ac6, this.ac7);
this.ac6 = a.p0;
this.ac7 = a.p1;
}
aac(a, b) {
if (b != 3) {
return true;
}
if (a == null) {
return true;
}
if (this.abe == a || this.abm == a) {
return true;
}
return false;
}
po(a, b, c, d) {
let e = false;
if (!this.aac(d, a)) {
return;
}
this.zi.df.g$i(a, b, c, d);
if (this.zi.aa.count > 0) {
for (let f of fromEnum(this.zi.aa)) {
f.g$i(a, b, c, d);
}
}
if (this.xAxis != null && !this.xAxis.ed()) {
e = true;
}
if (this.yAxis != null && !this.yAxis.ed()) {
e = true;
}
if (a == 0 || a == 2 || a == 3 || a == 4) {
this.z4 = true;
}
else if (a == 1) {
for (let g = b; g < b + c; g++) {
this.aaj += this.z2.item(g);
this.aak += this.z3.item(g);
}
this.aal = this.aaj / this.z2.count;
this.aam = this.aak / this.z3.count;
}
if (e) {
this.r8(true);
}
}
ab3(a) {
this.ab4(a, null);
}
ab4(a, b) {
let c = this.z2 != null ? this.z2.count : 0;
let d = this.z3 != null ? this.z3.count : 0;
let e = Math.min(c, d);
if (e <= this.aau) {
a.q.clear();
let f = new List$1(OwnedPoint.$, 0);
for (let g of fromEnum(a.y.values)) {
f.add(g);
}
let h = this.dp;
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.q;
}
for (let i of fromEnum(f)) {
if (h.indexOf(i.a) >= 0) {
if (b != null) {
b.j(i.c);
}
else {
a.q.add({ $type: Point_$type, x: i.c.x, y: i.c.y });
}
}
}
}
}
ay(a) {
if (a != null && a == this.xAxis && this.z2 != null) {
return new AxisRange(this.z2.minimum, this.z2.maximum);
}
if (a != null && a == this.yAxis && this.z3 != null) {
return new AxisRange(this.z3.minimum, this.z3.maximum);
}
return null;
}
kw(a) {
let b = this.kc(a);
if (this.dp != null && b >= 0 && b < this.dp.count) {
return this.dp.item(b);
}
return null;
}
get zr() {
return this.zq;
}
set zr(a) {
let b = this.zq;
this.zq = a;
if (b != this.zq) {
this.raisePropertyChanged("ActualItemSearchMode", enumGetBox(ScatterItemSearchMode_$type, b), enumGetBox(ScatterItemSearchMode_$type, this.zq));
}
}
zs() {
if (this.zt != 0) {
return this.zt;
}
return this.aab ? 4 : 1;
}
kc(a) {
let b = truncate(Math.round(this.iy(a)));
return b;
}
iy(a) {
switch (this.zr) {
case 1: return this.aaq(a);
case 3: return this.aar(a);
case 2: return this.aao(a);
case 4: return this.aap(a);
case 5: return this.aan(a);
}
return -1;
}
aap(a) {
return this.aas(a, false);
}
aao(a) {
let b = this.wr(a);
let c = b.x;
let d = b.y;
if (this.dp == null || this.xAxis == null || this.yAxis == null || this.z2 == null || this.z3 == null) {
return -1;
}
if (this.dp.count > this.aat) {
return -1;
}
this.abr();
let e = this.y7;
let f = this.y8;
if (e == null || f == null) {
return -1;
}
let g = 1.7976931348623157E+308;
let h = -1;
for (let i = 0; i < this.z2.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;
}
abr() {
let a = this.cw.ca;
let b = this.cw.b9;
let c = this.getEffectiveViewport();
if (this.zh == null) {
return;
}
let d = new ScalerParams(0, a, b, this.zh.d, c);
let e = ((() => {
let $ret = new ScalerParams(0, a, b, this.zh.e, c);
$ret.b = this.i5();
return $ret;
})());
if (this.y7 == null || this.y8 == null) {
let f = arrayShallowClone(this.z2.asArray());
let g = arrayShallowClone(this.z3.asArray());
this.xAxis.k1(boxArray$1(f), 0, f.length, d);
this.yAxis.k1(boxArray$1(g), 0, g.length, e);
this.y7 = f;
this.y8 = g;
}
}
get_aab() {
return false;
}
get aab() {
return this.get_aab();
}
aas(a, b) {
if (!this.aab) {
return -1;
}
let c = { $type: Point_$type, x: 0, y: 0 };
let d = true;
let e = this.zm();
if (e == null) {
return -1;
}
if (e.q == null) {
return -1;
}
if (this.dp == null || this.dp.count > this.aat) {
return -1;
}
this.abr();
let f = this.y7;
let g = this.y8;
if (f == null || g == null) {
return -1;
}
let h = this.wr(a);
let i = 1.7976931348623157E+308;
let j = -1;
for (let k = 0; k < this.y7.length; k++) {
let l = { $type: Point_$type, x: this.y7[k], y: this.y8[k] };
if (k > 0) {
if (!b || e.m.containsKey(this.dp.item(k)) || e.m.containsKey(this.dp.item(k - 1))) {
let m = CoreGeometryUtil.q(h, c, l);
if (m < i) {
i = m;
j = k;
}
}
}
c = l;
}
if (j >= 0) {
let n = { $type: Point_$type, x: this.y7[j], y: this.y8[j] };
let o = { $type: Point_$type, x: this.y7[j - 1], y: this.y8[j - 1] };
if (!b || (e.m.containsKey(this.dp.item(j)) && e.m.containsKey(this.dp.item(j - 1)))) {
let p = GeometryUtil.j(h, o, n);
return (j - 1) + p;
}
else if (e.m.containsKey(this.dp.item(j))) {
return j;
}
else {
return j - 1;
}
}
return -1;
}
aar(a) {
return this.aas(a, true);
}
aan(a) {
let b = this.wr(a);
let c = b.x;
let d = b.y;
if (this.zi.dg.e > this.aat) {
return -1;
}
let e = -1;
this.xr.cx((f) => {
let g = this.zi.c7(f);
let h = g.left;
let i = g.top;
let j = g.width;
let k = g.height;
if (this.xy) {
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;
}
aaq(a) {
let b = null;
let c = 1.7976931348623157E+308;
let d = this.wr(a);
let e = d.x;
let f = d.y;
if (this.zi.dg.e > this.aat) {
return -1;
}
this.zi.dn((g) => {
if (g._visibility == 0) {
let h = this.zi.c7(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;
}
ww(a, b, c) {
if (this.xAxis == null || this.yAxis == null || this.z2 == null || this.z3 == null) {
return { $type: Point_$type, x: NaN, y: NaN };
}
let d = this.cw.ca;
let e = this.cw.b9;
let f = this.getEffectiveViewport();
let g = new ScalerParams(0, d, e, this.xAxis.dn, f);
let h = ((() => {
let $ret = new ScalerParams(0, d, e, this.yAxis.dn, f);
$ret.b = this.i5();
return $ret;
})());
if (b) {
let i = this.iy(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.dp.count - 1) {
k = this.dp.count - 1;
}
if (j > this.dp.count - 1) {
j = this.dp.count - 1;
}
if (k == j) {
let l = this.xAxis.f6(this.z2.item(j), g);
let m = this.yAxis.f6(this.z3.item(j), h);
return { $type: Point_$type, x: l, y: m };
}
let n = i - Math.floor(i);
let o = this.xAxis.f6(this.z2.item(j), g);
let p = this.yAxis.f6(this.z3.item(j), h);
let q = this.xAxis.f6(this.z2.item(k), g);
let r = this.yAxis.f6(this.z3.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.kc(a);
if (u == -1) {
return { $type: Point_$type, x: NaN, y: NaN };
}
let v = this.xAxis.f6(this.z2.item(u), g);
let w = this.yAxis.f6(this.z3.item(u), h);
return { $type: Point_$type, x: v, y: w };
}
}
gj(a) {
let b = this.dc != null ? this.dc.yr : Rect.empty;
b = b.copy();
let c = this.dc != null ? this.dc.y9 : Rect.empty;
let d = new Rect(0, 0, 0, 1, 1);
let e = this.w6(this.cw);
let f = new ScalerParams(0, d, d, this.xAxis.dn, e);
let g = ((() => {
let $ret = new ScalerParams(0, d, d, this.yAxis.dn, e);
$ret.b = this.i5();
return $ret;
})());
let h = !b.isEmpty && !c.isEmpty && this.dp != null ? this.dp.indexOf(a) : -1;
let i = this.xAxis != null && this.z2 != null && h < this.z2.count ? this.xAxis.f6(this.z2.item(h), f) : NaN;
let j = this.yAxis != null && this.z3 != null && h < this.z3.count ? this.yAxis.f6(this.z3.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;
}
s8(a, b) {
this.r8(false);
}
s9(a, b) {
this.r8(false);
}
zm() {
let a = this.zl;
if (this.d4()) {
if (this.dd.g) {
this.dd.t();
}
a = this.zp;
}
return a;
}
abp(a, b, c, d, e) {
b.j = new Dictionary$2(Base.$, OwnedPoint.$, 1, c);
let f = this.getEffectiveViewport1(a);
let g = this.dp;
let h;
let i;
let j = ((() => {
let $ret = new ScalerParams(0, d, e, this.zh.d, f);
$ret.c = this.getEffectiveViewport1(a);
return $ret;
})());
let k = ((() => {
let $ret = new ScalerParams(0, d, e, this.zh.e, f);
$ret.c = this.getEffectiveViewport1(a);
$ret.b = this.i5();
return $ret;
})());
let l = false;
let m = 0;
if (this.dc != null) {
if (this.dc.g0()) {
let n = this.dc.oj(d, j);
l = n.c;
m = n.d;
}
}
for (let o = 0; o < c; o++) {
h = this.z2.item(o);
i = this.z3.item(o);
let p = { $type: Point_$type, x: this.zh.a.f6(h, j), y: this.zh.b.f6(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.j.containsKey(q)) {
let r = { $type: Point_$type, x: h, y: i };
let s = { $type: Point_$type, x: p.x, y: p.y };
b.j.addItem(q, ((() => {
let $ret = new OwnedPoint();
$ret.a = q;
$ret.b = r;
$ret.c = s;
return $ret;
})()));
}
}
}
}
ab0(a, b) {
this.y7 = null;
this.y8 = null;
a.m.clear();
a.r.clear();
a.k.clear();
a.o.clear();
a.l.clear();
a.n.clear();
let c = Math.min(this.z2 != null ? this.z2.count : 0, this.z3 != null ? this.z3.count : 0);
let d = b.ca;
let e = b.b9;
let f = this.getEffectiveViewport1(b);
let g = new ScalerParams(0, d, e, this.xAxis.dn, f);
g.c = this.getEffectiveViewport1(b);
let h = ((() => {
let $ret = new ScalerParams(0, d, e, this.yAxis.dn, f);
$ret.b = this.i5();
return $ret;
})());
h.c = this.getEffectiveViewport1(b);
if (c < 1) {
return;
}
this.zh = ((() => {
let $ret = new ScatterAxisInfoCache();
$ret.a = this.xAxis;
$ret.b = this.yAxis;
$ret.d = this.xAxis.dn;
$ret.e = this.yAxis.dn;
$ret.c = this.dp;
return $ret;
})());
let i = b;
if (c <= this.aau) {
this.abp(i, a, c, d, e);
}
if (this.x1()) {
b.dd.l(a.m, this.aau, d, e, this.ik);
}
let j = ((() => {
let $ret = new Clipper(0, e, false);
$ret.i = a.r;
return $ret;
})());
let k = this.w4(b);
let l = this.xAxis.f9(k.left, g);
let m = this.xAxis.f9(k.right, g);
b.df.j(a.r, this.trendLineType, this.z2, this.z3, this.trendLinePeriod, (n) => this.xAxis.f6(n, g), (n) => this.yAxis.f6(n, h), ((() => {
let $ret = new TrendResolutionParams();
$ret.d = this.ik;
$ret.i = e;
$ret.h = f;
$ret.j = d;
return $ret;
})()), j, l, m);
if (b.aa.count > 0) {
a.p.clear();
for (let n = 0; n < b.aa.count; n++) {
a.p.add(new List$1(Point_$type, 0));
let o = b.aa._inner[n];
o.j(a.p._inner[n], o.g$b, this.z2, this.z3, o.g$f, (p) => this.xAxis.f6(p, g), (p) => this.yAxis.f6(p, h), ((() => {
let $ret = new TrendResolutionParams();
$ret.d = this.ik;
$ret.i = e;
$ret.h = f;
$ret.j = d;
return $ret;
})()), j, l, m);
}
}
this.aby(a, b);
}
pi(a, b) {
super.pi(a, b);
let c = b;
c.dm(a);
}
get_fh() {
return true;
}
zw(a, b, c) {
return null;
}
zx(a, b, c) {
if (this.dp == null) {
return null;
}
let d = this.zm();
let e = this.zi.ce(this.wr(b));
let f = -1;
if (e == null) {
if (a != null) {
f = this.dp.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;
}
xg(a, b) {
if (this.xt != 1 && this.xt != 13) {
let c = this.xr.c8();
let d = (c.width / 2) + (this.x4 / 2);
let e = (c.height / 2) + (this.x4 / 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);
}
zv(a, b, c) {
let d = new HighlightingInfo();
d.i = this;
d.g = 0;
d.f = this.dp.count - 1;
d.c = true;
if (c != null && c.g == d.g && c.f == d.f) {
return c;
}
return d;
}
dh(a, b, c) {
if (this.ef && this.f2(this.by) && !c) {
let d = this.zw(a, b, this.zy);
this.zy = d;
return d;
}
else {
let e = this.zv(a, b, this.zy);
this.zy = e;
return e;
}
}
di(a, b, c) {
if (this.f2(this.by) && !c) {
let d = this.zx(a, b, this.zz);
this.zz = d;
return d;
}
else {
let e = this.zv(a, b, this.zz);
e.d = true;
this.zz = e;
return e;
}
}
aag() {
return (this.assigningScatterStyle != null && this.z6) || this.d3 || (this.by != 1) || (this.cq != 1) || (this.cp != 1);
}
aaf() {
return (this.assigningScatterMarkerStyle != null && this.z5) || this.d3 || (this.by != 1) || (this.cq != 1) || (this.cp != 1);
}
acb(a, b) {
this.rd();
let c = b.b9;
this.zh = ((() => {
let $ret = new ScatterAxisInfoCache();
$ret.a = this.xAxis;
$ret.b = this.yAxis;
$ret.d = this.xAxis.dn;
$ret.e = this.yAxis.dn;
return $ret;
})());
if (this.x1()) {
b.dd.j(a.m, this.x3);
if (this.aaf()) {
this.abq(b, a);
}
}
b.c4();
let d = ((() => {
let $ret = new Clipper(1, NaN, c.bottom, NaN, c.top, false);
$ret.i = b.df.g$n.an;
return $ret;
})());
b.df.g$l(a.r, d);
if (b.aa.count > 0) {
for (let e = 0; e < b.aa.count; e++) {
let f = b.aa._inner[e];
f.g$l(a.p._inner[e], d);
}
}
this.ab8(a, b);
}
ak(a, b) {
let c = new List$1(ChartSelection.$, 0);
this.qi(a, c, b);
return c.toArray();
}
qi(a, b, c) {
this.abs(a, b, c, 0, null);
}
abs(a, b, c, d, e) {
let f = this.dc.y6(this.dc.yw(a));
let g = this.dp.count;
let h = this.zh.a;
let i = this.zh.b;
let j = this.dc.yz(this.xd, this.getEffectiveViewport(), f);
let k = new ScalerParams(0, f, this.dc.y9, h.dn, this.getEffectiveViewport());
let l = new ScalerParams(0, f, this.dc.y9, i.dn, this.getEffectiveViewport());
if (d == 0) {
for (let m = 0; m < g; m++) {
let n = h.f6(this.z2.item(m), k);
let o = i.f6(this.z3.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.dp.item(m);
return $ret;
})()));
}
else {
b.add(((() => {
let $ret = new ChartSelection();
$ret.item = this.dp.item(m);
$ret.series = this;
return $ret;
})()));
}
}
}
}
else {
for (let p = 0; p < g; p++) {
let q = h.f6(this.z2.item(p), k);
let r = i.f6(this.z3.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.dp.item(p);
return $ret;
})()));
}
else {
b.add(((() => {
let $ret = new ChartSelection();
$ret.item = this.dp.item(p);
$ret.series = this;
return $ret;
})()));
}
}
}
}
}
za(a, b) {
return this.zb(a, b);
}
zb(a, b) {
if (b < a || a < 0 || a > this.z2.count || b < 0 || b > this.z2.count) {
return null;
}
let c = new Array((b - a) + 1);
for (let d = a; d <= b; d++) {
let e = d;
c[d - a] = this.dp.item(d);
}
return c;
}
abq(a, b) {
a.ck = true;
this.zu.ay(this, this.aaf(), runOn(this, this.za));
let c = this.zu.d;
let d = c != null;
let e = this.getEffectiveViewport1(a);
let f = this.dp == null ? 0 : this.dp.count;
this.zi.cw((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.abv(h, f, a.t);
}
this.zu.ac(g, i);
}
});
}
abw(a, b, c) {
let d = this.by != 1;
let e = this.cq != 1;
let f = this.cp != 1;
this.zu.a0(this.zu.b, a, b, false);
this.zu.ab(this.ii);
let g = this.zu.ax;
let h = null;
let i = null;
let j = null;
let k = this.dp;
if (d && this.dc != null) {
h = this.dc.d7.getHighlightingInfo(this, k, g.z, g.y, false);
g.c = h;
}
if (e && this.dc != null) {
h = this.dc.d8.getHighlightingInfo(this, k, g.z, g.y, false);
g.d = h;
}
if (f && this.dc != null) {
h = this.dc.d6.getHighlightingInfo(this, k, g.z, g.y, false);
g.b = h;
}
g.h = c;
this.ab6(g);
this.zu.z(this, h, i, j, c, d, e, f, a < 0);
}
abv(a, b, c) {
let d = this.by != 1;
let e = this.cq != 1;
let f = this.cp != 1;
this.zu.a0(this.zu.d, a, b, true);
this.zu.aa(this.ii);
let g = this.zu.aw;
let h = null;
let i = null;
let j = null;
let k = this.dp;
let l = null;
let m = null;
let n = null;
if (d && this.dc != null) {
h = this.dc.d7.getHighlightingInfo(this, k, g.z, g.y, true);
if (this.dc.d7.isCrossContextHighlight(this)) {
l = this.dc.d7.getHighlightingInfo(this, k, g.z, g.y, true);
}
g.c = h;
}
if (e && this.dc != null) {
i = this.dc.d8.getHighlightingInfo(this, k, g.z, g.y, true);
if (i == null && this.bo != null) {
i = this.dc.d8.getHighlightingInfo(this.bo, this.bo.dp, g.z, g.y, true);
}
if (i == null && this.bl != null) {
i = this.dc.d8.getHighlightingInfo(this.bl, this.bl.dp, g.z, g.y, true);
}
if (this.dc.d8.isCrossContextHighlight(this)) {
m = this.dc.d8.getHighlightingInfo(this, k, g.z, g.y, true);
}
g.d = i;
}
if (f && this.dc != null) {
j = this.dc.d6.getHighlightingInfo(this, k, g.z, g.y, true);
if (this.dc.d6.isCrossContextHighlight(this)) {
n = this.dc.d6.getHighlightingInfo(this, k, g.z, g.y, true);
}
g.d = i;
}
g.h = c;
this.ab5(g);
this.zu.y(this, h, i, j, c, d, e, f, g.v, this.dc.d7.totalHighWaterMark, g.x, this.dc.d8.totalHighWaterMark, g.t, this.dc.d6.totalHighWaterMark);
}
ab6(a) {
if (this.assigningScatterStyle != null && this.z6) {
this.assigningScatterStyle(this, a);
}
}
ab5(a) {
if (this.assigningScatterMarkerStyle != null && this.z5) {
this.assigningScatterMarkerStyle(this, a);
}
}
aby(a, b) {
let c = new ErrorBarsHelper(this, b);
if (this.zj == null) {
return;
}
let d = this.zj.u;
let e = this.zj.v;
let f = 0;
let g = 0;
let h = 0;
let i = 0;
for (let j of fromEnum(a.m.keys)) {
let k = a.m.item(j);
if (d != null) {
switch (d.getCalculatorType()) {
case 1:
let l = this.ab1(k, c, d, h, i, true);
h = l.p3;
i = l.p4;
break;
case 0:
let m = this.abz(k, c, d, h, i, true);
h = m.p3;
i = m.p4;
break;
case 2:
let n = this.abx(k, c, d, j, h, i, true);
h = n.p4;
i = n.p5;
break;
case 3:
let o = this.ab2(c, d, f, h, i, true);
f = o.p2;
h = o.p3;
i = o.p4;
break;
case 4:
let p = this.