igniteui-angular-charts
Version:
Ignite UI Angular charting components for building rich data visualizations for modern web apps.
1,604 lines • 65.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-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 { CoreGeometryUtil } from "igniteui-angular-core";
import { GeometryUtil } from "igniteui-angular-core";
import { HashPool$2 } from "igniteui-angular-core";
import { DataContext } from "igniteui-angular-core";
import { ScatterTrendLineManager } from "./ScatterTrendLineManager";
import { TrendResolutionParams } from "./TrendResolutionParams";
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 class ScatterBase extends MarkerSeries {
static { this.$t = markType(ScatterBase, 'ScatterBase', MarkerSeries.$, [ISupportsErrorBars_$type, ITrendLineSeries_$type]); }
ct() {
return new ScatterBaseView(this);
}
ph() {
super.ph();
this.xAxis = null;
this.yAxis = null;
}
rj(a) {
super.rj(a);
this.z9 = 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.ab5);
}
if (c == ScatterBase.$$p[16]) {
return this.k2(a, b, this.acd);
}
if (c == ScatterBase.$$p[1]) {
return this.k2(a, b, this.abp);
}
if (c == ScatterBase.$$p[2]) {
return this.k2(a, b, this.abr);
}
return null;
}
mq(a) {
let b = this.nq(a);
if (b == ScatterBase.$$p[12]) {
return this.ab5;
}
if (b == ScatterBase.$$p[16]) {
return this.acd;
}
if (b == ScatterBase.$$p[1]) {
return this.abp;
}
if (b == ScatterBase.$$p[2]) {
return this.abr;
}
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.dr);
g.c = this.getEffectiveViewport1(this.cw);
let h = this.yAxis;
let i = new ScalerParams(1, this.dc.yv, this.xf, h.dr);
i.c = this.getEffectiveViewport1(this.cw);
a.clear();
this.xu.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.gf(l, g);
k.e = h.gf(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.x4()) {
return Rect.empty;
}
let b = this.xu.ce(this.wt(a));
if (b != null) {
return this.xu.c7(b);
}
return Rect.empty;
}
g4(a, b) {
if (this.x5(a, b)) {
return true;
}
return false;
}
constructor() {
super();
this.z8 = null;
this.aar = null;
this.aas = null;
this.adx = null;
this.ady = null;
this.aah = 1;
this.zy = null;
this.zz = null;
this.aae = null;
this.aag = null;
this.aac = null;
this.aax = false;
this.aaw = false;
this.aap = null;
this.aaq = null;
this.assigningScatterStyle = null;
this.assigningScatterMarkerStyle = null;
this.aal = null;
this.aaf = null;
this.aab = null;
this.aav = true;
this.aba = 0;
this.abb = 0;
this.abc = 0;
this.abd = 0;
this.aai = this.aaj();
this.aal = new ScatterSeriesRenderManager();
this.aaf = new ScatterFrame();
this.ady = Rect.empty;
this.adx = Rect.empty;
}
get aat() {
return this.aar;
}
set aat(a) {
if (this.aar != a) {
let b = this.aat;
this.aar = a;
this.raisePropertyChanged("XColumn", b, this.aat);
}
}
get aau() {
return this.aas;
}
set aau(a) {
if (this.aas != a) {
let b = this.aau;
this.aas = a;
this.raisePropertyChanged("YColumn", b, this.aau);
}
}
gj() {
return this.highlightedItemsSource != null || (this.abp != null && this.abr != null);
}
aa8() {
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.acl));
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.ack));
a.add(c);
}
if (this.aa8()) {
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.aa8()) {
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.aa8()) {
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;
}
ack(a, b) {
if (this.abp != null) {
b.value = this.abp;
return;
}
b.value = this.ab5;
}
acl(a, b) {
if (this.abr != null) {
b.value = this.abr;
return;
}
b.value = this.acd;
}
get adu() {
return this.c(ScatterBase.ac5);
}
set adu(a) {
this.h(ScatterBase.ac5, a);
}
static { this.ac5 = DependencyProperty.i("ActualTrendLineBrush", Brush.$, ScatterBase.$, new PropertyMetadata(2, null, (a, b) => a.raisePropertyChanged("ActualTrendLineBrush", b.oldValue, b.newValue))); }
get GetErrorBarsXAxis() {
return this.xAxis;
}
get GetErrorBarsYAxis() {
return this.yAxis;
}
qr() {
super.qr();
if (this.xAxis != null) {
this.xAxis.l8(false);
}
if (this.yAxis != null) {
this.yAxis.l8(false);
}
}
rs(a, b, c, d) {
super.rs(a, b, c, d);
if (this.z9.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.aat);
c.deregisterColumn(this.aau);
this.aat = null;
this.aau = null;
}
if (typeCast(IFastItemsSource_$type, d) != null) {
this.aat = this.dl(this.ab5);
this.aau = this.dl(this.acd);
}
if ((this.yAxis != null && !this.yAxis.ei()) || (this.xAxis != null && !this.xAxis.ei())) {
this.sa(this.go && c != null);
}
break;
case ScatterBase.$$p[9]:
if (c != null) {
c.c0(this);
}
if (d != null) {
d.d8(this);
}
if ((this.xAxis != null && !this.xAxis.ei()) || (d == null && c != null)) {
this.sa(false);
}
this.q2();
break;
case ScatterBase.$$p[13]:
if (c != null) {
c.c0(this);
}
if (d != null) {
d.d8(this);
}
if ((this.yAxis != null && !this.yAxis.ei()) || (d == null && c != null)) {
this.sa(false);
}
this.q2();
break;
case ScatterBase.$$p[12]:
if (this.dp != null) {
this.dp.deregisterColumn(this.aat);
this.aat = this.dl(this.ab5);
}
break;
case "XColumn":
this.z9.df.g$m();
if (this.xAxis != null && !this.xAxis.ei()) {
this.sa(this.go && this.d9);
}
break;
case ScatterBase.$$p[16]:
if (this.dp != null) {
this.dp.deregisterColumn(this.aau);
this.aau = this.dl(this.acd);
}
break;
case "YColumn":
this.z9.df.g$m();
if (this.yAxis != null && !this.yAxis.ei()) {
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.aag.d(this.j1, this.aae, this.aac);
this.acf();
try {
if (this.d7(this.cw)) {
return;
}
if ((Math.round(this.j1 * 100000) / 100000) == 1) {
this.ac2(this.aac, this.z9);
}
else {
this.ac2(this.aag, this.z9);
}
if (this.dc != null) {
this.dc.sv(this);
}
}
finally {
this.ac3();
}
break;
case "TrendLineBrush":
this.ry(b);
break;
case ScatterBase.$$p[0]:
if (this.aaa != null) {
this.aaa.r = this;
}
this.sa(false);
this.q2();
break;
case "TrendLineType":
this.q2();
break;
case ScatterBase.$$p[4]:
this.aax = this.aa5();
this.sa(false);
break;
case ScatterBase.$$p[3]:
this.aaw = this.aa4();
this.sa(false);
break;
case ScatterBase.$$p[5]:
this.aai = this.aaj();
break;
}
}
aa5() {
return this.aa1;
}
aa4() {
return this.aa0;
}
aaz(a) {
if (typeCast(NumericYAxis.$, a) !== null) {
return true;
}
return false;
}
aay(a) {
if (typeCast(NumericXAxis.$, a) !== null) {
return true;
}
return false;
}
ac3() {
this.adx = Rect.empty;
this.ady = Rect.empty;
}
acf() {
let a = this.getViewInfo(this.adx, this.ady);
this.adx = a.p0;
this.ady = a.p1;
}
aa3(a, b) {
if (b != 3) {
return true;
}
if (a == null) {
return true;
}
if (this.ab5 == a || this.acd == a) {
return true;
}
return false;
}
pq(a, b, c, d) {
let e = false;
if (!this.aa3(d, a)) {
return;
}
this.z9.df.g$i(a, b, c, d);
if (this.z9.aa.count > 0) {
for (let f of fromEnum(this.z9.aa)) {
f.g$i(a, b, c, d);
}
}
if (this.xAxis != null && !this.xAxis.ei()) {
e = true;
}
if (this.yAxis != null && !this.yAxis.ei()) {
e = true;
}
if (a == 0 || a == 2 || a == 3 || a == 4) {
this.aav = true;
}
else if (a == 1) {
for (let g = b; g < b + c; g++) {
this.aba += this.aat.item(g);
this.abb += this.aau.item(g);
}
this.abc = this.aba / this.aat.count;
this.abd = this.abb / this.aau.count;
}
if (e) {
this.sa(true);
}
}
acv(a) {
this.acu(a, null);
}
acu(a, b) {
let c = this.aat != null ? this.aat.count : 0;
let d = this.aau != null ? this.aau.count : 0;
let e = Math.min(c, d);
if (e <= this.abl) {
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.aat != null) {
return new AxisRange(this.aat.minimum, this.aat.maximum);
}
if (a != null && a == this.yAxis && this.aau != null) {
return new AxisRange(this.aau.minimum, this.aau.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 aai() {
return this.aah;
}
set aai(a) {
let b = this.aah;
this.aah = a;
if (b != this.aah) {
this.raisePropertyChanged("ActualItemSearchMode", enumGetBox(ScatterItemSearchMode_$type, b), enumGetBox(ScatterItemSearchMode_$type, this.aah));
}
}
aaj() {
if (this.aak != 0) {
return this.aak;
}
return this.aa2 ? 4 : 1;
}
ke(a) {
let b = truncate(Math.round(this.i0(a)));
return b;
}
i0(a) {
switch (this.aai) {
case 1: return this.abh(a);
case 3: return this.abi(a);
case 2: return this.abf(a);
case 4: return this.abg(a);
case 5: return this.abe(a);
}
return -1;
}
abg(a) {
return this.abj(a, false);
}
abf(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.aat == null || this.aau == null) {
return -1;
}
if (this.dp.count > this.abk) {
return -1;
}
this.aci();
let e = this.zy;
let f = this.zz;
if (e == null || f == null) {
return -1;
}
let g = 1.7976931348623157E+308;
let h = -1;
for (let i = 0; i < this.aat.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;
}
aci() {
let a = this.cw.ca;
let b = this.cw.b9;
let c = this.getEffectiveViewport();
if (this.z8 == null) {
return;
}
let d = new ScalerParams(0, a, b, this.z8.d, c);
let e = ((() => {
let $ret = new ScalerParams(0, a, b, this.z8.e, c);
$ret.b = this.i7();
return $ret;
})());
if (this.zy == null || this.zz == null) {
let f = arrayShallowClone(this.aat.asArray());
let g = arrayShallowClone(this.aau.asArray());
this.xAxis.lb(boxArray$1(f), 0, f.length, d);
this.yAxis.lb(boxArray$1(g), 0, g.length, e);
this.zy = f;
this.zz = g;
}
}
get_aa2() {
return false;
}
get aa2() {
return this.get_aa2();
}
abj(a, b) {
if (!this.aa2) {
return -1;
}
let c = { $type: Point_$type, x: 0, y: 0 };
let d = true;
let e = this.aad();
if (e == null) {
return -1;
}
if (e.q == null) {
return -1;
}
if (this.dp == null || this.dp.count > this.abk) {
return -1;
}
this.aci();
let f = this.zy;
let g = this.zz;
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.zy.length; k++) {
let l = { $type: Point_$type, x: this.zy[k], y: this.zz[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.zy[j], y: this.zz[j] };
let o = { $type: Point_$type, x: this.zy[j - 1], y: this.zz[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;
}
abi(a) {
return this.abj(a, true);
}
abe(a) {
let b = this.wt(a);
let c = b.x;
let d = b.y;
if (this.z9.dg.e > this.abk) {
return -1;
}
let e = -1;
this.xu.cx((f) => {
let g = this.z9.c7(f);
let h = g.left;
let i = g.top;
let j = g.width;
let k = g.height;
if (this.x1) {
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;
}
abh(a) {
let b = null;
let c = 1.7976931348623157E+308;
let d = this.wt(a);
let e = d.x;
let f = d.y;
if (this.z9.dg.e > this.abk) {
return -1;
}
this.z9.dn((g) => {
if (g._visibility == 0) {
let h = this.z9.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.aat == null || this.aau == 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.dr, f);
let h = ((() => {
let $ret = new ScalerParams(0, d, e, this.yAxis.dr, 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.gc(this.aat.item(j), g);
let m = this.yAxis.gc(this.aau.item(j), h);
return { $type: Point_$type, x: l, y: m };
}
let n = i - Math.floor(i);
let o = this.xAxis.gc(this.aat.item(j), g);
let p = this.yAxis.gc(this.aau.item(j), h);
let q = this.xAxis.gc(this.aat.item(k), g);
let r = this.yAxis.gc(this.aau.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.gc(this.aat.item(u), g);
let w = this.yAxis.gc(this.aau.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.dr, e);
let g = ((() => {
let $ret = new ScalerParams(0, d, d, this.yAxis.dr, 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.aat != null && h < this.aat.count ? this.xAxis.gc(this.aat.item(h), f) : NaN;
let j = this.yAxis != null && this.aau != null && h < this.aau.count ? this.yAxis.gc(this.aau.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.at(this.dc, b, true);
}
return h >= 0;
}
ta(a, b) {
this.sa(false);
}
tb(a, b) {
this.sa(false);
}
aad() {
let a = this.aac;
if (this.d4()) {
if (this.dd.g) {
this.dd.t();
}
a = this.aag;
}
return a;
}
acg(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.z8.d, f);
$ret.c = this.getEffectiveViewport1(a);
return $ret;
})());
let k = ((() => {
let $ret = new ScalerParams(0, d, e, this.z8.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.aat.item(o);
i = this.aau.item(o);
let p = { $type: Point_$type, x: this.z8.a.gc(h, j), y: this.z8.b.gc(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;
})()));
}
}
}
}
acr(a, b) {
this.zy = null;
this.zz = null;
a.m.clear();
a.r.clear();
a.k.clear();
a.o.clear();
a.l.clear();
a.n.clear();
let c = Math.min(this.aat != null ? this.aat.count : 0, this.aau != null ? this.aau.count : 0);
let d = b.ca;
let e = b.b9;
let f = this.getEffectiveViewport1(b);
let g = new ScalerParams(0, d, e, this.xAxis.dr, f);
g.c = this.getEffectiveViewport1(b);
let h = ((() => {
let $ret = new ScalerParams(0, d, e, this.yAxis.dr, f);
$ret.b = this.i7();
return $ret;
})());
h.c = this.getEffectiveViewport1(b);
if (c < 1) {
return;
}
this.z8 = ((() => {
let $ret = new ScatterAxisInfoCache();
$ret.a = this.xAxis;
$ret.b = this.yAxis;
$ret.d = this.xAxis.dr;
$ret.e = this.yAxis.dr;
$ret.c = this.dp;
return $ret;
})());
let i = b;
if (c <= this.abl) {
this.acg(i, a, c, d, e);
}
if (this.x4()) {
b.dd.l(a.m, this.abl, 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.gf(k.left, g);
let m = this.xAxis.gf(k.right, g);
b.df.j(a.r, this.trendLineType, this.aat, this.aau, this.trendLinePeriod, (n) => this.xAxis.gc(n, g), (n) => this.yAxis.gc(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.aat, this.aau, o.g$f, (p) => this.xAxis.gc(p, g), (p) => this.yAxis.gc(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.acp(a, b);
}
pk(a, b) {
super.pk(a, b);
let c = b;
c.dm(a);
}
get_fh() {
return true;
}
aan(a, b, c) {
return null;
}
aao(a, b, c) {
if (this.dp == null) {
return null;
}
let d = this.aad();
let e = this.z9.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.xw != 1 && this.xw != 13) {
let c = this.xu.c8();
let d = (c.width / 2) + (this.yi / 2);
let e = (c.height / 2) + (this.yi / 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);
}
aam(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.aan(a, b, this.aap);
this.aap = d;
return d;
}
else {
let e = this.aam(a, b, this.aap);
this.aap = e;
return e;
}
}
di(a, b, c) {
if (this.f3(this.by) && !c) {
let d = this.aao(a, b, this.aaq);
this.aaq = d;
return d;
}
else {
let e = this.aam(a, b, this.aaq);
e.d = true;
this.aaq = e;
return e;
}
}
aa7() {
return (this.assigningScatterStyle != null && this.aax) || this.d3 || (this.by != 1) || (this.cq != 1) || (this.cp != 1);
}
aa6() {
return (this.assigningScatterMarkerStyle != null && this.aaw) || this.d3 || (this.by != 1) || (this.cq != 1) || (this.cp != 1);
}
ac2(a, b) {
this.rf();
let c = b.b9;
this.z8 = ((() => {
let $ret = new ScatterAxisInfoCache();
$ret.a = this.xAxis;
$ret.b = this.yAxis;
$ret.d = this.xAxis.dr;
$ret.e = this.yAxis.dr;
return $ret;
})());
if (this.x4()) {
b.dd.j(a.m, this.x6);
if (this.aa6()) {
this.ach(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$k(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$k(a.p._inner[e], d);
}
}
this.acz(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.acj(a, b, c, 0, null);
}
acj(a, b, c, d, e) {
let f = this.dc.za(this.dc.y0(a));
let g = this.dp.count;
let h = this.z8.a;
let i = this.z8.b;
let j = this.dc.y3(this.xf, this.getEffectiveViewport(), f);
let k = new ScalerParams(0, f, this.dc.zd, h.dr, this.getEffectiveViewport());
let l = new ScalerParams(0, f, this.dc.zd, i.dr, this.getEffectiveViewport());
if (d == 0) {
for (let m = 0; m < g; m++) {
let n = h.gc(this.aat.item(m), k);
let o = i.gc(this.aau.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.gc(this.aat.item(p), k);
let r = i.gc(this.aau.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;
})()));
}
}
}
}
}
z1(a, b) {
return this.z2(a, b);
}
z2(a, b) {
if (b < a || a < 0 || a > this.aat.count || b < 0 || b > this.aat.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;
}
ach(a, b) {
a.ck = true;
this.aal.ay(this, this.aa6(), runOn(this, this.z1));
let c = this.aal.d;
let d = c != null;
let e = this.getEffectiveViewport1(a);
let f = this.dp == null ? 0 : this.dp.count;
this.z9.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.acm(h, f, a.t);
}
this.aal.ac(g, i);
}
});
}
acn(a, b, c) {
let d = this.by != 1;
let e = this.cq != 1;
let f = this.cp != 1;
this.aal.a0(this.aal.b, a, b, false);
this.aal.ab(this.ik);
let g = this.aal.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.acx(g);
this.aal.z(this, h, i, j, c, d, e, f, a < 0);
}
acm(a, b, c) {
let d = this.by != 1;
let e = this.cq != 1;
let f = this.cp != 1;
this.aal.a0(this.aal.d, a, b, true);
this.aal.aa(this.ik);
let g = this.aal.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.acw(g);
this.aal.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);
}
acx(a) {
if (this.assigningScatterStyle != null && this.aax) {
this.assigningScatterStyle(this, a);
}
}
acw(a) {
if (this.assigningScatterMarkerStyle != null && this.aaw) {
this.assigningScatterMarkerStyle(this, a);
}
}
acp(a, b) {
let c = new ErrorBarsHelper(this, b);
if (this.aaa == null) {
return;
}
let d = this.aaa.u;
let e = this.aaa.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.acs(k, c, d, h, i, true);
h = l.p3;
i = l.p4;
break;
case 0:
let m = this.acq(k, c, d, h, i, true);
h = m.p3;
i = m.p4;
break;
case 2:
let n = this.aco(k, c, d, j, h, i, true);
h = n.p4;
i = n.p5;
break;
case 3:
let o = this.act(c, d, f, h, i, true);
f = o.p2;
h = o.p3;
i = o.p4;
break;
case 4:
let p = this.acq(k, c, d, h, i, true);
h = p.p3;
i = p.p4;
break;
}
;
let q = new OwnedPoint();
q.c = c.l(d, this.z8.a, k.c, f);
q.a = k.a;
a.k.addItem(j, q);
a.l.addItem(j, [h, i]);
}
if (e != null) {
switch (e.getCalculatorType()) {
case 1:
let r = this.acs(k, c, e, h, i, false);
h = r.p3;
i = r.p4;
break;
case 0:
let s = this.acq(k, c, e, h, i, false);
h = s.p3;
i = s.p4;
break;
case 2:
let t = this.aco(k, c, e, j, h, i, false);
h = t.p4;
i = t.p5;
break;
case 3:
let u = this.act(c, e, g, h, i, false);
g = u.p2;
h = u.p3;
i = u.p4;
break;
case 4:
let v = this.acq(k, c, e, h, i, false);
h = v.p3;
i = v.p4;
break;
}
;
let w = new OwnedPoint();
w.c = c.m(e, this.z8.b, k.c, g);
w.a = k.a;
a.o.addItem(j, w);
a.n.addItem(j, [h, i]);
}
}
}
acs(a, b, c, d, e, f) {
if (f) {
let g;
let h, i;
i = this.z8.a;
if (this.aaa.s == 0) {
g = a.c.x;
h = this.z8.a;
}
else {
g = a.c.y;
h = this.z8.b;
}
let j = b.f(g, c, h, i, d, e);
d = j.p4;
e = j.p5;
}
else {
let k;
let l, m;
m = this.z8.b;
if (this.aaa.t == 0) {
k = a.c.x;
l = this.z8.a;
}
else {
k = a.c.y;
l = this.z8.b;
}
let n = b.f(k, c, l, m, d, e);
d = n.p4;
e = n.p5;
}
return {
p3: d,
p4: e
};
}
acq(a, b, c, d, e, f) {
if (f) {
let g = b.j(a.c.x, c, this.z8.a, d, e);
d = g.p3;
e = g.p4;
}
else {
let h = b.j(a.c.y, c, this.z8.b, d, e);
d = h.p3;
e = h.p4;
}
return {
p3: d,
p4: e
};
}
aco(a, b, c, d, e, f, g) {
let h = c.getItemColumn();
let i = this.dp.indexOf(d);
if (h != null && i < h.count) {
let j = h.item(i);
if (g) {
let k = b.h(a.c.x, j, this.z8.a, e, f);
e = k.p3;
f = k.p4;
}
else {
let l = b.h(a.c.y, j, this.z8.b, e, f);
e = l.p3;
f = l.p4;
}
}
else {
e = NaN;
f = NaN;
}
return {
p4: e,
p5: f
};
}
act(a, b, c, d, e, f) {
let g = a.i(b, c);
c = g.p1;
if (f) {
let h = a.k(c, b, this.z8.a, d, e);
d = h.p3;
e = h.p4;
}
else {
let i = a.k(c, b, this.z8.b, d, e);
d = i.p3;
e = i.p4;
}
return {
p2: c,
p3: d,
p4: e
};
}
acz(a, b) {
if (!b.r() || this.aaa == null) {
b.dp();
return;
}
this.ac0(a, b);
this.ac1(a, b);
}
ac0(a, b) {
b.dk();
let c = new ErrorBarsHelper(this, b);
let d = new PathGeometry();
let e = this.aaa.u;
for (let f of fromEnum(a.m.keys)) {
if (e != null && a.l.containsKey(f)) {
let g = a.l.item(f)[0];
let h = a.l.item(f)[1];
if (!isNaN_(g) && !isNaN_(h)) {
let i = a.k.item(f).c;
if (this.aaa.o == 1 || this.aaa.o == 2) {
c.d(d, i, g, true);
}
if (this.aaa.o == 1 || this.aaa.o == 3) {
c.d(d, i, h, false);
}
}
}
}
b.dq(d);
}
ac1(a, b) {
b.dl();
let c = new ErrorBarsHelper(this, b);
let d = new PathGeometry();
let e