igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
1,423 lines • 73.3 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 { 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);
}
o2() {
super.o2();
this.xAxis = null;
this.yAxis = null;
}
q1(a) {
super.q1(a);
this.yz = a;
}
get_fw() {
return true;
}
ai() {
return [this.xAxis, this.yAxis];
}
kq(a, b) {
let c = this.nd(b);
if (c == ScatterBase.$$p[12]) {
return this.kr(a, b, this.aav);
}
if (c == ScatterBase.$$p[16]) {
return this.kr(a, b, this.aa3);
}
if (c == ScatterBase.$$p[1]) {
return this.kr(a, b, this.aaf);
}
if (c == ScatterBase.$$p[2]) {
return this.kr(a, b, this.aah);
}
return null;
}
md(a) {
let b = this.nd(a);
if (b == ScatterBase.$$p[12]) {
return this.aav;
}
if (b == ScatterBase.$$p[16]) {
return this.aa3;
}
if (b == ScatterBase.$$p[1]) {
return this.aaf;
}
if (b == ScatterBase.$$p[2]) {
return this.aah;
}
return super.md(a);
}
ec(a, b, c, d, e) {
if (!this.hasMarkers) {
return false;
}
let f = this.xAxis;
let g = new ScalerParams(1, this.dc.v5, this.wu, f.ch);
g.c = this.getEffectiveViewport1(this.cw);
let h = this.yAxis;
let i = new ScalerParams(1, this.dc.v5, this.wu, h.ch);
i.c = this.getEffectiveViewport1(this.cw);
a.clear();
this.w8.cn((j) => {
if (j._visibility == 0) {
let k = new SeriesPointOfInterest();
let l = j.n;
let m = j.o;
if (l < this.wu.left || l > this.wu.right || m < this.wu.top || m > this.wu.bottom) {
return;
}
k.d = f.eo(l, g);
k.e = h.eo(m, i);
k.b = j.content;
k.g = this.vi;
k.c = j.ak;
if (this.g9) {
k.g = this.vp(j.ak);
}
a.add(k);
}
});
return true;
}
b3() {
if (this.b4 == 0) {
if (this.aab <= 2000) {
return 1;
}
else {
return super.b3();
}
}
else {
return super.b3();
}
}
wr(a) {
if (!this.hasMarkers || !this.xi()) {
return Rect.empty;
}
let b = this.w8.b5(this.v9(a));
if (b != null) {
return this.w8.cy(b);
}
return Rect.empty;
}
gw(a, b) {
if (this.xj(a, b)) {
return true;
}
return false;
}
constructor() {
super();
this.yy = null;
this.zh = null;
this.zi = null;
this.acn = null;
this.aco = null;
this.y7 = 1;
this.yo = null;
this.yp = null;
this.y4 = null;
this.y6 = null;
this.y2 = null;
this.zn = false;
this.zm = false;
this.zf = null;
this.zg = null;
this.assigningScatterStyle = null;
this.assigningScatterMarkerStyle = null;
this.zb = null;
this.y5 = null;
this.y1 = null;
this.zl = true;
this.z0 = 0;
this.z1 = 0;
this.z2 = 0;
this.z3 = 0;
this.y8 = this.y9();
this.zb = new ScatterSeriesRenderManager();
this.y5 = new ScatterFrame();
this.aco = Rect.empty;
this.acn = Rect.empty;
}
get zj() {
return this.zh;
}
set zj(a) {
if (this.zh != a) {
let b = this.zj;
this.zh = a;
this.raisePropertyChanged("XColumn", b, this.zj);
}
}
get zk() {
return this.zi;
}
set zk(a) {
if (this.zi != a) {
let b = this.zk;
this.zi = a;
this.raisePropertyChanged("YColumn", b, this.zk);
}
}
gb() {
return this.highlightedItemsSource != null || (this.aaf != null && this.aah != null);
}
zy() {
return false;
}
ht() {
let a = super.ht();
{
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.abb));
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.aba));
a.add(c);
}
if (this.zy()) {
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.zy()) {
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.r2));
a.add(e);
}
if (!this.zy()) {
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.r2));
a.add(f);
}
return a;
}
aba(a, b) {
if (this.aaf != null) {
b.value = this.aaf;
return;
}
b.value = this.aav;
}
abb(a, b) {
if (this.aah != null) {
b.value = this.aah;
return;
}
b.value = this.aa3;
}
get ack() {
return this.c(ScatterBase.abv);
}
set ack(a) {
this.h(ScatterBase.abv, a);
}
get GetErrorBarsXAxis() {
return this.xAxis;
}
get GetErrorBarsYAxis() {
return this.yAxis;
}
qb() {
super.qb();
if (this.xAxis != null) {
this.xAxis.ib(false);
}
if (this.yAxis != null) {
this.yAxis.ib(false);
}
}
ra(a, b, c, d) {
super.ra(a, b, c, d);
if (this.yz.c6.g$e(a, b, c, d)) {
this.rs(false);
this.ql();
}
switch (b) {
case ScatterBase.$$p[10]:
case ScatterBase.$$p[14]:
case ScatterBase.$$p[11]:
case ScatterBase.$$p[15]:
this.qf();
break;
case "FastItemsSource":
if (typeCast(IFastItemsSource_$type, c) != null) {
c.deregisterColumn(this.zj);
c.deregisterColumn(this.zk);
this.zj = null;
this.zk = null;
}
if (typeCast(IFastItemsSource_$type, d) != null) {
this.zj = this.dl(this.aav);
this.zk = this.dl(this.aa3);
}
if ((this.yAxis != null && !this.yAxis.c1()) || (this.xAxis != null && !this.xAxis.c1())) {
this.rs(this.gg && 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.rs(false);
}
this.ql();
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.rs(false);
}
this.ql();
break;
case ScatterBase.$$p[12]:
if (this.dp != null) {
this.dp.deregisterColumn(this.zj);
this.zj = this.dl(this.aav);
}
break;
case "XColumn":
this.yz.c6.g$m();
if (this.xAxis != null && !this.xAxis.c1()) {
this.rs(this.gg && this.d8);
}
break;
case ScatterBase.$$p[16]:
if (this.dp != null) {
this.dp.deregisterColumn(this.zk);
this.zk = this.dl(this.aa3);
}
break;
case "YColumn":
this.yz.c6.g$m();
if (this.yAxis != null && !this.yAxis.c1()) {
this.rs(this.gg && this.d8);
}
break;
case ScatterBase.$$p[7]:
this.rs(false);
this.ql();
break;
case ScatterBase.$$p[8]:
this.rs(false);
this.ql();
break;
case "TransitionProgress":
this.y6.c(this.jq, this.y4, this.y2);
this.aa5();
try {
if (this.d6(this.cw)) {
return;
}
if ((Math.round(this.jq * 100000) / 100000) == 1) {
this.abs(this.y2, this.yz);
}
else {
this.abs(this.y6, this.yz);
}
if (this.dc != null) {
this.dc.qp(this);
}
}
finally {
this.abt();
}
break;
case "TrendLineBrush":
this.rg(b);
break;
case ScatterBase.$$p[0]:
if (this.y0 != null) {
this.y0.r = this;
}
this.rs(false);
this.ql();
break;
case "TrendLineType":
this.ql();
break;
case ScatterBase.$$p[4]:
this.zn = this.zv();
this.rs(false);
break;
case ScatterBase.$$p[3]:
this.zm = this.zu();
this.rs(false);
break;
case ScatterBase.$$p[5]:
this.y8 = this.y9();
break;
}
}
zv() {
return this.zr;
}
zu() {
return this.zq;
}
zp(a) {
if (typeCast(NumericYAxis.$, a) !== null) {
return true;
}
return false;
}
zo(a) {
if (typeCast(NumericXAxis.$, a) !== null) {
return true;
}
return false;
}
abt() {
this.acn = Rect.empty;
this.aco = Rect.empty;
}
aa5() {
let a = this.getViewInfo(this.acn, this.aco);
this.acn = a.p0;
this.aco = a.p1;
}
zt(a, b) {
if (b != 3) {
return true;
}
if (a == null) {
return true;
}
if (this.aav == a || this.aa3 == a) {
return true;
}
return false;
}
pb(a, b, c, d) {
let e = false;
if (!this.zt(d, a)) {
return;
}
this.yz.c6.g$i(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.zl = true;
}
else if (a == 1) {
for (let f = b; f < b + c; f++) {
this.z0 += this.zj.item(f);
this.z1 += this.zk.item(f);
}
this.z2 = this.z0 / this.zj.count;
this.z3 = this.z1 / this.zk.count;
}
if (e) {
this.rs(true);
}
}
abk(a) {
this.abl(a, null);
}
abl(a, b) {
let c = this.zj != null ? this.zj.count : 0;
let d = this.zk != null ? this.zk.count : 0;
let e = Math.min(c, d);
if (e <= this.aab) {
a.n.clear();
let f = new List$1(OwnedPoint.$, 0);
for (let g of fromEnum(a.v.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.n;
}
for (let i of fromEnum(f)) {
if (h.indexOf(i.a) >= 0) {
if (b != null) {
b.j(i.c);
}
else {
a.n.add({ $type: Point_$type, x: i.c.x, y: i.c.y });
}
}
}
}
}
ay(a) {
if (a != null && a == this.xAxis && this.zj != null) {
return new AxisRange(this.zj.minimum, this.zj.maximum);
}
if (a != null && a == this.yAxis && this.zk != null) {
return new AxisRange(this.zk.minimum, this.zk.maximum);
}
return null;
}
kn(a) {
let b = this.j3(a);
if (this.dp != null && b >= 0 && b < this.dp.count) {
return this.dp.item(b);
}
return null;
}
get y8() {
return this.y7;
}
set y8(a) {
let b = this.y7;
this.y7 = a;
if (b != this.y7) {
this.raisePropertyChanged("ActualItemSearchMode", enumGetBox(ScatterItemSearchMode_$type, b), enumGetBox(ScatterItemSearchMode_$type, this.y7));
}
}
y9() {
if (this.za != 0) {
return this.za;
}
return this.zs ? 4 : 1;
}
j3(a) {
let b = truncate(Math.round(this.ir(a)));
return b;
}
ir(a) {
switch (this.y8) {
case 1: return this.z7(a);
case 3: return this.z8(a);
case 2: return this.z5(a);
case 4: return this.z6(a);
case 5: return this.z4(a);
}
return -1;
}
z6(a) {
return this.z9(a, false);
}
z5(a) {
let b = this.v9(a);
let c = b.x;
let d = b.y;
if (this.dp == null || this.xAxis == null || this.yAxis == null || this.zj == null || this.zk == null) {
return -1;
}
if (this.dp.count > this.aaa) {
return -1;
}
this.aa8();
let e = this.yo;
let f = this.yp;
if (e == null || f == null) {
return -1;
}
let g = 1.7976931348623157E+308;
let h = -1;
for (let i = 0; i < this.zj.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;
}
aa8() {
let a = this.cw.b2;
let b = this.cw.b1;
let c = this.getEffectiveViewport();
if (this.yy == null) {
return;
}
let d = new ScalerParams(0, a, b, this.yy.d, c);
let e = ((() => {
let $ret = new ScalerParams(0, a, b, this.yy.e, c);
$ret.b = this.iy();
return $ret;
})());
if (this.yo == null || this.yp == null) {
let f = arrayShallowClone(this.zj.asArray());
let g = arrayShallowClone(this.zk.asArray());
this.xAxis.hq(boxArray$1(f), 0, f.length, d);
this.yAxis.hq(boxArray$1(g), 0, g.length, e);
this.yo = f;
this.yp = g;
}
}
get_zs() {
return false;
}
get zs() {
return this.get_zs();
}
z9(a, b) {
if (!this.zs) {
return -1;
}
let c = { $type: Point_$type, x: 0, y: 0 };
let d = true;
let e = this.y3();
if (e == null) {
return -1;
}
if (e.n == null) {
return -1;
}
if (this.dp == null || this.dp.count > this.aaa) {
return -1;
}
this.aa8();
let f = this.yo;
let g = this.yp;
if (f == null || g == null) {
return -1;
}
let h = this.v9(a);
let i = 1.7976931348623157E+308;
let j = -1;
for (let k = 0; k < this.yo.length; k++) {
let l = { $type: Point_$type, x: this.yo[k], y: this.yp[k] };
if (k > 0) {
if (!b || e.j.containsKey(this.dp.item(k)) || e.j.containsKey(this.dp.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.yo[j], y: this.yp[j] };
let o = { $type: Point_$type, x: this.yo[j - 1], y: this.yp[j - 1] };
if (!b || (e.j.containsKey(this.dp.item(j)) && e.j.containsKey(this.dp.item(j - 1)))) {
let p = GeometryUtil.m(h, o, n);
return (j - 1) + p;
}
else if (e.j.containsKey(this.dp.item(j))) {
return j;
}
else {
return j - 1;
}
}
return -1;
}
z8(a) {
return this.z9(a, true);
}
z4(a) {
let b = this.v9(a);
let c = b.x;
let d = b.y;
if (this.yz.c7.e > this.aaa) {
return -1;
}
let e = -1;
this.w8.co((f) => {
let g = this.yz.cy(f);
let h = g.left;
let i = g.top;
let j = g.width;
let k = g.height;
if (this.xf) {
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;
}
z7(a) {
let b = null;
let c = 1.7976931348623157E+308;
let d = this.v9(a);
let e = d.x;
let f = d.y;
if (this.yz.c7.e > this.aaa) {
return -1;
}
this.yz.de((g) => {
if (g._visibility == 0) {
let h = this.yz.cy(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;
}
we(a, b, c) {
if (this.xAxis == null || this.yAxis == null || this.zj == null || this.zk == null) {
return { $type: Point_$type, x: NaN, y: NaN };
}
let d = this.cw.b2;
let e = this.cw.b1;
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.iy();
return $ret;
})());
if (b) {
let i = this.ir(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.el(this.zj.item(j), g);
let m = this.yAxis.el(this.zk.item(j), h);
return { $type: Point_$type, x: l, y: m };
}
let n = i - Math.floor(i);
let o = this.xAxis.el(this.zj.item(j), g);
let p = this.yAxis.el(this.zk.item(j), h);
let q = this.xAxis.el(this.zj.item(k), g);
let r = this.yAxis.el(this.zk.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.j3(a);
if (u == -1) {
return { $type: Point_$type, x: NaN, y: NaN };
}
let v = this.xAxis.el(this.zj.item(u), g);
let w = this.yAxis.el(this.zk.item(u), h);
return { $type: Point_$type, x: v, y: w };
}
}
gd(a) {
let b = this.dc != null ? this.dc.v5 : Rect.empty;
b = b.copy();
let c = this.dc != null ? this.dc.wn : Rect.empty;
let d = new Rect(0, 0, 0, 1, 1);
let e = this.wn(this.cw);
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.iy();
return $ret;
})());
let h = !b.isEmpty && !c.isEmpty && this.dp != null ? this.dp.indexOf(a) : -1;
let i = this.xAxis != null && this.zj != null && h < this.zj.count ? this.xAxis.el(this.zj.item(h), f) : NaN;
let j = this.yAxis != null && this.zk != null && h < this.zk.count ? this.yAxis.el(this.zk.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;
}
ss(a, b) {
this.rs(false);
}
st(a, b) {
this.rs(false);
}
y3() {
let a = this.y2;
if (this.d4()) {
if (this.dd.g) {
this.dd.t();
}
a = this.y6;
}
return a;
}
aa6(a, b, c, d, e) {
b.g = 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.yy.d, f);
$ret.c = this.getEffectiveViewport1(a);
return $ret;
})());
let k = ((() => {
let $ret = new ScalerParams(0, d, e, this.yy.e, f);
$ret.c = this.getEffectiveViewport1(a);
$ret.b = this.iy();
return $ret;
})());
let l = false;
let m = 0;
if (this.dc != null) {
if (this.dc.f3()) {
let n = this.dc.m5(d, j);
l = n.c;
m = n.d;
}
}
for (let o = 0; o < c; o++) {
h = this.zj.item(o);
i = this.zk.item(o);
let p = { $type: Point_$type, x: this.yy.a.el(h, j), y: this.yy.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;
})()));
}
}
}
}
abh(a, b) {
this.yo = null;
this.yp = null;
a.j.clear();
a.o.clear();
a.h.clear();
a.l.clear();
a.i.clear();
a.k.clear();
let c = Math.min(this.zj != null ? this.zj.count : 0, this.zk != null ? this.zk.count : 0);
let d = b.b2;
let e = b.b1;
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.iy();
return $ret;
})());
h.c = this.getEffectiveViewport1(b);
if (c < 1) {
return;
}
this.yy = ((() => {
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.dp;
return $ret;
})());
let i = b;
if (c <= this.aab) {
this.aa6(i, a, c, d, e);
}
if (this.xi()) {
b.c4.l(a.j, this.aab, d, e, this.id);
}
let j = ((() => {
let $ret = new Clipper(0, e, false);
$ret.i = a.o;
return $ret;
})());
let k = this.wl(b);
let l = this.xAxis.eo(k.left, g);
let m = this.xAxis.eo(k.right, g);
b.c6.j(a.o, this.trendLineType, this.zj, this.zk, this.trendLinePeriod, (n) => this.xAxis.el(n, g), (n) => this.yAxis.el(n, h), ((() => {
let $ret = new TrendResolutionParams();
$ret.d = this.id;
$ret.i = e;
$ret.h = f;
$ret.j = d;
return $ret;
})()), j, l, m);
if (b.w.count > 0) {
a.m.clear();
for (let n = 0; n < b.w.count; n++) {
a.m.add(new List$1(Point_$type, 0));
let o = b.w._inner[n];
o.j(a.m._inner[n], o.g$b, this.zj, this.zk, o.g$f, (p) => this.xAxis.el(p, g), (p) => this.yAxis.el(p, h), ((() => {
let $ret = new TrendResolutionParams();
$ret.d = this.id;
$ret.i = e;
$ret.h = f;
$ret.j = d;
return $ret;
})()), j, l, m);
}
}
this.abf(a, b);
}
o5(a, b) {
super.o5(a, b);
let c = b;
c.dd(a);
}
get_fe() {
return true;
}
zd(a, b, c) {
return null;
}
ze(a, b, c) {
if (this.dp == null) {
return null;
}
let d = this.y3();
let e = this.yz.b5(this.v9(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;
}
wx(a, b) {
if (this.xa != 1 && this.xa != 13) {
let c = this.w8.cz();
let d = (c.width / 2) + (this.xl / 2);
let e = (c.height / 2) + (this.xl / 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);
}
zc(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.ee && this.fz(this.by) && !c) {
let d = this.zd(a, b, this.zf);
this.zf = d;
return d;
}
else {
let e = this.zc(a, b, this.zf);
this.zf = e;
return e;
}
}
di(a, b, c) {
if (this.fz(this.by) && !c) {
let d = this.ze(a, b, this.zg);
this.zg = d;
return d;
}
else {
let e = this.zc(a, b, this.zg);
e.d = true;
this.zg = e;
return e;
}
}
zx() {
return (this.assigningScatterStyle != null && this.zn) || this.d3 || (this.by != 1) || (this.cq != 1) || (this.cp != 1);
}
zw() {
return (this.assigningScatterMarkerStyle != null && this.zm) || this.d3 || (this.by != 1) || (this.cq != 1) || (this.cp != 1);
}
abs(a, b) {
this.qx();
let c = b.b1;
this.yy = ((() => {
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.xi()) {
b.c4.j(a.j, this.xk);
if (this.zw()) {
this.aa7(b, a);
}
}
b.cv();
let d = ((() => {
let $ret = new Clipper(1, NaN, c.bottom, NaN, c.top, false);
$ret.i = b.c6.g$n.an;
return $ret;
})());
b.c6.g$l(a.o, d);
if (b.w.count > 0) {
for (let e = 0; e < b.w.count; e++) {
let f = b.w._inner[e];
f.g$l(a.m._inner[e], d);
}
}
this.abp(a, b);
}
ak(a, b) {
let c = new List$1(ChartSelection.$, 0);
this.p4(a, c, b);
return c.toArray();
}
p4(a, b, c) {
this.aa9(a, b, c, 0, null);
}
aa9(a, b, c, d, e) {
let f = this.dc.wk(this.dc.wa(a));
let g = this.dp.count;
let h = this.yy.a;
let i = this.yy.b;
let j = this.dc.wd(this.wu, this.getEffectiveViewport(), f);
let k = new ScalerParams(0, f, this.dc.wn, h.ch, this.getEffectiveViewport());
let l = new ScalerParams(0, f, this.dc.wn, i.ch, this.getEffectiveViewport());
if (d == 0) {
for (let m = 0; m < g; m++) {
let n = h.el(this.zj.item(m), k);
let o = i.el(this.zk.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.el(this.zj.item(p), k);
let r = i.el(this.zk.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;
})()));
}
}
}
}
}
yr(a, b) {
return this.ys(a, b);
}
ys(a, b) {
if (b < a || a < 0 || a > this.zj.count || b < 0 || b > this.zj.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;
}
aa7(a, b) {
a.cb = true;
this.zb.ay(this, this.zw(), runOn(this, this.yr));
let c = this.zb.d;
let d = c != null;
let e = this.getEffectiveViewport1(a);
let f = this.dp == null ? 0 : this.dp.count;
this.yz.cn((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.abc(h, f, a.r);
}
this.zb.ac(g, i);
}
});
}
abd(a, b, c) {
let d = this.by != 1;
let e = this.cq != 1;
let f = this.cp != 1;
this.zb.a0(this.zb.b, a, b, false);
this.zb.ab(this.ib);
let g = this.zb.ax;
let h = null;
let i = null;
let j = null;
let k = this.dp;
if (d && this.dc != null) {
h = this.dc.dk.getHighlightingInfo(this, k, g.z, g.y, false);
g.c = h;
}
if (e && this.dc != null) {
h = this.dc.dl.getHighlightingInfo(this, k, g.z, g.y, false);
g.d = h;
}
if (f && this.dc != null) {
h = this.dc.dj.getHighlightingInfo(this, k, g.z, g.y, false);
g.b = h;
}
g.h = c;
this.abn(g);
this.zb.z(this, h, i, j, c, d, e, f, a < 0);
}
abc(a, b, c) {
let d = this.by != 1;
let e = this.cq != 1;
let f = this.cp != 1;
this.zb.a0(this.zb.d, a, b, true);
this.zb.aa(this.ib);
let g = this.zb.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.dk.getHighlightingInfo(this, k, g.z, g.y, true);
if (this.dc.dk.isCrossContextHighlight(this)) {
l = this.dc.dk.getHighlightingInfo(this, k, g.z, g.y, true);
}
g.c = h;
}
if (e && this.dc != null) {
i = this.dc.dl.getHighlightingInfo(this, k, g.z, g.y, true);
if (i == null && this.bo != null) {
i = this.dc.dl.getHighlightingInfo(this.bo, this.bo.dp, g.z, g.y, true);
}
if (i == null && this.bl != null) {
i = this.dc.dl.getHighlightingInfo(this.bl, this.bl.dp, g.z, g.y, true);
}
if (this.dc.dl.isCrossContextHighlight(this)) {
m = this.dc.dl.getHighlightingInfo(this, k, g.z, g.y, true);
}
g.d = i;
}
if (f && this.dc != null) {
j = this.dc.dj.getHighlightingInfo(this, k, g.z, g.y, true);
if (this.dc.dj.isCrossContextHighlight(this)) {
n = this.dc.dj.getHighlightingInfo(this, k, g.z, g.y, true);
}
g.d = i;
}
g.h = c;
this.abm(g);
this.zb.y(this, h, i, j, c, d, e, f, g.v, this.dc.dk.totalHighWaterMark, g.x, this.dc.dl.totalHighWaterMark, g.t, this.dc.dj.totalHighWaterMark);
}
abn(a) {
if (this.assigningScatterStyle != null && this.zn) {
this.assigningScatterStyle(this, a);
}
}
abm(a) {
if (this.assigningScatterMarkerStyle != null && this.zm) {
this.assigningScatterMarkerStyle(this, a);
}
}
abf(a, b) {
let c = new ErrorBarsHelper(this, b);
if (this.y0 == null) {
return;
}
let d = this.y0.u;
let e = this.y0.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.abi(k, c, d, h, i, true);
h = l.p3;
i = l.p4;
break;
case 0:
let m = this.abg(k, c, d, h, i, true);
h = m.p3;
i = m.p4;
break;
case 2:
let n = this.abe(k, c, d, j, h, i, true);
h = n.p4;
i = n.p5;
break;
case 3:
let o = this.abj(c, d, f, h, i, true);
f = o.p2;
h = o.p3;
i = o.p4;
break;
case 4:
let p = this.abg(k, c, d, h, i, true);
h = p.p3;
i = p.p4;
break;
}
;