igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
1,421 lines • 73.6 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);
}
ph() {
super.ph();
this.xAxis = null;
this.yAxis = null;
}
rj(a) {
super.rj(a);
this.zn = a;
}
get_f0() {
return true;
}
ai() {
return [this.xAxis, this.yAxis];
}
k1(a, b) {
let c = this.nq(b);
if (c == ScatterBase.$$p[12]) {
return this.k2(a, b, this.abj);
}
if (c == ScatterBase.$$p[16]) {
return this.k2(a, b, this.abr);
}
if (c == ScatterBase.$$p[1]) {
return this.k2(a, b, this.aa3);
}
if (c == ScatterBase.$$p[2]) {
return this.k2(a, b, this.aa5);
}
return null;
}
mq(a) {
let b = this.nq(a);
if (b == ScatterBase.$$p[12]) {
return this.abj;
}
if (b == ScatterBase.$$p[16]) {
return this.abr;
}
if (b == ScatterBase.$$p[1]) {
return this.aa3;
}
if (b == ScatterBase.$$p[2]) {
return this.aa5;
}
return super.mq(a);
}
ed(a, b, c, d, e) {
if (!this.hasMarkers) {
return false;
}
let f = this.xAxis;
let g = new ScalerParams(1, this.dc.yv, this.xf, f.dn);
g.c = this.getEffectiveViewport1(this.cw);
let h = this.yAxis;
let i = new ScalerParams(1, this.dc.yv, this.xf, h.dn);
i.c = this.getEffectiveViewport1(this.cw);
a.clear();
this.xt.cw((j) => {
if (j._visibility == 0) {
let k = new SeriesPointOfInterest();
let l = j.n;
let m = j.o;
if (!e && (l < this.xf.left || l > this.xf.right || m < this.xf.top || m > this.xf.bottom)) {
return;
}
k.d = f.ga(l, g);
k.e = h.ga(m, i);
k.b = j.content;
k.g = this.v2;
k.c = j.al;
if (this.hh) {
k.g = this.v9(j.al);
}
a.add(k);
}
});
return true;
}
b3() {
if (this.b4 == 0) {
{
return 1;
}
}
else {
return super.b3();
}
}
xc(a) {
if (!this.hasMarkers || !this.x3()) {
return Rect.empty;
}
let b = this.xt.ce(this.wt(a));
if (b != null) {
return this.xt.c7(b);
}
return Rect.empty;
}
g4(a, b) {
if (this.x4(a, b)) {
return true;
}
return false;
}
constructor() {
super();
this.zm = null;
this.z5 = null;
this.z6 = null;
this.adb = null;
this.adc = null;
this.zv = 1;
this.zc = null;
this.zd = null;
this.zs = null;
this.zu = null;
this.zq = null;
this.aab = false;
this.aaa = false;
this.z3 = null;
this.z4 = null;
this.assigningScatterStyle = null;
this.assigningScatterMarkerStyle = null;
this.zz = null;
this.zt = null;
this.zp = null;
this.z9 = true;
this.aao = 0;
this.aap = 0;
this.aaq = 0;
this.aar = 0;
this.zw = this.zx();
this.zz = new ScatterSeriesRenderManager();
this.zt = new ScatterFrame();
this.adc = Rect.empty;
this.adb = Rect.empty;
}
get z7() {
return this.z5;
}
set z7(a) {
if (this.z5 != a) {
let b = this.z7;
this.z5 = a;
this.raisePropertyChanged("XColumn", b, this.z7);
}
}
get z8() {
return this.z6;
}
set z8(a) {
if (this.z6 != a) {
let b = this.z8;
this.z6 = a;
this.raisePropertyChanged("YColumn", b, this.z8);
}
}
gj() {
return this.highlightedItemsSource != null || (this.aa3 != null && this.aa5 != null);
}
aam() {
return false;
}
h1() {
let a = super.h1();
{
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.abz));
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.aby));
a.add(c);
}
if (this.aam()) {
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.aam()) {
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.sk));
a.add(e);
}
if (!this.aam()) {
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.sk));
a.add(f);
}
return a;
}
aby(a, b) {
if (this.aa3 != null) {
b.value = this.aa3;
return;
}
b.value = this.abj;
}
abz(a, b) {
if (this.aa5 != null) {
b.value = this.aa5;
return;
}
b.value = this.abr;
}
get ac8() {
return this.c(ScatterBase.acj);
}
set ac8(a) {
this.h(ScatterBase.acj, a);
}
get GetErrorBarsXAxis() {
return this.xAxis;
}
get GetErrorBarsYAxis() {
return this.yAxis;
}
qr() {
super.qr();
if (this.xAxis != null) {
this.xAxis.l0(false);
}
if (this.yAxis != null) {
this.yAxis.l0(false);
}
}
rs(a, b, c, d) {
super.rs(a, b, c, d);
if (this.zn.df.g$e(a, b, c, d)) {
this.sa(false);
this.q2();
}
switch (b) {
case ScatterBase.$$p[10]:
case ScatterBase.$$p[14]:
case ScatterBase.$$p[11]:
case ScatterBase.$$p[15]:
this.qw();
break;
case "FastItemsSource":
if (typeCast(IFastItemsSource_$type, c) != null) {
c.deregisterColumn(this.z7);
c.deregisterColumn(this.z8);
this.z7 = null;
this.z8 = null;
}
if (typeCast(IFastItemsSource_$type, d) != null) {
this.z7 = this.dl(this.abj);
this.z8 = this.dl(this.abr);
}
if ((this.yAxis != null && !this.yAxis.ee()) || (this.xAxis != null && !this.xAxis.ee())) {
this.sa(this.go && c != null);
}
break;
case ScatterBase.$$p[9]:
if (c != null) {
c.cx(this);
}
if (d != null) {
d.d4(this);
}
if ((this.xAxis != null && !this.xAxis.ee()) || (d == null && c != null)) {
this.sa(false);
}
this.q2();
break;
case ScatterBase.$$p[13]:
if (c != null) {
c.cx(this);
}
if (d != null) {
d.d4(this);
}
if ((this.yAxis != null && !this.yAxis.ee()) || (d == null && c != null)) {
this.sa(false);
}
this.q2();
break;
case ScatterBase.$$p[12]:
if (this.dp != null) {
this.dp.deregisterColumn(this.z7);
this.z7 = this.dl(this.abj);
}
break;
case "XColumn":
this.zn.df.g$m();
if (this.xAxis != null && !this.xAxis.ee()) {
this.sa(this.go && this.d9);
}
break;
case ScatterBase.$$p[16]:
if (this.dp != null) {
this.dp.deregisterColumn(this.z8);
this.z8 = this.dl(this.abr);
}
break;
case "YColumn":
this.zn.df.g$m();
if (this.yAxis != null && !this.yAxis.ee()) {
this.sa(this.go && this.d9);
}
break;
case ScatterBase.$$p[7]:
this.sa(false);
this.q2();
break;
case ScatterBase.$$p[8]:
this.sa(false);
this.q2();
break;
case "TransitionProgress":
this.zu.d(this.j1, this.zs, this.zq);
this.abt();
try {
if (this.d7(this.cw)) {
return;
}
if ((Math.round(this.j1 * 100000) / 100000) == 1) {
this.acg(this.zq, this.zn);
}
else {
this.acg(this.zu, this.zn);
}
if (this.dc != null) {
this.dc.sv(this);
}
}
finally {
this.ach();
}
break;
case "TrendLineBrush":
this.ry(b);
break;
case ScatterBase.$$p[0]:
if (this.zo != null) {
this.zo.r = this;
}
this.sa(false);
this.q2();
break;
case "TrendLineType":
this.q2();
break;
case ScatterBase.$$p[4]:
this.aab = this.aaj();
this.sa(false);
break;
case ScatterBase.$$p[3]:
this.aaa = this.aai();
this.sa(false);
break;
case ScatterBase.$$p[5]:
this.zw = this.zx();
break;
}
}
aaj() {
return this.aaf;
}
aai() {
return this.aae;
}
aad(a) {
if (typeCast(NumericYAxis.$, a) !== null) {
return true;
}
return false;
}
aac(a) {
if (typeCast(NumericXAxis.$, a) !== null) {
return true;
}
return false;
}
ach() {
this.adb = Rect.empty;
this.adc = Rect.empty;
}
abt() {
let a = this.getViewInfo(this.adb, this.adc);
this.adb = a.p0;
this.adc = a.p1;
}
aah(a, b) {
if (b != 3) {
return true;
}
if (a == null) {
return true;
}
if (this.abj == a || this.abr == a) {
return true;
}
return false;
}
pq(a, b, c, d) {
let e = false;
if (!this.aah(d, a)) {
return;
}
this.zn.df.g$i(a, b, c, d);
if (this.zn.aa.count > 0) {
for (let f of fromEnum(this.zn.aa)) {
f.g$i(a, b, c, d);
}
}
if (this.xAxis != null && !this.xAxis.ee()) {
e = true;
}
if (this.yAxis != null && !this.yAxis.ee()) {
e = true;
}
if (a == 0 || a == 2 || a == 3 || a == 4) {
this.z9 = true;
}
else if (a == 1) {
for (let g = b; g < b + c; g++) {
this.aao += this.z7.item(g);
this.aap += this.z8.item(g);
}
this.aaq = this.aao / this.z7.count;
this.aar = this.aap / this.z8.count;
}
if (e) {
this.sa(true);
}
}
ab8(a) {
this.ab9(a, null);
}
ab9(a, b) {
let c = this.z7 != null ? this.z7.count : 0;
let d = this.z8 != null ? this.z8.count : 0;
let e = Math.min(c, d);
if (e <= this.aaz) {
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.z7 != null) {
return new AxisRange(this.z7.minimum, this.z7.maximum);
}
if (a != null && a == this.yAxis && this.z8 != null) {
return new AxisRange(this.z8.minimum, this.z8.maximum);
}
return null;
}
ky(a) {
let b = this.ke(a);
if (this.dp != null && b >= 0 && b < this.dp.count) {
return this.dp.item(b);
}
return null;
}
get zw() {
return this.zv;
}
set zw(a) {
let b = this.zv;
this.zv = a;
if (b != this.zv) {
this.raisePropertyChanged("ActualItemSearchMode", enumGetBox(ScatterItemSearchMode_$type, b), enumGetBox(ScatterItemSearchMode_$type, this.zv));
}
}
zx() {
if (this.zy != 0) {
return this.zy;
}
return this.aag ? 4 : 1;
}
ke(a) {
let b = truncate(Math.round(this.i0(a)));
return b;
}
i0(a) {
switch (this.zw) {
case 1: return this.aav(a);
case 3: return this.aaw(a);
case 2: return this.aat(a);
case 4: return this.aau(a);
case 5: return this.aas(a);
}
return -1;
}
aau(a) {
return this.aax(a, false);
}
aat(a) {
let b = this.wt(a);
let c = b.x;
let d = b.y;
if (this.dp == null || this.xAxis == null || this.yAxis == null || this.z7 == null || this.z8 == null) {
return -1;
}
if (this.dp.count > this.aay) {
return -1;
}
this.abw();
let e = this.zc;
let f = this.zd;
if (e == null || f == null) {
return -1;
}
let g = 1.7976931348623157E+308;
let h = -1;
for (let i = 0; i < this.z7.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;
}
abw() {
let a = this.cw.ca;
let b = this.cw.b9;
let c = this.getEffectiveViewport();
if (this.zm == null) {
return;
}
let d = new ScalerParams(0, a, b, this.zm.d, c);
let e = ((() => {
let $ret = new ScalerParams(0, a, b, this.zm.e, c);
$ret.b = this.i7();
return $ret;
})());
if (this.zc == null || this.zd == null) {
let f = arrayShallowClone(this.z7.asArray());
let g = arrayShallowClone(this.z8.asArray());
this.xAxis.k3(boxArray$1(f), 0, f.length, d);
this.yAxis.k3(boxArray$1(g), 0, g.length, e);
this.zc = f;
this.zd = g;
}
}
get_aag() {
return false;
}
get aag() {
return this.get_aag();
}
aax(a, b) {
if (!this.aag) {
return -1;
}
let c = { $type: Point_$type, x: 0, y: 0 };
let d = true;
let e = this.zr();
if (e == null) {
return -1;
}
if (e.q == null) {
return -1;
}
if (this.dp == null || this.dp.count > this.aay) {
return -1;
}
this.abw();
let f = this.zc;
let g = this.zd;
if (f == null || g == null) {
return -1;
}
let h = this.wt(a);
let i = 1.7976931348623157E+308;
let j = -1;
for (let k = 0; k < this.zc.length; k++) {
let l = { $type: Point_$type, x: this.zc[k], y: this.zd[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.zc[j], y: this.zd[j] };
let o = { $type: Point_$type, x: this.zc[j - 1], y: this.zd[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;
}
aaw(a) {
return this.aax(a, true);
}
aas(a) {
let b = this.wt(a);
let c = b.x;
let d = b.y;
if (this.zn.dg.e > this.aay) {
return -1;
}
let e = -1;
this.xt.cx((f) => {
let g = this.zn.c7(f);
let h = g.left;
let i = g.top;
let j = g.width;
let k = g.height;
if (this.x0) {
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.al;
}
}
}
else {
if (c > h && c < h + j && d > i && d < i + k) {
if (e == -1) {
e = f.al;
}
}
}
});
return e;
}
aav(a) {
let b = null;
let c = 1.7976931348623157E+308;
let d = this.wt(a);
let e = d.x;
let f = d.y;
if (this.zn.dg.e > this.aay) {
return -1;
}
this.zn.dn((g) => {
if (g._visibility == 0) {
let h = this.zn.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.al;
}
return -1;
}
wy(a, b, c) {
if (this.xAxis == null || this.yAxis == null || this.z7 == null || this.z8 == 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.i7();
return $ret;
})());
if (b) {
let i = this.i0(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.f7(this.z7.item(j), g);
let m = this.yAxis.f7(this.z8.item(j), h);
return { $type: Point_$type, x: l, y: m };
}
let n = i - Math.floor(i);
let o = this.xAxis.f7(this.z7.item(j), g);
let p = this.yAxis.f7(this.z8.item(j), h);
let q = this.xAxis.f7(this.z7.item(k), g);
let r = this.yAxis.f7(this.z8.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.ke(a);
if (u == -1) {
return { $type: Point_$type, x: NaN, y: NaN };
}
let v = this.xAxis.f7(this.z7.item(u), g);
let w = this.yAxis.f7(this.z8.item(u), h);
return { $type: Point_$type, x: v, y: w };
}
}
gl(a) {
let b = this.dc != null ? this.dc.yv : Rect.empty;
b = b.copy();
let c = this.dc != null ? this.dc.zd : Rect.empty;
let d = new Rect(0, 0, 0, 1, 1);
let e = this.w8(this.cw);
let f = new ScalerParams(0, d, d, this.xAxis.dn, e);
let g = ((() => {
let $ret = new ScalerParams(0, d, d, this.yAxis.dn, e);
$ret.b = this.i7();
return $ret;
})());
let h = !b.isEmpty && !c.isEmpty && this.dp != null ? this.dp.indexOf(a) : -1;
let i = this.xAxis != null && this.z7 != null && h < this.z7.count ? this.xAxis.f7(this.z7.item(h), f) : NaN;
let j = this.yAxis != null && this.z8 != null && h < this.z8.count ? this.yAxis.f7(this.z8.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;
}
ta(a, b) {
this.sa(false);
}
tb(a, b) {
this.sa(false);
}
zr() {
let a = this.zq;
if (this.d4()) {
if (this.dd.g) {
this.dd.t();
}
a = this.zu;
}
return a;
}
abu(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.zm.d, f);
$ret.c = this.getEffectiveViewport1(a);
return $ret;
})());
let k = ((() => {
let $ret = new ScalerParams(0, d, e, this.zm.e, f);
$ret.c = this.getEffectiveViewport1(a);
$ret.b = this.i7();
return $ret;
})());
let l = false;
let m = 0;
if (this.dc != null) {
if (this.dc.g1()) {
let n = this.dc.ol(d, j);
l = n.c;
m = n.d;
}
}
for (let o = 0; o < c; o++) {
h = this.z7.item(o);
i = this.z8.item(o);
let p = { $type: Point_$type, x: this.zm.a.f7(h, j), y: this.zm.b.f7(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;
})()));
}
}
}
}
ab5(a, b) {
this.zc = null;
this.zd = null;
a.m.clear();
a.r.clear();
a.k.clear();
a.o.clear();
a.l.clear();
a.n.clear();
let c = Math.min(this.z7 != null ? this.z7.count : 0, this.z8 != null ? this.z8.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.i7();
return $ret;
})());
h.c = this.getEffectiveViewport1(b);
if (c < 1) {
return;
}
this.zm = ((() => {
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.aaz) {
this.abu(i, a, c, d, e);
}
if (this.x3()) {
b.dd.l(a.m, this.aaz, d, e, this.im);
}
let j = ((() => {
let $ret = new Clipper(0, e, false);
$ret.i = a.r;
return $ret;
})());
let k = this.w6(b);
let l = this.xAxis.ga(k.left, g);
let m = this.xAxis.ga(k.right, g);
b.df.j(a.r, this.trendLineType, this.z7, this.z8, this.trendLinePeriod, (n) => this.xAxis.f7(n, g), (n) => this.yAxis.f7(n, h), ((() => {
let $ret = new TrendResolutionParams();
$ret.d = this.im;
$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.z7, this.z8, o.g$f, (p) => this.xAxis.f7(p, g), (p) => this.yAxis.f7(p, h), ((() => {
let $ret = new TrendResolutionParams();
$ret.d = this.im;
$ret.i = e;
$ret.h = f;
$ret.j = d;
return $ret;
})()), j, l, m);
}
}
this.ab3(a, b);
}
pk(a, b) {
super.pk(a, b);
let c = b;
c.dm(a);
}
get_fh() {
return true;
}
z1(a, b, c) {
return null;
}
z2(a, b, c) {
if (this.dp == null) {
return null;
}
let d = this.zr();
let e = this.zn.ce(this.wt(b));
let f = -1;
if (e == null) {
if (a != null) {
f = this.dp.indexOf(a);
}
else {
return null;
}
}
else {
f = e.al;
}
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;
}
xi(a, b) {
if (this.xv != 1 && this.xv != 13) {
let c = this.xt.c8();
let d = (c.width / 2) + (this.x7 / 2);
let e = (c.height / 2) + (this.x7 / 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);
}
z0(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.f3(this.by) && !c) {
let d = this.z1(a, b, this.z3);
this.z3 = d;
return d;
}
else {
let e = this.z0(a, b, this.z3);
this.z3 = e;
return e;
}
}
di(a, b, c) {
if (this.f3(this.by) && !c) {
let d = this.z2(a, b, this.z4);
this.z4 = d;
return d;
}
else {
let e = this.z0(a, b, this.z4);
e.d = true;
this.z4 = e;
return e;
}
}
aal() {
return (this.assigningScatterStyle != null && this.aab) || this.d3 || (this.by != 1) || (this.cq != 1) || (this.cp != 1);
}
aak() {
return (this.assigningScatterMarkerStyle != null && this.aaa) || this.d3 || (this.by != 1) || (this.cq != 1) || (this.cp != 1);
}
acg(a, b) {
this.rf();
let c = b.b9;
this.zm = ((() => {
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.x3()) {
b.dd.j(a.m, this.x5);
if (this.aak()) {
this.abv(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.acd(a, b);
}
ak(a, b) {
let c = new List$1(ChartSelection.$, 0);
this.qk(a, c, b);
return c.toArray();
}
qk(a, b, c) {
this.abx(a, b, c, 0, null);
}
abx(a, b, c, d, e) {
let f = this.dc.za(this.dc.y0(a));
let g = this.dp.count;
let h = this.zm.a;
let i = this.zm.b;
let j = this.dc.y3(this.xf, this.getEffectiveViewport(), f);
let k = new ScalerParams(0, f, this.dc.zd, h.dn, this.getEffectiveViewport());
let l = new ScalerParams(0, f, this.dc.zd, i.dn, this.getEffectiveViewport());
if (d == 0) {
for (let m = 0; m < g; m++) {
let n = h.f7(this.z7.item(m), k);
let o = i.f7(this.z8.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.f7(this.z7.item(p), k);
let r = i.f7(this.z8.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;
})()));
}
}
}
}
}
zf(a, b) {
return this.zg(a, b);
}
zg(a, b) {
if (b < a || a < 0 || a > this.z7.count || b < 0 || b > this.z7.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;
}
abv(a, b) {
a.ck = true;
this.zz.ay(this, this.aak(), runOn(this, this.zf));
let c = this.zz.d;
let d = c != null;
let e = this.getEffectiveViewport1(a);
let f = this.dp == null ? 0 : this.dp.count;
this.zn.cw((g) => {
if (g._visibility == 0) {
let h = g.al;
let i = g.content;
if (i == null) {
i = new DataContext();
g.content = i;
}
if (d) {
this.ab0(h, f, a.t);
}
this.zz.ac(g, i);
}
});
}
ab1(a, b, c) {
let d = this.by != 1;
let e = this.cq != 1;
let f = this.cp != 1;
this.zz.a0(this.zz.b, a, b, false);
this.zz.ab(this.ik);
let g = this.zz.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.acb(g);
this.zz.z(this, h, i, j, c, d, e, f, a < 0);
}
ab0(a, b, c) {
let d = this.by != 1;
let e = this.cq != 1;
let f = this.cp != 1;
this.zz.a0(this.zz.d, a, b, true);
this.zz.aa(this.ik);
let g = this.zz.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.aca(g);
this.zz.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);
}
acb(a) {
if (this.assigningScatterStyle != null && this.aab) {
this.assigningScatterStyle(this, a);
}
}
aca(a) {
if (this.assigningScatterMarkerStyle != null && this.aaa) {
this.assigningScatterMarkerStyle(this, a);
}
}
ab3(a, b) {
let c = new ErrorBarsHelper(this, b);
if (this.zo == null) {
return;
}
let d = this.zo.u;
let e = this.zo.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.ab6(k, c, d, h, i, true);
h = l.p3;
i = l.p4;
break;
case 0:
let m = this.ab4(k, c, d, h, i, true);
h = m.p3;
i = m.p4;
break;
case 2:
let n = this.ab2(k, c, d, j, h, i, true);
h = n.p4;
i = n.p5;
break;
case 3:
let o = this.ab7(c, d, f, h, i, true);
f = o.p2;
h = o.p3;
i = o.p4;
break;
case 4:
le