UNPKG

igniteui-react-charts

Version:

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

1,522 lines (1,521 loc) 94.8 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 { AnnotationLayer } from "./AnnotationLayer"; import { DependencyProperty } from "igniteui-react-core"; import { Base, runOn, delegateCombine, String_$type, typeCast, Array_$type, enumGetBox, EnumUtil, fromEnum, delegateRemove, Point_$type, Date_$type, markType, markDep } from "igniteui-react-core"; import { Series } from "./Series"; import { CalloutPlacementPositionsCollection } from "./CalloutPlacementPositionsCollection"; import { HighlightedValueLabelMode_$type } from "igniteui-react-core"; import { AutoCalloutVisibilityMode_$type } from "./AutoCalloutVisibilityMode"; import { Brush } from "igniteui-react-core"; import { Thickness } from "igniteui-react-core"; import { CalloutCollisionMode_$type } from "igniteui-react-core"; import { FontUtil } from "igniteui-react-core"; import { Rect } from "igniteui-react-core"; import { BindingFormatter } from "igniteui-react-core"; import { CalloutLayerFrame } from "./CalloutLayerFrame"; import { Size } from "igniteui-react-core"; import { HashSet$1 } from "igniteui-react-core"; import { CalloutAnnotationWrapper } from "./CalloutAnnotationWrapper"; import { List$1 } from "igniteui-react-core"; import { LinkedList$1 } from "igniteui-react-core"; import { Dictionary$2 } from "igniteui-react-core"; import { LinkedListNode$1 } from "igniteui-react-core"; import { LabelCollisionManager } from "igniteui-react-core"; import { SeriesPointOfInterest } from "./SeriesPointOfInterest"; import { CalloutAnnotation } from "./CalloutAnnotation"; import { IFastItemsSource_$type } from "igniteui-react-core"; import { DeviceUtils } from "igniteui-react-core"; import { CalloutLabelUpdatingEventArgs } from "./CalloutLabelUpdatingEventArgs"; import { CalloutSeriesSelectingEventArgs } from "./CalloutSeriesSelectingEventArgs"; import { UserAnnotationDataContext } from "./UserAnnotationDataContext"; import { CalloutStyleUpdatingEventArgs } from "./CalloutStyleUpdatingEventArgs"; import { BrushUtilCore } from "igniteui-react-core"; import { LabelCollisionInfo } from "igniteui-react-core"; import { BrushUtil } from "igniteui-react-core"; import { CalloutRenderStyleUpdatingEventArgs } from "./CalloutRenderStyleUpdatingEventArgs"; import { ImageLoadParam } from "igniteui-react-core"; import { ImageLoader } from "igniteui-react-core"; import { IHasCategoryAxis_$type } from "./IHasCategoryAxis"; import { QuadTreeBoundingBox } from "igniteui-react-core"; import { ScalerParams } from "./ScalerParams"; import { ViewportUtils } from "./ViewportUtils"; import { CalloutBadgeInfo } from "./CalloutBadgeInfo"; import { CalloutContentUpdatingEventArgs } from "./CalloutContentUpdatingEventArgs"; import { CalloutKey } from "./CalloutKey"; import { DataContext } from "igniteui-react-core"; import { HashPool$2 } from "igniteui-react-core"; import { AxisRange } from "./AxisRange"; import { Tuple$2 } from "igniteui-react-core"; import { PropertyMetadata } from "igniteui-react-core"; import { isNaN_, isInfinity } from "igniteui-react-core"; import { stringIsNullOrEmpty } from "igniteui-react-core"; import { FastItemObjectColumn } from "igniteui-react-core"; import { AnnotationLayerView } from "./AnnotationLayerView"; import { TextBlock } from "igniteui-react-core"; import { Color } from "igniteui-react-core"; import { Rectangle } from "igniteui-react-core"; import { Line } from "igniteui-react-core"; import { Image } from "igniteui-react-core"; import { TranslateTransform } from "igniteui-react-core"; import { CalloutViewHelper } from "./CalloutViewHelper"; /** * @hidden */ var CalloutLayer = /** @class */ /*@__PURE__*/ (function (_super) { __extends(CalloutLayer, _super); function CalloutLayer() { var _this = _super.call(this) || this; _this.ab0 = false; _this.abv = false; _this.abx = false; _this.abw = true; _this.aid = new Size(1, 0, 0); _this.abu = true; _this.calloutStyleUpdating = null; _this.calloutRenderStyleUpdating = null; _this.abg = null; _this.abh = null; _this.abi = null; _this.abf = null; _this.abe = null; _this.acr = new HashSet$1(CalloutAnnotationWrapper.$, 0); _this.acu = new List$1(CalloutAnnotationWrapper.$, 0); _this.acv = new List$1(CalloutAnnotationWrapper.$, 0); _this.aa4 = null; _this.aas = null; _this.abd = null; _this.abp = null; _this.abb = null; _this.acw = new List$1(CalloutAnnotationWrapper.$, 0); _this.acx = new List$1(CalloutAnnotationWrapper.$, 0); _this.adk = 0; _this.ac0 = -1; _this.acz = -1; _this.acs = new LinkedList$1(CalloutAnnotationWrapper.$); _this.acp = new Dictionary$2(CalloutAnnotationWrapper.$, LinkedListNode$1.$.specialize(CalloutAnnotationWrapper.$), 0); _this.abq = null; _this.aib = new Rect(0, 0, 0, 1, 1); _this.ab2 = false; _this.ab4 = false; _this.adj = 0; _this.aia = Rect.empty; _this.ab1 = false; _this.ab3 = false; _this.calloutContentUpdating = null; _this.calloutLabelUpdating = null; _this.calloutSeriesSelecting = null; _this.act = new List$1(SeriesPointOfInterest.$, 0); _this.ab6 = false; _this.ab7 = false; _this.ac1 = 0; _this.ab5 = false; _this.aav = null; _this.aby = false; _this.abz = true; _this.aaw = 1; FastItemObjectColumn.m(); _this.aas = null; _this.aa4 = new CalloutPlacementPositionsCollection(); var a = _this.aa4; a.collectionChanged = delegateCombine(a.collectionChanged, runOn(_this, _this.afv)); _this.x6 = true; var b = new CalloutLayerFrame(); var c = new CalloutLayerFrame(); var d = new CalloutLayerFrame(); var e = _this.km / 1000; _this.xx = b; _this.xw = c; _this.xy = d; _this.ab = CalloutLayer.$; return _this; } CalloutLayer.prototype.bk = function () { return new CalloutLayer(); }; CalloutLayer.prototype.get_eq = function () { return true; }; CalloutLayer.prototype.afv = function (a, b) { this.af4(); }; CalloutLayer.prototype.af4 = function () { this.aas = this.aau(this.aa5); this.af1(); }; CalloutLayer.prototype.afw = function (a, b) { this.acv.clear(); this.r8(false); }; CalloutLayer.prototype.po = function (a, b, c, d) { _super.prototype.po.call(this, a, b, c, d); var e = this.acq(); switch (a) { case 3: this.agd(b, e, true); break; case 1: for (var f = b; f < b + c; f++) { var g = new CalloutAnnotation(); var h = new CalloutAnnotationWrapper(); h.b = g; h.b.series = this.aba; this.acv.insert(f, h); this.agd(f, e, false); } break; case 0: this.acv.v(b, c); break; case 2: for (var i = b; i < b + c; i++) { this.agd(i, e, true); } break; case 4: this.acv.clear(); for (var j = 0; j < this.dp.count; j++) { var k = new CalloutAnnotation(); var l = new CalloutAnnotationWrapper(); l.b = k; l.b.series = this.aba; this.acv.add(l); this.agd(j, e, false); } break; } this.r8(true); }; CalloutLayer.prototype.gl = function (a) { return false; }; CalloutLayer.prototype.aif = function () { var a = new Thickness(0, DeviceUtils.g(3)); if (isNaN_(this.aie.left) || isNaN_(this.aie.top) || isNaN_(this.aie.right) || isNaN_(this.aie.bottom)) { a = new Thickness(0, DeviceUtils.g(3)); } else { a = this.aie; } return a; }; CalloutLayer.prototype.xe = function () { if (!this.abu) { return this.aid; } var a = 0; var b = 0; if (!this.aca) { this.aid = new Size(1, 0, 0); return this.aid; } if (this.acc) { this.ab0 = true; var c = new CalloutLayerFrame(); this.zf(c, this.cw); this.ab0 = false; if (this.acw != null && this.acw.count == 0) { this.aid = new Size(1, 0, 0); return this.aid; } } var d = this.aif(); var e = -1.7976931348623157E+308; var f = -1.7976931348623157E+308; for (var g = 0; g < this.acw.count; g++) { var h = this.acw._inner[g].b.text; var i = this.aa3.da(h, d, null); if (!isNaN_(i.height)) { f = Math.max(i.height, f); } if (!isNaN_(i.width)) { e = Math.max(i.width, e); } } a = f; b = e; if (!isNaN_(this.adg)) { a += this.adg; } if (!isNaN_(this.adg)) { b += this.adg; } if (!isNaN_(this.ada)) { a = Math.max(a, this.ada); } if (!isNaN_(this.ac8)) { a = Math.min(a, this.ac8); } if (!isNaN_(this.adb)) { b = Math.max(b, this.adb); } if (!isNaN_(this.ac9)) { b = Math.min(b, this.ac9); } this.abw = false; this.aid = new Size(1, b, a); return this.aid; }; CalloutLayer.prototype.acq = function () { var a = new Dictionary$2(String_$type, Series.$, 0); if (this.dc != null) { for (var b = 0; b < this.dc.b9.count; b++) { var c = this.dc.b9._inner[b]; if (c.name != null && !a.containsKey(c.name)) { a.addItem(c.name, c); } } } return a; }; CalloutLayer.prototype.agd = function (a, b, c) { var _this = this; if (this.abo == null || this.abm == null) { return; } var d = a; if (this.abn != null) { d = this.abn.item(a); } var e = this.abo.item(a); var f = this.abm.item(a); var g = this.acv._inner[a]; if (this.abl != null) { if (g.b.ao != this.abl.item(a)) { g.b.key = this.abl.item(a); } } if (this.acp.containsKey(g)) { g.b = this.acp.item(g).c.b; } g.b.xValue = d; g.b.yValue = e; g.b.badgeImage = this.aex(a); if (this.calloutLabelUpdating != null) { var h = ((function () { var $ret = new CalloutLabelUpdatingEventArgs(); $ret.d = d; $ret.e = e; $ret.item = _this.dp.item(a); $ret.c = f; return $ret; })()); this.calloutLabelUpdating(this, h); if (h.c != null && !Base.equalsStatic(h.c, g.b.bc)) { var i = h.c; if (this.aav != null) { g.b.text = this.aav.i(i); } else { g.b.text = i != null ? i.toString() : ""; } } } else { if (this.aav != null) { g.b.text = this.aav.i(f); } else { g.b.text = f != null ? f.toString() : ""; } } if (this.abk != null) { g.b.content = this.abk.item(a); } else { g.b.content = this.dp.item(a); } g.b.n = typeCast(UserAnnotationDataContext.$, this.dp.item(a)); if (this.calloutSeriesSelecting != null) { var j = ((function () { var $ret = new CalloutSeriesSelectingEventArgs(); $ret.c = d; $ret.d = e; $ret.item = _this.dp.item(a); return $ret; })()); this.calloutSeriesSelecting(this, j); if (j.a != null) { g.b.series = j.a; } else if (j.e != null) { if (b.containsKey(j.e)) { g.b.series = b.item(j.e); } } } this.age(g); if (c && g.c != null) { this.agf(g.c, g); } }; CalloutLayer.prototype.age = function (a) { var b = new Thickness(0, DeviceUtils.g(3)); if (isNaN_(this.aie.left) || isNaN_(this.aie.top) || isNaN_(this.aie.right) || isNaN_(this.aie.bottom)) { b = new Thickness(0, DeviceUtils.g(3)); } else { b = this.aie; } var c = DeviceUtils.g(3); if (isNaN_(this.ac7)) { c = DeviceUtils.g(3); } else { c = this.ac7; } var d = this.aa3.c4(a.b.l, a.b.itemColor); var e = this.aa3.c8(a.b.l, a.b.itemColor); var f = this.aa3.c6(a.b.l, a.b.itemColor); var g = this.ah2 != null && !this.acl ? this.ah2 : d; var h = this.ah9 != null ? this.ah9 : null; var i = this.ah7 != null ? this.ah7 : this.aa3.c7(); var j = this.ah5 != null ? this.ah5 : this.aa3.c5(); var k = this.ah8 != null && !this.acm ? this.ah8 : e; var l = this.ah6 != null ? this.ah6 : f; var m = isNaN_(this.adh) ? 0 : this.adh; if (h == null && (this.acj || this.ah7 != null || this.ah5 != null)) { var n = g; if (n == null || BrushUtilCore.a(g)) { n = this.dc != null ? this.dc.x7 : null; if (a.c != null && (a.c.b == 8 || a.c.b == 9)) { n = a.b.itemColor; } if (n == null || BrushUtilCore.a(g)) { n = BrushUtil.j(255, 255, 255, 255); } } h = BrushUtil.l(n, j, i); } if (h == null) { h = this.aa3.c7(); } var o = this.ah3 != null ? this.ah3 : this.ab8 ? d : h; var p = this.ah4 != null ? this.ah4 : this.ab8 ? e : h; var q = !isNaN_(this.ac5) ? this.ac5 : 1; var r = !isNaN_(this.ac4) ? this.ac4 : 10; var s = !isNaN_(this.ac6) ? this.ac6 : 10; var t = !isNaN_(this.ac3) ? this.ac3 : 5; var u = !isNaN_(this.ac2) ? this.ac2 : 5; var v = this.ab9; var w = a.b.bb; if (!v) { t = 0; q = 0; r = 0; s = 0; w = null; } if (this.ach && this.calloutStyleUpdating != null) { var x = new CalloutStyleUpdatingEventArgs(); x.item = a.b.an; x.xValue = a.b.ap; x.yValue = a.b.aq; x.series = a.b.l; x.background = g; x.backgroundCorner = c; x.textColor = h; x.outline = k; x.leaderBrush = l; x.strokeThickness = m; x.badgeOutline = p; x.badgeCorner = u; x.badgeBackground = o; x.badgeThickness = q; x.badgeHeight = r; x.badgeWidth = s; x.badgeVisible = v; x.badgeGap = t; x.badgeImage = w; x.bacgkroundPaddingLeft = b.left; x.bacgkroundPaddingTop = b.top; x.bacgkroundPaddingBottom = b.bottom; x.bacgkroundPaddingRight = b.right; x.o = a.b.n; this.calloutStyleUpdating(this, x); g = x.background; h = x.textColor; k = x.outline; l = x.leaderBrush; m = x.strokeThickness; c = x.backgroundCorner; p = x.badgeOutline; o = x.badgeBackground; v = x.badgeVisible; b = new Thickness(1, x.bacgkroundPaddingLeft, x.bacgkroundPaddingTop, x.bacgkroundPaddingRight, x.bacgkroundPaddingBottom); if (v) { q = x.badgeThickness; r = x.badgeHeight; s = x.badgeWidth; t = x.badgeGap; w = x.badgeImage; u = x.badgeCorner; } else { t = 0; q = 0; r = 0; s = 0; w = null; } } a.b.backgroundPadding = b; a.b.backgroundCornerRadius = c; a.b.background = g; a.b.textColor = h; a.b.outline = k; a.b.leaderBrush = l; a.b.strokeThickness = m; a.b.badgeGap = t; a.b.badgeCorner = u; a.b.badgeBackground = o; a.b.badgeOutline = p; a.b.badgeThickness = q; a.b.badgeHeight = r; a.b.badgeWidth = s; a.b.badgeVisible = v; a.b.badgeImage = w; }; CalloutLayer.prototype.kz = function (a, b) { var c = this.no(b); if (c == CalloutLayer.$$p[44]) { return this.k0(a, b, this.afa); } if (c == CalloutLayer.$$p[55]) { return this.k0(a, b, this.afq); } if (c == CalloutLayer.$$p[56]) { return this.k0(a, b, this.aft); } if (c == CalloutLayer.$$p[41]) { return this.k0(a, b, this.ae4); } if (c == CalloutLayer.$$p[35]) { return this.k0(a, b, this.aev); } return _super.prototype.kz.call(this, a, b); }; CalloutLayer.prototype.mo = function (a) { var b = this.no(a); if (b == CalloutLayer.$$p[44]) { return this.afa; } if (b == CalloutLayer.$$p[55]) { return this.afq; } if (b == CalloutLayer.$$p[56]) { return this.aft; } if (b == CalloutLayer.$$p[41]) { return this.ae4; } if (b == CalloutLayer.$$p[35]) { return this.aev; } return _super.prototype.mo.call(this, a); }; Object.defineProperty(CalloutLayer.prototype, "abm", { get: function () { return this.abg; }, set: function (a) { if (this.abg != a) { var b = this.abg; this.abg = a; this.raisePropertyChanged("LabelColumn", b, this.abg); } }, enumerable: false, configurable: true }); Object.defineProperty(CalloutLayer.prototype, "abn", { get: function () { return this.abh; }, set: function (a) { if (this.abh != a) { var b = this.abh; this.abh = a; this.raisePropertyChanged("XColumn", b, this.abh); } }, enumerable: false, configurable: true }); Object.defineProperty(CalloutLayer.prototype, "abo", { get: function () { return this.abi; }, set: function (a) { if (this.abi != a) { var b = this.abi; this.abi = a; this.raisePropertyChanged("YColumn", b, this.abi); } }, enumerable: false, configurable: true }); Object.defineProperty(CalloutLayer.prototype, "abl", { get: function () { return this.abf; }, set: function (a) { if (this.abf != a) { var b = this.abf; this.abf = a; this.raisePropertyChanged("KeyColumn", b, this.abf); } }, enumerable: false, configurable: true }); Object.defineProperty(CalloutLayer.prototype, "abk", { get: function () { return this.abe; }, set: function (a) { if (this.abe != a) { var b = this.abe; this.abe = a; this.raisePropertyChanged("ContentColumn", b, this.abe); } }, enumerable: false, configurable: true }); CalloutLayer.prototype.afy = function (a, b) { if (b.propertyName == CalloutAnnotation.$$p[24] || b.propertyName == CalloutAnnotation.$$p[25]) { var c = a.k; if (!this.acr.contains(c)) { this.acr.add_1(c); this.acu.add(c); this.r8(false); } } }; CalloutLayer.prototype.ct = function () { return new CalloutLayerView(this); }; CalloutLayer.prototype.rh = function (a) { _super.prototype.rh.call(this, a); this.aa3 = a; }; Object.defineProperty(CalloutLayer.prototype, "aa5", { get: function () { return this.aa4; }, set: function (a) { var b = this.aa5; if (a != b) { this.aa4 = a; this.raisePropertyChanged("AllowedPositions", b, this.aa5); } }, enumerable: false, configurable: true }); CalloutLayer.prototype.g0 = function (a) { if (this.aba == null) { return true; } if (this.aba == a) { return true; } return false; }; Object.defineProperty(CalloutLayer.prototype, "aay", { get: function () { return EnumUtil.getEnumValue(AutoCalloutVisibilityMode_$type, this.c(CalloutLayer.ahe)); }, set: function (a) { this.h(CalloutLayer.ahe, enumGetBox(AutoCalloutVisibilityMode_$type, a)); }, enumerable: false, configurable: true }); Object.defineProperty(CalloutLayer.prototype, "aax", { get: function () { return this.aaw; }, set: function (a) { this.aaw = a; }, enumerable: false, configurable: true }); Object.defineProperty(CalloutLayer.prototype, "abj", { get: function () { return this.abd; }, set: function (a) { if (this.abd != a) { var b = this.abd; this.abd = a; this.raisePropertyChanged("CalloutBadgeImageColumn", b, this.abd); } }, enumerable: false, configurable: true }); CalloutLayer.prototype.aga = function () { this.dp.deregisterColumn(this.abj); this.abp = ImageLoadParam.a(this.adz, "{", "}"); if (stringIsNullOrEmpty(this.abp.value)) { this.abj = null; } else { this.abj = this.dn(this.abp.value); } }; CalloutLayer.prototype.aex = function (a) { if (this.abj != null && this.abj.count > a) { var b = this.abj.item(a); var c = this.abp.b(b); return c; } else { return null; } }; CalloutLayer.prototype.provideRenderer = function (a) { _super.prototype.provideRenderer.call(this, a); ImageLoader.d = a; if (this.aa3 != null) { this.aa3.cw = a; } }; Object.defineProperty(CalloutLayer.prototype, "aie", { get: function () { return new Thickness(1, this.add, this.adf, this.ade, this.adc); }, enumerable: false, configurable: true }); Object.defineProperty(CalloutLayer.prototype, "abc", { get: function () { if (this.abb == null) { this.abb = FontUtil.toFontInfo(this.j8, this.afg); } return this.abb; }, enumerable: false, configurable: true }); CalloutLayer.prototype.zd = function (a, b) { if (this.aba == null || this.aba == a) { if (!this.a1.c) { this.r8(b); } } }; CalloutLayer.prototype.zf = function (a, b) { var e_1, _a; var _this = this; _super.prototype.zf.call(this, a, b); var c = a; c.ac.clear(); c.ad.clear(); c.z.clear(); c.r.clear(); c.u.clear(); c.t.clear(); c.w.clear(); c.y.clear(); c.x.clear(); c.v.clear(); c.s.clear(); c.aa.clear(); c.ab.clear(); c.ag.clear(); c.ah.clear(); c.ae.clear(); c.af.clear(); c.i.clear(); c.n.clear(); c.l.clear(); c.q.clear(); c.k.clear(); c.j.clear(); c.o.clear(); c.p.clear(); c.m.clear(); var d = this.acy(); var e = new List$1(CalloutAnnotationWrapper.$, 0); var f = Number.POSITIVE_INFINITY; var g = true; if (this.ace) { if (this.x4(this.aba)) { if (typeCast(IHasCategoryAxis_$type, this.aba) !== null) { var h = this.aba.i3() > 0 ? this.aba.i3() : this.aba.getCategoryWidth(); if (!isNaN_(h) && !isInfinity(h) && h > 0) { f = Math.min(f, h); } } this.af6(this.aba, c, e); } else { try { for (var _b = __values(fromEnum(this.dc.b9)), _c = _b.next(); !_c.done; _c = _b.next()) { var i = _c.value; if (this.x4(i)) { if (typeCast(IHasCategoryAxis_$type, i) !== null) { var j = i.i3() > 0 ? i.i3() : i.getCategoryWidth(); if (!isNaN_(j) && !isInfinity(j) && j > 0) { f = Math.min(f, j); } } if (!i.ev) { if (!i.isVertical) { g = false; } } var k = false; if (i.ei && this.aa9 == 0 || this.aa9 == 3 || this.aa9 == 2) { if (this.aa9 == 0 || this.aa9 == 2) { k = true; } i.qf(function (l) { _this.af6(l, c, e); return true; }); } if (!k) { this.af6(i, c, e); } } } } 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.ace && this.aax == 2) { var l = 0; var m = 0; var n = 1.7976931348623157E+308; var o = 1.7976931348623157E+308; var p = -1.7976931348623157E+308; var q = -1.7976931348623157E+308; if (e.count > 0) { if (e._inner[0].c != null) { l = e._inner[0].e; m = e._inner[0].f; } for (var r = 0; r < e.count; r++) { var s = e._inner[r]; if (s.c != null) { var t = s.e; var u = s.f; if (t != l) { n = Math.min(n, Math.abs(t - l)); } if (u != m) { o = Math.min(o, Math.abs(u - m)); } p = Math.max(s.c.p + s.c.p, p); q = Math.max(s.c.o + s.c.o, q); } } if (g) { if (!isNaN_(f) && !isInfinity(f)) { if (q > f) { e.clear(); } } else { if (q > o) { e.clear(); } } } else { if (!isNaN_(f) && !isInfinity(f)) { if (p > f) { e.clear(); } } else { if (p > n) { e.clear(); } } } } } var v = this.adk <= 0 && e.count > 0; var w = this.adk > 0 && e.count <= 0; var x = v || w; var y = this.adk != e.count; if (v && this.acd) { return; } if (!this.ab0) { this.af5(c, d, e); } var z = this.da.ix(); var aa = this.da.iw(); var ab = z != this.ac0; var ac = aa != this.acz; var ad = ab || ac; if (ad) { this.ac0 = z; this.acz = aa; } this.adk = e.count; if (this.ab0) { return; } if (!this.abv && this.aca && this.acb && e.count > 0 && e.count == this.adk && this.aax == 2) { this.abv = true; this.af8(); } }; CalloutLayer.prototype.s9 = function (a, b) { _super.prototype.s9.call(this, a, b); var c = b.width - this.aib.width; var d = b.height - this.aib.height; var e = 0; if (Math.abs(c) > Math.abs(d)) { e = c; this.ac1 = c * this.xd.width; } else { e = d; this.ac1 = d * this.xd.height; } if (e > 0 && this.ac1 > 5) { this.ab7 = true; } if (e < 0 && this.ac1 > 5) { this.ab6 = true; } }; CalloutLayer.prototype.s8 = function (a, b) { _super.prototype.s8.call(this, a, b); if (!a.equals1(b)) { this.ab5 = true; } }; Object.defineProperty(CalloutLayer.prototype, "aic", { get: function () { return this.aia; }, set: function (a) { this.aia = a; }, enumerable: false, configurable: true }); CalloutLayer.prototype.af5 = function (a, b, c) { var e_2, _a; if (this.dc != null) { this.aib = this.dc.yr; } if (this.xd.isEmpty) { return; } this.aic = new Rect(0, this.xd.left, this.xd.top, this.xd.width, this.xd.height); if (this.abq != null && this.aes != null && this.aes != this.abq.bd) { this.af0(); } if (this.abq != null && this.abq.j != this.abs()) { this.af0(); } if (this.abq == null) { var d = this.abr(); if (d != null) { this.abq = d; var e = this.abq; e.labelsMoved = delegateCombine(e.labelsMoved, runOn(this, this.afx)); } else { var f = this.w4(this.cw); var g = new Array(2); g[0] = 0; g[1] = 3; if (this.aba != null) { if (this.aba.isVertical) { g = new Array(2); g[0] = 2; g[1] = 1; } } else { var h = false; if (this.dc != null && this.dc.b9.count > 0) { h = true; try { for (var _b = __values(fromEnum(this.dc.b9)), _c = _b.next(); !_c.done; _c = _b.next()) { var i = _c.value; if (!i.ev) { if (!i.isVertical) { h = false; } } } } catch (e_2_1) { e_2 = { error: e_2_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_2) throw e_2.error; } } } if (h) { g = new Array(2); g[0] = 2; g[1] = 1; } } if (this.aa0 == 4 || this.aa0 == 6) { g = new Array(4); g[0] = 10; g[1] = 11; g[2] = 8; g[3] = 9; } if (this.aa0 == 5) { g = new Array(4); g[0] = 9; g[1] = 10; g[2] = 11; g[3] = 8; } if (this.aa0 == 7) { g = new Array(4); g = new Array(4); g[0] = 8; g[1] = 10; g[2] = 11; g[3] = 9; } this.abq = new LabelCollisionManager(this.xd.right, this.xd.bottom, this.xd, this.aa3.k(), this.adg, this.abs(), g, this.ado(), this.adn(), this.acf, this.aas); this.abq.v = this.aci; if (this.aes != null) { this.abq.bd = this.aes; this.abq.bb = this; } var j = this.abq; j.labelsMoved = delegateCombine(j.labelsMoved, runOn(this, this.afx)); } } if (this.ab6) { this.ab6 = false; if (this.abq.a9 > 2) { this.ab4 = true; } } if (this.ab7) { this.ab7 = false; if (this.ac1 > 5) { this.ab4 = true; } } if (this.ab5) { this.ab5 = false; this.abq.bs(this.xd.right, this.xd.bottom, this.xd); this.ab4 = true; } var k = new HashSet$1(CalloutAnnotationWrapper.$, 0); var l = new HashSet$1(CalloutAnnotationWrapper.$, 0); var m = new List$1(CalloutAnnotationWrapper.$, 0); var n = new List$1(CalloutAnnotationWrapper.$, 0); var o = new HashSet$1(CalloutAnnotationWrapper.$, 0); for (var p = 0; p < b.count; p++) { o.add_1(b._inner[p]); } for (var q = 0; q < c.count; q++) { o.add_1(c._inner[q]); } var r = this.acs.c; while (r != null) { var s = r.a; if (!o.contains(r.c)) { n.add(r.c); l.add_1(r.c); var t = r.c.b; t.propertyChanged = delegateRemove(t.propertyChanged, runOn(this, this.afy)); this.acs.h(r); this.acp.removeItem(r.c); this.abq.br(r.c.c); } r = s; } for (var u = 0; u < b.count; u++) { if (!this.acp.containsKey(b._inner[u])) { this.acs.f(b._inner[u]); var v = b._inner[u].b; v.propertyChanged = delegateCombine(v.propertyChanged, runOn(this, this.afy)); this.acp.addItem(b._inner[u], this.acs.d); m.add(b._inner[u]); k.add_1(b._inner[u]); this.ab4 = true; } } for (var w = 0; w < c.count; w++) { if (!this.acp.containsKey(c._inner[w])) { this.acs.f(c._inner[w]); this.acp.addItem(c._inner[w], this.acs.d); var x = c._inner[w].b; x.propertyChanged = delegateCombine(x.propertyChanged, runOn(this, this.afy)); m.add(c._inner[w]); k.add_1(c._inner[w]); this.ab4 = true; } } if (this.ab1 == true) { this.ab1 = false; this.ab4 = true; } var y = false; if (this.acu.count > 0) { y = true; this.acu.clear(); this.acr.clear(); } r = this.acs.c; while (r != null) { var z = this.abt(r.c); if (z == null) { return; } if (!Base.equalsStatic(z, r.c.c.e)) { var aa = false; if (r.c.c.e == null) { aa = true; } var ab = r.c.c; ab.s = z.d; ab.t = z.e; if (!isNaN_(ab.s) && !isNaN_(ab.t)) { ab.r = z.g; ab.q = z.f; if (ab.c == null) { this.abq.ad(ab, false); } if (aa) { this.abq.be(ab); } else { this.abq.bo(ab); } } } r = r.a; } var ac = this.abq.ba(); var ad = this.abq.af(); if (!this.ab4 && y && (ac != 0 || ad)) { { this.ab4 = true; } } if (ad) { if (this.abq.x()) { this.ab4 = true; } } if (this.ab4 && (ac != 0 || ad || this.ab2)) { this.ab2 = false; this.ab4 = false; this.adj = 0x7FFFFFFF; if (this.aes != null) { var ae = true; for (var af = 0; af < this.dc.b9.count; af++) { var ag = this.dc.b9._inner[af]; if (ag.ev && typeCast(CalloutLayer.$, ag) !== null) { var ah = ag; if (ah.aes == this.aes) { if (!ah.aic.equals1(this.abq.b0)) { ae = false; break; } } } } if (ae) { this.abq.bv(); } else { this.abq.bf(); this.abq.bg(); } } else { this.abq.bv(); } } else { this.abq.bg(); } var ai = this.acs.c; var aj; var ak; var al; var am; var an; var ao; var ap; var aq; var ar; var as; var at; var au; var av; var aw; var ax; var ay; var az; var a0; var a1; var a2; var a3; var a4; var a5; var a6 = NaN; var a7 = NaN; var a8 = this.acg; var a9 = this.aci; var ba = this.cw.b5(); while (ai != null) { var bb = ai.c; var bc = bb.b; aj = bc.cl; ak = bc.cq; al = bc.cp; am = bc.backgroundPadding.left; an = bc.backgroundPadding.top; ao = bc.backgroundPadding.right; ap = bc.backgroundPadding.bottom; ar = bc.backgroundCornerRadius; aq = bc.al; as = bc.cr; at = bc.bc; au = bc.an; az = bc.cm; a0 = bc.cn; a2 = bc.aj; a3 = bc.ai; a4 = bc.ak; a1 = bc.q; a6 = bc.ah; a7 = bc.ag; a5 = bc.bb; var bd = bb.c; av = bd.s - (bd.k - bd.p); aw = bd.t - (bd.l - bd.o); ax = bd.k - bd.p; ay = bd.l - bd.o; var be = false; if (a9) { if (bd.c != null && this.abq.ab(bd.c)) { be = true; } } if (bb.c.h && !be) { av = NaN; aw = NaN; } if (!bb.c.h && (bb.c.b == 8 || bb.c.b == 9)) { al = ba; av = bd.k; aw = bd.l; } if (be) { at = this.afi(bb, at); var bf = this.abq.as(bb.c.c); if (bf > 0) { ax += bf; av -= bf; } } if (a8) { var bg = new CalloutRenderStyleUpdatingEventArgs(); bg.background = aj; bg.outline = ak; bg.leaderBrush = al; bg.strokeThickness = aq; bg.textColor = as; bg.item = au; bg.series = bc.l; bg.actualPosition = bd.b; bg.xValue = bc.ap; bg.yValue = bc.aq; bg.width = bd.p * 2; bg.height = bd.o * 2; bg.badgeOutline = a0; bg.badgeBackground = az; bg.badgeThickness = a2; bg.badgeImage = a5; bg.backgroundCorner = ar; bg.l = bb.b.n; if (this.calloutRenderStyleUpdating != null) { this.calloutRenderStyleUpdating(this, bg); aj = bg.background; ak = bg.outline; al = bg.leaderBrush; aq = bg.strokeThickness; as = bg.textColor; a0 = bg.badgeOutline; az = bg.badgeBackground; a2 = bg.badgeThickness; a5 = bg.badgeImage; ar = bg.backgroundCorner; } } a.z.add1(bb); a.r.add(aj); a.u.add(ak); a.t.add(al); a.w.add(am); a.y.add(an); a.x.add(ao); a.v.add(ap); a.s.add(ar); a.aa.add(aq); a.ab.add(as); a.ac.add1(at); a.ad.add1(au); a.i.add(az); a.n.add(a0); a.l.add(a3); a.q.add(a4); a.j.add(a7); a.k.add(a6); a.o.add(a2); a.p.add(a1); a.m.add1(a5); a.ag.add(av); a.ah.add(aw); a.ae.add(ax); a.af.add(ay); ai = ai.a; } }; CalloutLayer.prototype.afi = function (a, b) { var c = Math.max(this.abq.as(a.c.c), this.abq.at(a.c.c)); if (c <= 0) { return b; } var d = b.length; var e = this.aa3.da(b, a.b.backgroundPadding, null); var f = e.width; var g = f - c; while (f - g > 0.0001 && d > 0) { d--; b = b.substr(0, d) + "…"; e = this.aa3.da(b, a.b.backgroundPadding, null); f = e.width; } return b; }; CalloutLayer.prototype.af0 = function () { if (this.abq != null) { var a = this.acs.c; while (a != null) { var b = a.c.c; if (b != null) { this.abq.br(b); } a = a.a; } var c = this.abq; c.labelsMoved = delegateRemove(c.labelsMoved, runOn(this, this.afx)); this.abq = null; } this.afz(); }; CalloutLayer.prototype.abr = function () { if (this.dc == null) { return null; } for (var a = 0; a < this.dc.b9.count; a++) { var b = this.dc.b9._inner[a]; if (b.ev && typeCast(CalloutLayer.$, b) !== null) { var c = b; if (c != this) { if (c.aes != null && c.aes == this.aes) { if (c.abq != null) { return c.abq; } } } } } return null; }; CalloutLayer.prototype.adn = function () { return 20000; }; CalloutLayer.prototype.ado = function () { return 300; }; CalloutLayer.prototype.abs = function () { switch (this.aa0) { case 0: return 2; case 2: return 1; case 3: return 2; case 1: return 0; case 4: return 3; case 7: return 7; case 5: return 5; case 6: return 6; } return 2; }; CalloutLayer.prototype.afx = function (a) { var b = this.abq.ba(); var c = this.adj; if (b < this.adj) { this.adj = b; if (c != 0x7FFFFFFF) { this.r8(false); } } }; CalloutLayer.prototype.abt = function (a) { var b = this.aba; if (a.b.l != null) { b = a.b.l; } if (b == null) { for (var c = 0; c < this.dc.b9.count; c++) { var d = this.dc.b9._inner[c]; if (!d.ev) { b = d; break; } } } if (b == null) { return null; } var e = b.ai(); var f = b.i5(); var g = null; var h = null; var i = false; for (var j = 0; j < e.length; j++) { if (e[j] == null) { continue; } if (e[j].dc) { i = true; g = e[j]; } else if (e[j].du) { i = true; h = e[j]; } else if (e[j].dy) { h = e[j]; } else { g = e[j]; } } if (g == null || h == null) { return null; } if (!g.dx() || !h.dx()) { return null; } var k = 0; var l = 0; if (g.df && g.categoryMode != 0) { if (b.fa) { k = b.getOffsetValue(); } else if (b.e1) { k = b.getOffsetValue(); } } if (h.df && h.categoryMode != 0) { if (b.e1) { l = b.getOffsetValue(); } } var m = new ScalerParams(0, this.dc.yr, g.o6, g.dn, g.o1()); m.b = f; var n = new ScalerParams(0, this.dc.yr, h.o6, h.dn, h.o1()); n.b = f; var o = 0; var p = 0; if (i) { o = g.f6(this.adi(a.b.ap), m) + k; p = h.f6(this.adi(a.b.aq), n) + l; var q = o; var r = p; var s = { $type: Point_$type, x: 0.5, y: 0.5 }; var t = s.x + (r * Math.cos(q)); o = ViewportUtils.e(t, m.e, m.d, m.c); var u = s.y + (r * Math.sin(q)); p = ViewportUtils.i(u, n.e, n.d, n.c); } else { o = g.f6(this.adi(a.b.ap), m) + k; p = h.f6(this.adi(a.b.aq), n) + l; } var v = new QuadTreeBoundingBox(); v.d = o; v.e = p; v.g = 3; v.f = 3; v.i = a.b; return v; }; CalloutLayer.prototype.adi = function (a) { if (typeCast(Date_$type, a) !== null) { return a.getTime(); } if (a == null) { return 0; } return a; }; CalloutLayer.prototype.acy = function () { var a = new List$1(CalloutAnnotationWrapper.$, 0); for (var b = 0; b < this.acv.count; b++) { if (stringIsNullOrEmpty(this.acv._inner[b].b.bc)) { continue; } if (this.acv._inner[b].c == null) { var c = new LabelCollisionInfo(); this.acv._inner[b].c = c; var d = this.acv._inner[b]; this.agf(c, d); } var e = this.abt(this.acv._inner[b]); if (e == null || e.d < this.xd.left || e.d > this.xd.right || e.e < this.xd.top || e.e > this.xd.bottom) { continue; } a.add(this.acv._inner[b]); } return a; }; CalloutLayer.prototype.agf = function (a, b) { var c = ((function () {