UNPKG

igniteui-react-charts

Version:

Ignite UI React charting components for building rich data visualizations using TypeScript APIs.

1,493 lines 77.7 kB
/* 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 { __extends, __values } from "tslib"; 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 */ var ScatterBase = /** @class */ /*@__PURE__*/ (function (_super) { __extends(ScatterBase, _super); function ScatterBase() { var _this = _super.call(this) || this; _this.y7 = null; _this.zq = null; _this.zr = null; _this.acw = null; _this.acx = null; _this.zg = 1; _this.yx = null; _this.yy = null; _this.zd = null; _this.zf = null; _this.zb = null; _this.zw = false; _this.zv = false; _this.zo = null; _this.zp = null; _this.assigningScatterStyle = null; _this.assigningScatterMarkerStyle = null; _this.zk = null; _this.ze = null; _this.za = null; _this.zu = true; _this.z9 = 0; _this.aaa = 0; _this.aab = 0; _this.aac = 0; _this.zh = _this.zi(); _this.zk = new ScatterSeriesRenderManager(); _this.ze = new ScatterFrame(); _this.acx = Rect.empty; _this.acw = Rect.empty; return _this; } ScatterBase.prototype.ct = function () { return new ScatterBaseView(this); }; ScatterBase.prototype.o8 = function () { _super.prototype.o8.call(this); this.xAxis = null; this.yAxis = null; }; ScatterBase.prototype.q8 = function (a) { _super.prototype.q8.call(this, a); this.y8 = a; }; ScatterBase.prototype.get_fx = function () { return true; }; ScatterBase.prototype.ai = function () { return [this.xAxis, this.yAxis]; }; ScatterBase.prototype.ku = function (a, b) { var c = this.ni(b); if (c == ScatterBase.$$p[12]) { return this.kv(a, b, this.aa4); } if (c == ScatterBase.$$p[16]) { return this.kv(a, b, this.abc); } if (c == ScatterBase.$$p[1]) { return this.kv(a, b, this.aao); } if (c == ScatterBase.$$p[2]) { return this.kv(a, b, this.aaq); } return null; }; ScatterBase.prototype.mi = function (a) { var b = this.ni(a); if (b == ScatterBase.$$p[12]) { return this.aa4; } if (b == ScatterBase.$$p[16]) { return this.abc; } if (b == ScatterBase.$$p[1]) { return this.aao; } if (b == ScatterBase.$$p[2]) { return this.aaq; } return _super.prototype.mi.call(this, a); }; ScatterBase.prototype.ed = function (a, b, c, d, e) { var _this = this; if (!this.hasMarkers) { return false; } var f = this.xAxis; var g = new ScalerParams(1, this.dc.xn, this.w3, f.df); g.c = this.getEffectiveViewport1(this.cw); var h = this.yAxis; var i = new ScalerParams(1, this.dc.xn, this.w3, h.df); i.c = this.getEffectiveViewport1(this.cw); a.clear(); this.xh.cw(function (j) { if (j._visibility == 0) { var k = new SeriesPointOfInterest(); var l = j.n; var m = j.o; if (!e && (l < _this.w3.left || l > _this.w3.right || m < _this.w3.top || m > _this.w3.bottom)) { return; } k.d = f.fw(l, g); k.e = h.fw(m, i); k.b = j.content; k.g = _this.vr; k.c = j.ak; if (_this.ha) { k.g = _this.vy(j.ak); } a.add(k); } }); return true; }; ScatterBase.prototype.b3 = function () { if (this.b4 == 0) { if (this.aak <= 2000) { return 1; } else { return _super.prototype.b3.call(this); } } else { return _super.prototype.b3.call(this); } }; ScatterBase.prototype.w0 = function (a) { if (!this.hasMarkers || !this.xr()) { return Rect.empty; } var b = this.xh.ce(this.wi(a)); if (b != null) { return this.xh.c7(b); } return Rect.empty; }; ScatterBase.prototype.gx = function (a, b) { if (this.xs(a, b)) { return true; } return false; }; Object.defineProperty(ScatterBase.prototype, "zs", { get: function () { return this.zq; }, set: function (a) { if (this.zq != a) { var b = this.zs; this.zq = a; this.raisePropertyChanged("XColumn", b, this.zs); } }, enumerable: false, configurable: true }); Object.defineProperty(ScatterBase.prototype, "zt", { get: function () { return this.zr; }, set: function (a) { if (this.zr != a) { var b = this.zt; this.zr = a; this.raisePropertyChanged("YColumn", b, this.zt); } }, enumerable: false, configurable: true }); ScatterBase.prototype.gc = function () { return this.highlightedItemsSource != null || (this.aao != null && this.aaq != null); }; ScatterBase.prototype.z7 = function () { return false; }; ScatterBase.prototype.hu = function () { var a = _super.prototype.hu.call(this); { var b = ((function () { var $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.abk)); a.add(b); } { var c = ((function () { var $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.abj)); a.add(c); } if (this.z7()) { var d = ((function () { var $ret = new SeriesLayerPropertyOverlay(); $ret.r = true; $ret.ad = "DashArray"; $ret.p = true; $ret.x = ((function () { var $ret = new DoubleCollection(); $ret.add(5); $ret.add(5); return $ret; })()); $ret.q = true; return $ret; })()); a.add(d); } if (!this.z7()) { var e = ((function () { var $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.r9)); a.add(e); } if (!this.z7()) { var f = ((function () { var $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.r9)); a.add(f); } return a; }; ScatterBase.prototype.abj = function (a, b) { if (this.aao != null) { b.value = this.aao; return; } b.value = this.aa4; }; ScatterBase.prototype.abk = function (a, b) { if (this.aaq != null) { b.value = this.aaq; return; } b.value = this.abc; }; Object.defineProperty(ScatterBase.prototype, "act", { get: function () { return this.c(ScatterBase.ab4); }, set: function (a) { this.h(ScatterBase.ab4, a); }, enumerable: false, configurable: true }); Object.defineProperty(ScatterBase.prototype, "GetErrorBarsXAxis", { get: function () { return this.xAxis; }, enumerable: false, configurable: true }); Object.defineProperty(ScatterBase.prototype, "GetErrorBarsYAxis", { get: function () { return this.yAxis; }, enumerable: false, configurable: true }); ScatterBase.prototype.qh = function () { _super.prototype.qh.call(this); if (this.xAxis != null) { this.xAxis.k3(false); } if (this.yAxis != null) { this.yAxis.k3(false); } }; ScatterBase.prototype.rh = function (a, b, c, d) { _super.prototype.rh.call(this, a, b, c, d); if (this.y8.df.g$e(a, b, c, d)) { this.rz(false); this.qs(); } switch (b) { case ScatterBase.$$p[10]: case ScatterBase.$$p[14]: case ScatterBase.$$p[11]: case ScatterBase.$$p[15]: this.qm(); break; case "FastItemsSource": if (typeCast(IFastItemsSource_$type, c) != null) { c.deregisterColumn(this.zs); c.deregisterColumn(this.zt); this.zs = null; this.zt = null; } if (typeCast(IFastItemsSource_$type, d) != null) { this.zs = this.dl(this.aa4); this.zt = this.dl(this.abc); } if ((this.yAxis != null && !this.yAxis.d2()) || (this.xAxis != null && !this.xAxis.d2())) { this.rz(this.gh && c != null); } break; case ScatterBase.$$p[9]: if (c != null) { c.cq(this); } if (d != null) { d.du(this); } if ((this.xAxis != null && !this.xAxis.d2()) || (d == null && c != null)) { this.rz(false); } this.qs(); break; case ScatterBase.$$p[13]: if (c != null) { c.cq(this); } if (d != null) { d.du(this); } if ((this.yAxis != null && !this.yAxis.d2()) || (d == null && c != null)) { this.rz(false); } this.qs(); break; case ScatterBase.$$p[12]: if (this.dp != null) { this.dp.deregisterColumn(this.zs); this.zs = this.dl(this.aa4); } break; case "XColumn": this.y8.df.g$m(); if (this.xAxis != null && !this.xAxis.d2()) { this.rz(this.gh && this.d9); } break; case ScatterBase.$$p[16]: if (this.dp != null) { this.dp.deregisterColumn(this.zt); this.zt = this.dl(this.abc); } break; case "YColumn": this.y8.df.g$m(); if (this.yAxis != null && !this.yAxis.d2()) { this.rz(this.gh && this.d9); } break; case ScatterBase.$$p[7]: this.rz(false); this.qs(); break; case ScatterBase.$$p[8]: this.rz(false); this.qs(); break; case "TransitionProgress": this.zf.c(this.ju, this.zd, this.zb); this.abe(); try { if (this.d7(this.cw)) { return; } if ((Math.round(this.ju * 100000) / 100000) == 1) { this.ab1(this.zb, this.y8); } else { this.ab1(this.zf, this.y8); } if (this.dc != null) { this.dc.r0(this); } } finally { this.ab2(); } break; case "TrendLineBrush": this.rn(b); break; case ScatterBase.$$p[0]: if (this.y9 != null) { this.y9.r = this; } this.rz(false); this.qs(); break; case "TrendLineType": this.qs(); break; case ScatterBase.$$p[4]: this.zw = this.z4(); this.rz(false); break; case ScatterBase.$$p[3]: this.zv = this.z3(); this.rz(false); break; case ScatterBase.$$p[5]: this.zh = this.zi(); break; } }; ScatterBase.prototype.z4 = function () { return this.z0; }; ScatterBase.prototype.z3 = function () { return this.zz; }; ScatterBase.prototype.zy = function (a) { if (typeCast(NumericYAxis.$, a) !== null) { return true; } return false; }; ScatterBase.prototype.zx = function (a) { if (typeCast(NumericXAxis.$, a) !== null) { return true; } return false; }; ScatterBase.prototype.ab2 = function () { this.acw = Rect.empty; this.acx = Rect.empty; }; ScatterBase.prototype.abe = function () { var a = this.getViewInfo(this.acw, this.acx); this.acw = a.p0; this.acx = a.p1; }; ScatterBase.prototype.z2 = function (a, b) { if (b != 3) { return true; } if (a == null) { return true; } if (this.aa4 == a || this.abc == a) { return true; } return false; }; ScatterBase.prototype.ph = function (a, b, c, d) { var e_1, _a; var e = false; if (!this.z2(d, a)) { return; } this.y8.df.g$i(a, b, c, d); if (this.y8.aa.count > 0) { try { for (var _b = __values(fromEnum(this.y8.aa)), _c = _b.next(); !_c.done; _c = _b.next()) { var f = _c.value; f.g$i(a, b, c, d); } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_1) throw e_1.error; } } } if (this.xAxis != null && !this.xAxis.d2()) { e = true; } if (this.yAxis != null && !this.yAxis.d2()) { e = true; } if (a == 0 || a == 2 || a == 3 || a == 4) { this.zu = true; } else if (a == 1) { for (var g = b; g < b + c; g++) { this.z9 += this.zs.item(g); this.aaa += this.zt.item(g); } this.aab = this.z9 / this.zs.count; this.aac = this.aaa / this.zt.count; } if (e) { this.rz(true); } }; ScatterBase.prototype.abt = function (a) { this.abu(a, null); }; ScatterBase.prototype.abu = function (a, b) { var e_2, _a, e_3, _b; var c = this.zs != null ? this.zs.count : 0; var d = this.zt != null ? this.zt.count : 0; var e = Math.min(c, d); if (e <= this.aak) { a.n.clear(); var f = new List$1(OwnedPoint.$, 0); try { for (var _c = __values(fromEnum(a.v.values)), _d = _c.next(); !_d.done; _d = _c.next()) { var g = _d.value; f.add(g); } } catch (e_2_1) { e_2 = { error: e_2_1 }; } finally { try { if (_d && !_d.done && (_a = _c.return)) _a.call(_c); } finally { if (e_2) throw e_2.error; } } var h_1 = this.dp; f.aa(function (i, j) { var k = h_1.indexOf(i.a); var l = h_1.indexOf(j.a); if (k < l) { return -1; } if (k > l) { return 1; } return 0; }); if (b != null) { b.i = a.n; } try { for (var _e = __values(fromEnum(f)), _f = _e.next(); !_f.done; _f = _e.next()) { var i = _f.value; if (h_1.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 }); } } } } catch (e_3_1) { e_3 = { error: e_3_1 }; } finally { try { if (_f && !_f.done && (_b = _e.return)) _b.call(_e); } finally { if (e_3) throw e_3.error; } } } }; ScatterBase.prototype.ay = function (a) { if (a != null && a == this.xAxis && this.zs != null) { return new AxisRange(this.zs.minimum, this.zs.maximum); } if (a != null && a == this.yAxis && this.zt != null) { return new AxisRange(this.zt.minimum, this.zt.maximum); } return null; }; ScatterBase.prototype.kr = function (a) { var b = this.j7(a); if (this.dp != null && b >= 0 && b < this.dp.count) { return this.dp.item(b); } return null; }; Object.defineProperty(ScatterBase.prototype, "zh", { get: function () { return this.zg; }, set: function (a) { var b = this.zg; this.zg = a; if (b != this.zg) { this.raisePropertyChanged("ActualItemSearchMode", enumGetBox(ScatterItemSearchMode_$type, b), enumGetBox(ScatterItemSearchMode_$type, this.zg)); } }, enumerable: false, configurable: true }); ScatterBase.prototype.zi = function () { if (this.zj != 0) { return this.zj; } return this.z1 ? 4 : 1; }; ScatterBase.prototype.j7 = function (a) { var b = truncate(Math.round(this.it(a))); return b; }; ScatterBase.prototype.it = function (a) { switch (this.zh) { case 1: return this.aag(a); case 3: return this.aah(a); case 2: return this.aae(a); case 4: return this.aaf(a); case 5: return this.aad(a); } return -1; }; ScatterBase.prototype.aaf = function (a) { return this.aai(a, false); }; ScatterBase.prototype.aae = function (a) { var b = this.wi(a); var c = b.x; var d = b.y; if (this.dp == null || this.xAxis == null || this.yAxis == null || this.zs == null || this.zt == null) { return -1; } if (this.dp.count > this.aaj) { return -1; } this.abh(); var e = this.yx; var f = this.yy; if (e == null || f == null) { return -1; } var g = 1.7976931348623157E+308; var h = -1; for (var i = 0; i < this.zs.count; i++) { var j = e[i]; var k = f[i]; var l = (c - j) * (c - j) + (d - k) * (d - k); if (l < g) { g = l; h = i; } } return h; }; ScatterBase.prototype.abh = function () { var _this = this; var a = this.cw.ca; var b = this.cw.b9; var c = this.getEffectiveViewport(); if (this.y7 == null) { return; } var d = new ScalerParams(0, a, b, this.y7.d, c); var e = ((function () { var $ret = new ScalerParams(0, a, b, _this.y7.e, c); $ret.b = _this.i0(); return $ret; })()); if (this.yx == null || this.yy == null) { var f = arrayShallowClone(this.zs.asArray()); var g = arrayShallowClone(this.zt.asArray()); this.xAxis.j6(boxArray$1(f), 0, f.length, d); this.yAxis.j6(boxArray$1(g), 0, g.length, e); this.yx = f; this.yy = g; } }; ScatterBase.prototype.get_z1 = function () { return false; }; Object.defineProperty(ScatterBase.prototype, "z1", { get: function () { return this.get_z1(); }, enumerable: false, configurable: true }); ScatterBase.prototype.aai = function (a, b) { if (!this.z1) { return -1; } var c = { $type: Point_$type, x: 0, y: 0 }; var d = true; var e = this.zc(); if (e == null) { return -1; } if (e.n == null) { return -1; } if (this.dp == null || this.dp.count > this.aaj) { return -1; } this.abh(); var f = this.yx; var g = this.yy; if (f == null || g == null) { return -1; } var h = this.wi(a); var i = 1.7976931348623157E+308; var j = -1; for (var k = 0; k < this.yx.length; k++) { var l = { $type: Point_$type, x: this.yx[k], y: this.yy[k] }; if (k > 0) { if (!b || e.j.containsKey(this.dp.item(k)) || e.j.containsKey(this.dp.item(k - 1))) { var m = GeometryUtil.h(h, c, l); if (m < i) { i = m; j = k; } } } c = l; } if (j >= 0) { var n = { $type: Point_$type, x: this.yx[j], y: this.yy[j] }; var o = { $type: Point_$type, x: this.yx[j - 1], y: this.yy[j - 1] }; if (!b || (e.j.containsKey(this.dp.item(j)) && e.j.containsKey(this.dp.item(j - 1)))) { var 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; }; ScatterBase.prototype.aah = function (a) { return this.aai(a, true); }; ScatterBase.prototype.aad = function (a) { var _this = this; var b = this.wi(a); var c = b.x; var d = b.y; if (this.y8.dg.e > this.aaj) { return -1; } var e = -1; this.xh.cx(function (f) { var g = _this.y8.c7(f); var h = g.left; var i = g.top; var j = g.width; var k = g.height; if (_this.xo) { var l = h + j / 2; var m = i + k / 2; var n = (j / 2) * (j / 2); var 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; }; ScatterBase.prototype.aag = function (a) { var _this = this; var b = null; var c = 1.7976931348623157E+308; var d = this.wi(a); var e = d.x; var f = d.y; if (this.y8.dg.e > this.aaj) { return -1; } this.y8.dn(function (g) { if (g._visibility == 0) { var h = _this.y8.c7(g); var i = h.left + h.width / 2; var j = h.top + h.height / 2; var k = (e - i) * (e - i) + (f - j) * (f - j); if (k < c) { c = k; b = g; } } }); if (b != null) { return b.ak; } return -1; }; ScatterBase.prototype.wn = function (a, b, c) { var _this = this; if (this.xAxis == null || this.yAxis == null || this.zs == null || this.zt == null) { return { $type: Point_$type, x: NaN, y: NaN }; } var d = this.cw.ca; var e = this.cw.b9; var f = this.getEffectiveViewport(); var g = new ScalerParams(0, d, e, this.xAxis.df, f); var h = ((function () { var $ret = new ScalerParams(0, d, e, _this.yAxis.df, f); $ret.b = _this.i0(); return $ret; })()); if (b) { var i = this.it(a); if (i == -1) { return { $type: Point_$type, x: NaN, y: NaN }; } var j = truncate(Math.floor(i)); var 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) { var l = this.xAxis.ft(this.zs.item(j), g); var m = this.yAxis.ft(this.zt.item(j), h); return { $type: Point_$type, x: l, y: m }; } var n = i - Math.floor(i); var o = this.xAxis.ft(this.zs.item(j), g); var p = this.yAxis.ft(this.zt.item(j), h); var q = this.xAxis.ft(this.zs.item(k), g); var r = this.yAxis.ft(this.zt.item(k), h); var s = q - o; var t = r - p; return { $type: Point_$type, x: o + s * n, y: p + t * n }; } else { var u = this.j7(a); if (u == -1) { return { $type: Point_$type, x: NaN, y: NaN }; } var v = this.xAxis.ft(this.zs.item(u), g); var w = this.yAxis.ft(this.zt.item(u), h); return { $type: Point_$type, x: v, y: w }; } }; ScatterBase.prototype.ge = function (a) { var _this = this; var b = this.dc != null ? this.dc.xn : Rect.empty; b = b.copy(); var c = this.dc != null ? this.dc.x5 : Rect.empty; var d = new Rect(0, 0, 0, 1, 1); var e = this.ww(this.cw); var f = new ScalerParams(0, d, d, this.xAxis.df, e); var g = ((function () { var $ret = new ScalerParams(0, d, d, _this.yAxis.df, e); $ret.b = _this.i0(); return $ret; })()); var h = !b.isEmpty && !c.isEmpty && this.dp != null ? this.dp.indexOf(a) : -1; var i = this.xAxis != null && this.zs != null && h < this.zs.count ? this.xAxis.ft(this.zs.item(h), f) : NaN; var j = this.yAxis != null && this.zt != null && h < this.zt.count ? this.yAxis.ft(this.zt.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; }; ScatterBase.prototype.sz = function (a, b) { this.rz(false); }; ScatterBase.prototype.s0 = function (a, b) { this.rz(false); }; ScatterBase.prototype.zc = function () { var a = this.zb; if (this.d4()) { if (this.dd.g) { this.dd.t(); } a = this.zf; } return a; }; ScatterBase.prototype.abf = function (a, b, c, d, e) { var _this = this; b.g = new Dictionary$2(Base.$, OwnedPoint.$, 1, c); var f = this.getEffectiveViewport1(a); var g = this.dp; var h; var i; var j = ((function () { var $ret = new ScalerParams(0, d, e, _this.y7.d, f); $ret.c = _this.getEffectiveViewport1(a); return $ret; })()); var k = ((function () { var $ret = new ScalerParams(0, d, e, _this.y7.e, f); $ret.c = _this.getEffectiveViewport1(a); $ret.b = _this.i0(); return $ret; })()); var l = false; var m = 0; if (this.dc != null) { if (this.dc.gl()) { var n = this.dc.n2(d, j); l = n.c; m = n.d; } } var _loop_1 = function (o) { h = this_1.zs.item(o); i = this_1.zt.item(o); var p = { $type: Point_$type, x: this_1.y7.a.ft(h, j), y: this_1.y7.b.ft(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)) { var q_1 = g.item(o); if (!b.g.containsKey(q_1)) { var r_1 = { $type: Point_$type, x: h, y: i }; var s_1 = { $type: Point_$type, x: p.x, y: p.y }; b.g.addItem(q_1, ((function () { var $ret = new OwnedPoint(); $ret.a = q_1; $ret.b = r_1; $ret.c = s_1; return $ret; })())); } } }; var this_1 = this; for (var o = 0; o < c; o++) { _loop_1(o); } }; ScatterBase.prototype.abq = function (a, b) { var _this = this; this.yx = null; this.yy = null; a.j.clear(); a.o.clear(); a.h.clear(); a.l.clear(); a.i.clear(); a.k.clear(); var c = Math.min(this.zs != null ? this.zs.count : 0, this.zt != null ? this.zt.count : 0); var d = b.ca; var e = b.b9; var f = this.getEffectiveViewport1(b); var g = new ScalerParams(0, d, e, this.xAxis.df, f); g.c = this.getEffectiveViewport1(b); var h = ((function () { var $ret = new ScalerParams(0, d, e, _this.yAxis.df, f); $ret.b = _this.i0(); return $ret; })()); h.c = this.getEffectiveViewport1(b); if (c < 1) { return; } this.y7 = ((function () { var $ret = new ScatterAxisInfoCache(); $ret.a = _this.xAxis; $ret.b = _this.yAxis; $ret.d = _this.xAxis.df; $ret.e = _this.yAxis.df; $ret.c = _this.dp; return $ret; })()); var i = b; if (c <= this.aak) { this.abf(i, a, c, d, e); } if (this.xr()) { b.dd.l(a.j, this.aak, d, e, this.ie); } var j = ((function () { var $ret = new Clipper(0, e, false); $ret.i = a.o; return $ret; })()); var k = this.wu(b); var l = this.xAxis.fw(k.left, g); var m = this.xAxis.fw(k.right, g); b.df.j(a.o, this.trendLineType, this.zs, this.zt, this.trendLinePeriod, function (n) { return _this.xAxis.ft(n, g); }, function (n) { return _this.yAxis.ft(n, h); }, ((function () { var $ret = new TrendResolutionParams(); $ret.d = _this.ie; $ret.i = e; $ret.h = f; $ret.j = d; return $ret; })()), j, l, m); if (b.aa.count > 0) { a.m.clear(); for (var n = 0; n < b.aa.count; n++) { a.m.add(new List$1(Point_$type, 0)); var o = b.aa._inner[n]; o.j(a.m._inner[n], o.g$b, this.zs, this.zt, o.g$f, function (p) { return _this.xAxis.ft(p, g); }, function (p) { return _this.yAxis.ft(p, h); }, ((function () { var $ret = new TrendResolutionParams(); $ret.d = _this.ie; $ret.i = e; $ret.h = f; $ret.j = d; return $ret; })()), j, l, m); } } this.abo(a, b); }; ScatterBase.prototype.pb = function (a, b) { _super.prototype.pb.call(this, a, b); var c = b; c.dm(a); }; ScatterBase.prototype.get_ff = function () { return true; }; ScatterBase.prototype.zm = function (a, b, c) { return null; }; ScatterBase.prototype.zn = function (a, b, c) { if (this.dp == null) { return null; } var d = this.zc(); var e = this.y8.ce(this.wi(b)); var 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; } var 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; }; ScatterBase.prototype.w6 = function (a, b) { if (this.xj != 1 && this.xj != 13) { var c = this.xh.c8(); var d = (c.width / 2) + (this.xu / 2); var e = (c.height / 2) + (this.xu / 2); var f = d; var g = d; var h = e; var 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); }; ScatterBase.prototype.zl = function (a, b, c) { var 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; }; ScatterBase.prototype.dh = function (a, b, c) { if (this.ef && this.f0(this.by) && !c) { var d = this.zm(a, b, this.zo); this.zo = d; return d; } else { var e = this.zl(a, b, this.zo); this.zo = e; return e; } }; ScatterBase.prototype.di = function (a, b, c) { if (this.f0(this.by) && !c) { var d = this.zn(a, b, this.zp); this.zp = d; return d; } else { var e = this.zl(a, b, this.zp); e.d = true; this.zp = e; return e; } }; ScatterBase.prototype.z6 = function () { return (this.assigningScatterStyle != null && this.zw) || this.d3 || (this.by != 1) || (this.cq != 1) || (this.cp != 1); }; ScatterBase.prototype.z5 = function () { return (this.assigningScatterMarkerStyle != null && this.zv) || this.d3 || (this.by != 1) || (this.cq != 1) || (this.cp != 1); }; ScatterBase.prototype.ab1 = function (a, b) { var _this = this; this.q4(); var c = b.b9; this.y7 = ((function () { var $ret = new ScatterAxisInfoCache(); $ret.a = _this.xAxis; $ret.b = _this.yAxis; $ret.d = _this.xAxis.df; $ret.e = _this.yAxis.df; return $ret; })()); if (this.xr()) { b.dd.j(a.j, this.xt); if (this.z5()) { this.abg(b, a); } } b.c4(); var d = ((function () { var $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.o, d); if (b.aa.count > 0) { for (var e = 0; e < b.aa.count; e++) { var f = b.aa._inner[e]; f.g$l(a.m._inner[e], d); } } this.aby(a, b); }; ScatterBase.prototype.ak = function (a, b) { var c = new List$1(ChartSelection.$, 0); this.qa(a, c, b); return c.toArray(); }; ScatterBase.prototype.qa = function (a, b, c) { this.abi(a, b, c, 0, null); }; ScatterBase.prototype.abi = function (a, b, c, d, e) { var _this = this; var f = this.dc.x2(this.dc.xs(a)); var g = this.dp.count; var h = this.y7.a; var i = this.y7.b; var j = this.dc.xv(this.w3, this.getEffectiveViewport(), f); var k = new ScalerParams(0, f, this.dc.x5, h.df, this.getEffectiveViewport()); var l = new ScalerParams(0, f, this.dc.x5, i.df, this.getEffectiveViewport()); if (d == 0) { var _loop_2 = function (m) { var n = h.ft(this_2.zs.item(m), k); var o = i.ft(this_2.zt.item(m), l); if (n < j.width && n > 0 && o < j.height && o > 0) { if (c == 7 || c == 6) { b.add(((function () { var $ret = new ChartSelection(); $ret.series = _this; return $ret; })())); return { value: void 0 }; } else if (c == 2 || c == 1) { b.add(((function () { var $ret = new ChartSelection(); $ret.item = _this.dp.item(m); return $ret; })())); } else { b.add(((function () { var $ret = new ChartSelection(); $ret.item = _this.dp.item(m); $ret.series = _this; return $ret; })())); } } }; var this_2 = this; for (var m = 0; m < g; m++) { var state_1 = _loop_2(m); if (typeof state_1 === "object") return state_1.value; } } else { var _loop_3 = function (p) { var q = h.ft(this_3.zs.item(p), k); var r = i.ft(this_3.zt.item(p), l); var s = e.item(p) / f.height; var t = e.item(p) / f.width; var u = new Rect(0, q - t / 2, r - s / 2, t, s); if (j.intersectsWith(u)) { if (c == 7 || c == 6) { b.add(((function () { var $ret = new ChartSelection(); $ret.series = _this; return $ret; })())); return { value: void 0 }; } else if (c == 2 || c == 1) { b.add(((function () { var $ret = new ChartSelection(); $ret.item = _this.dp.item(p); return $ret; })())); } else { b.add(((function () { var $ret = new ChartSelection(); $ret.item = _this.dp.item(p); $ret.series = _this; return $ret; })())); } } }; var this_3 = this; for (var p = 0; p < g; p++) { var state_2 = _loop_3(p); if (typeof state_2 === "object") return state_2.value; } } }; ScatterBase.prototype.y0 = function (a, b) { return this.y1(a, b); }; ScatterBase.prototype.y1 = function (a, b) { if (b < a || a < 0 || a > this.zs.count || b < 0 || b > this.zs.count) { return null; } var c = new Array((b - a) + 1); for (var d = a; d <= b; d++) { var e = d; c[d - a] = this.dp.item(d); } return c; }; ScatterBase.prototype.abg = function (a, b) { var _this = this; a.ck = true; this.zk.ay(this, this.z5(), runOn(this, this.y0)); var c = this.zk.d; var d = c != null; var e = this.getEffectiveViewport1(a); var f = this.dp == null ? 0 : this.dp.count; this.y8.cw(function (g) { if (g._visibility == 0) { var h = g.ak; var i = g.content; if (i == null) { i = new DataContext(); g.content = i; } if (d) { _this.abl(h, f, a.t); } _this.zk.ac(g, i); } }); }; ScatterBase.prototype.abm = function (a, b, c) { var d = this.by != 1; var e = this.cq != 1; var f = this.cp != 1; this.zk.a0(this.zk.b, a, b, false); this.zk.ab(this.ic); var g = this.zk.ax; var h = null; var i = null; var j = null; var k = this.dp; if (d && this.dc != null) { h = this.dc.d0.getHighlightingInfo(this, k, g.z, g.y, false); g.c = h; } if (e && this.dc != null) { h = this.dc.d1.getHighlightingInfo(this, k, g.z, g.y, false); g.d = h; } if (f && this.dc != null) { h = this.dc.dz.getHighlightingInfo(this, k, g.z, g.y, false); g.b = h; } g.h = c; this.abw(g); this.zk.z(this, h, i, j, c, d, e, f, a < 0); }; ScatterBase.prototype.abl = function (a, b, c) { var d = this.by != 1; var e = this.cq != 1; var f = this.cp != 1; this.zk.a0(this.zk.d, a, b, true); this.zk.aa(this.ic); var g = this.zk.aw; var h = null; var i = null; var j = null; var k = this.dp; var l = null; var m = null; var n = null; if (d && this.dc != null) { h = this.dc.d0.getHighlightingInfo(this, k, g.z, g.y, true); if (this.dc.d0.isCrossContextHighlight(this)) { l = this.dc.d0.getHighlightingInfo(this, k, g.z, g.y, true); } g.c = h; } if (e && this.dc != null) { i = this.dc.d1.getHighlightingInfo(this, k, g.z, g.y, true); if (i == null && this.bo != null) { i = this.dc.d1.getHighlightingInfo(this.bo, this.bo.dp, g.z, g.y, true); } if (i == null && this.bl != null) { i = this.dc.d1.getHighlightingInfo(this.bl, this.bl.dp, g.z, g.y, true); } if (this.dc.d1.isCrossContextHighlight(this)) { m = this.dc.d1.getHighlightingInfo(this, k, g.z, g.y, true); } g.d = i; } if (f && this.dc != null) { j = this.dc.dz.getHighlightingInfo(this, k, g.z, g.y, true); if (this.dc.dz.isCrossContextHighlight(this)) { n = this.dc.dz.getHighlightingInfo(this, k, g.z, g.y, true); } g.d = i; } g.h = c; this.abv(g); this.zk.y(this, h, i, j, c, d, e, f, g.v, this.dc.d0.totalHighWaterMark, g.x, this.dc.d1.totalHighWaterMark, g.t, this.dc.dz.totalHighWaterMark); }; ScatterBase.prototype.abw = function (a) { if (this.assigningScatterStyle != null && this.zw) { this.assigningScatterStyle(this, a); } }; ScatterBase.prototype.abv = function (a) { if (this.assigningScatterMarkerStyle != null && this.zv) { this.assigningScatterMarkerStyle(this, a); } }; ScatterBase.prototype.abo = function