UNPKG

igniteui-react-charts

Version:

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

1,414 lines 71.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 { AnnotationLayer } from "./AnnotationLayer"; import { DependencyProperty } from "igniteui-react-core"; import { Base, runOn, delegateCombine, String_$type, Array_$type, enumGetBox, EnumUtil, typeCast, 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 { 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 { IHasCategoryAxis_$type } from "./IHasCategoryAxis"; import { QuadTreeBoundingBox } from "igniteui-react-core"; import { ScalerParams } from "./ScalerParams"; import { ViewportUtils } from "./ViewportUtils"; 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 { 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 { Line } from "igniteui-react-core"; import { CalloutViewHelper } from "./CalloutViewHelper"; import { Rectangle } from "igniteui-react-core"; import { TranslateTransform } from "igniteui-react-core"; /** * @hidden */ export let CalloutLayer = /*@__PURE__*/ (() => { class CalloutLayer extends AnnotationLayer { bk() { return new CalloutLayer(); } get_eq() { return true; } constructor() { super(); this.aa9 = true; this.aga = new Size(1, 0, 0); this.calloutStyleUpdating = null; this.calloutRenderStyleUpdating = null; this.aax = null; this.aay = null; this.aaz = null; this.aaw = null; this.aav = null; this.abw = new HashSet$1(CalloutAnnotationWrapper.$, 0); this.abz = new List$1(CalloutAnnotationWrapper.$, 0); this.ab0 = new List$1(CalloutAnnotationWrapper.$, 0); this.aam = null; this.aaa = null; this.aat = null; this.abx = new LinkedList$1(CalloutAnnotationWrapper.$); this.abu = new Dictionary$2(CalloutAnnotationWrapper.$, LinkedListNode$1.$.specialize(CalloutAnnotationWrapper.$), 0); this.aa5 = null; this.af8 = new Rect(0, 0, 0, 1, 1); this.abc = false; this.abe = false; this.acf = 0; this.af7 = Rect.empty; this.abb = false; this.abd = false; this.calloutContentUpdating = null; this.calloutLabelUpdating = null; this.calloutSeriesSelecting = null; this.aby = new List$1(SeriesPointOfInterest.$, 0); this.abg = false; this.abh = false; this.ab2 = 0; this.abf = false; this.aad = null; this.aba = true; this.aae = 1; FastItemObjectColumn.m(); this.aaa = null; this.aam = new CalloutPlacementPositionsCollection(); let a = this.aam; a.collectionChanged = delegateCombine(a.collectionChanged, runOn(this, this.aea)); this.xp = true; let b = new CalloutLayerFrame(); let c = new CalloutLayerFrame(); let d = new CalloutLayerFrame(); let e = this.ke / 1000; this.xh = b; this.xg = c; this.xi = d; this.ab = CalloutLayer.$; } aea(a, b) { this.aej(); } aej() { this.aaa = this.aac(this.aan); this.aeg(); } aeb(a, b) { this.ab0.clear(); this.ru(false); } pd(a, b, c, d) { super.pd(a, b, c, d); let e = this.abv(); switch (a) { case 3: this.aeq(b, e); break; case 1: for (let f = b; f < b + c; f++) { let g = new CalloutAnnotation(); let h = new CalloutAnnotationWrapper(); h.b = g; h.b.series = this.aas; this.ab0.insert(f, h); this.aeq(f, e); } break; case 0: this.ab0.v(b, c); break; case 2: for (let i = b; i < b + c; i++) { this.aeq(i, e); } break; case 4: this.ab0.clear(); for (let j = 0; j < this.dp.count; j++) { let k = new CalloutAnnotation(); let l = new CalloutAnnotationWrapper(); l.b = k; l.b.series = this.aas; this.ab0.add(l); this.aeq(j, e); } break; } this.ru(true); } gg(a) { return false; } agc() { let a = new Thickness(0, DeviceUtils.g(3)); if (isNaN_(this.agb.left) || isNaN_(this.agb.top) || isNaN_(this.agb.right) || isNaN_(this.agb.bottom)) { a = new Thickness(0, DeviceUtils.g(3)); } else { a = this.agb; } return a; } wy() { let a = 0; let b = 0; if (!this.abi) { return new Size(1, b, a); } if (!this.aa9) { return this.aga; } let c = "Ig"; let d = this.agc(); let e = this.aal.c7(c, d); if (!isNaN_(e.height)) { a = Math.max(e.height, a); } if (!isNaN_(this.acc)) { a += this.acc; } if (!isNaN_(this.acc)) { b += this.acc; } if (!isNaN_(this.ab6)) { a = Math.max(a, this.ab6); } if (!isNaN_(this.ab4)) { a = Math.min(a, this.ab4); } if (!isNaN_(this.ab7)) { b = Math.max(b, this.ab7); } if (!isNaN_(this.ab5)) { b = Math.min(b, this.ab5); } this.aa9 = false; this.aga = new Size(1, b, a); return this.aga; } abv() { let a = new Dictionary$2(String_$type, Series.$, 0); if (this.dc != null) { for (let b = 0; b < this.dc.series.count; b++) { let c = this.dc.series._inner[b]; if (c.name != null && !a.containsKey(c.name)) { a.addItem(c.name, c); } } } return a; } aeq(a, b) { if (this.aa4 == null || this.aa2 == null) { return; } let c = a; if (this.aa3 != null) { c = this.aa3.item(a); } let d = this.aa4.item(a); let e = this.aa2.item(a); let f = this.ab0._inner[a]; if (this.aa1 != null) { if (f.b.ab != this.aa1.item(a)) { f.b.key = this.aa1.item(a); } } if (this.abu.containsKey(f)) { f.b = this.abu.item(f).c.b; } f.b.xValue = c; f.b.yValue = d; if (this.calloutLabelUpdating != null) { let g = ((() => { let $ret = new CalloutLabelUpdatingEventArgs(); $ret.d = c; $ret.e = d; $ret.item = this.dp.item(a); return $ret; })()); this.calloutLabelUpdating(this, g); if (g.c != null && !Base.equalsStatic(g.c, f.b.ao)) { let h = g.c; if (this.aad != null) { f.b.text = this.aad.i(h); } else { f.b.text = h != null ? h.toString() : ""; } } } else { if (this.aad != null) { f.b.text = this.aad.i(e); } else { f.b.text = e != null ? e.toString() : ""; } } if (this.aa0 != null) { f.b.content = this.aa0.item(a); } else { f.b.content = this.dp.item(a); } if (this.calloutSeriesSelecting != null) { let i = ((() => { let $ret = new CalloutSeriesSelectingEventArgs(); $ret.c = c; $ret.d = d; $ret.item = this.dp.item(a); return $ret; })()); this.calloutSeriesSelecting(this, i); if (i.a != null) { f.b.series = i.a; } else if (i.e != null) { if (b.containsKey(i.e)) { f.b.series = b.item(i.e); } } } this.aer(f); } aer(a) { let b = new Thickness(0, DeviceUtils.g(3)); if (isNaN_(this.agb.left) || isNaN_(this.agb.top) || isNaN_(this.agb.right) || isNaN_(this.agb.bottom)) { b = new Thickness(0, DeviceUtils.g(3)); } else { b = this.agb; } let c = DeviceUtils.g(3); if (isNaN_(this.ab3)) { c = DeviceUtils.g(3); } else { c = this.ab3; } let d = this.af1 != null && !this.abq ? this.af1 : this.aal.c1(a.b.l, a.b.itemColor); let e = this.af6 != null ? this.af6 : null; let f = this.af4 != null ? this.af4 : this.aal.c4(); let g = this.af2 != null ? this.af2 : this.aal.c2(); let h = this.af5 != null && !this.abr ? this.af5 : this.aal.c5(a.b.l, a.b.itemColor); let i = this.af3 != null ? this.af3 : this.aal.c3(a.b.l, a.b.itemColor); let j = isNaN_(this.acd) ? 0 : this.acd; if (e == null && (this.abo || this.af4 != null || this.af2 != null)) { let k = d; if (k == null || BrushUtilCore.a(d)) { k = this.dc != null ? this.dc.vx : null; if (a.c != null && (a.c.b == 8 || a.c.b == 9)) { k = a.b.itemColor; } if (k == null || BrushUtilCore.a(d)) { k = BrushUtil.j(255, 255, 255, 255); } } e = BrushUtil.l(k, g, f); } if (e == null) { e = this.aal.c4(); } if (this.abm && this.calloutStyleUpdating != null) { let l = new CalloutStyleUpdatingEventArgs(); l.item = a.b.aa; l.xValue = a.b.ac; l.yValue = a.b.ad; l.series = a.b.l; l.background = d; l.textColor = e; l.outline = h; l.leaderBrush = i; l.strokeThickness = j; this.calloutStyleUpdating(this, l); d = l.background; e = l.textColor; h = l.outline; i = l.leaderBrush; j = l.strokeThickness; } a.b.backgroundPadding = b; a.b.backgroundCornerRadius = c; a.b.background = d; a.b.textColor = e; a.b.outline = h; a.b.leaderBrush = i; a.b.strokeThickness = j; } kr(a, b) { let c = this.nf(b); if (c == CalloutLayer.$$p[31]) { return this.ks(a, b, this.adp); } if (c == CalloutLayer.$$p[42]) { return this.ks(a, b, this.ad5); } if (c == CalloutLayer.$$p[43]) { return this.ks(a, b, this.ad8); } if (c == CalloutLayer.$$p[28]) { return this.ks(a, b, this.adj); } if (c == CalloutLayer.$$p[22]) { return this.ks(a, b, this.adb); } return super.kr(a, b); } mf(a) { let b = this.nf(a); if (b == CalloutLayer.$$p[31]) { return this.adp; } if (b == CalloutLayer.$$p[42]) { return this.ad5; } if (b == CalloutLayer.$$p[43]) { return this.ad8; } if (b == CalloutLayer.$$p[28]) { return this.adj; } if (b == CalloutLayer.$$p[22]) { return this.adb; } return super.mf(a); } get aa2() { return this.aax; } set aa2(a) { if (this.aax != a) { let b = this.aax; this.aax = a; this.raisePropertyChanged("LabelColumn", b, this.aax); } } get aa3() { return this.aay; } set aa3(a) { if (this.aay != a) { let b = this.aay; this.aay = a; this.raisePropertyChanged("XColumn", b, this.aay); } } get aa4() { return this.aaz; } set aa4(a) { if (this.aaz != a) { let b = this.aaz; this.aaz = a; this.raisePropertyChanged("YColumn", b, this.aaz); } } get aa1() { return this.aaw; } set aa1(a) { if (this.aaw != a) { let b = this.aaw; this.aaw = a; this.raisePropertyChanged("KeyColumn", b, this.aaw); } } get aa0() { return this.aav; } set aa0(a) { if (this.aav != a) { let b = this.aav; this.aav = a; this.raisePropertyChanged("ContentColumn", b, this.aav); } } aed(a, b) { if (b.propertyName == CalloutAnnotation.$$p[15] || b.propertyName == CalloutAnnotation.$$p[16]) { let c = a.k; if (!this.abw.contains(c)) { this.abw.add_1(c); this.abz.add(c); this.ru(false); } } } ct() { return new CalloutLayerView(this); } q3(a) { super.q3(a); this.aal = a; } get aan() { return this.aam; } set aan(a) { let b = this.aan; if (a != b) { this.aam = a; this.raisePropertyChanged("AllowedPositions", b, this.aan); } } gv(a) { if (this.aas == null) { return true; } if (this.aas == a) { return true; } return false; } get aag() { return EnumUtil.getEnumValue(AutoCalloutVisibilityMode_$type, this.c(CalloutLayer.afd)); } set aag(a) { this.h(CalloutLayer.afd, enumGetBox(AutoCalloutVisibilityMode_$type, a)); } get aaf() { return this.aae; } set aaf(a) { this.aae = a; } get agb() { return new Thickness(1, this.ab9, this.acb, this.aca, this.ab8); } get aau() { if (this.aat == null) { this.aat = FontUtil.toFontInfo(this.j0, this.adv); } return this.aat; } yw(a, b) { if (this.aas == null || this.aas == a) { if (!this.a1.c) { this.ru(b); } } } yy(a, b) { super.yy(a, b); let c = a; c.q.clear(); c.r.clear(); c.n.clear(); c.f.clear(); c.i.clear(); c.h.clear(); c.k.clear(); c.m.clear(); c.l.clear(); c.j.clear(); c.g.clear(); c.o.clear(); c.p.clear(); c.u.clear(); c.v.clear(); c.s.clear(); c.t.clear(); let d = this.ab1(); let e = new List$1(CalloutAnnotationWrapper.$, 0); let f = Number.POSITIVE_INFINITY; let g = true; if (this.abj) { if (this.xn(this.aas)) { if (typeCast(IHasCategoryAxis_$type, this.aas) !== null) { let h = this.aas.ix() > 0 ? this.aas.ix() : this.aas.getCategoryWidth(); if (!isNaN_(h) && !isInfinity(h) && h > 0) { f = Math.min(f, h); } } this.ael(this.aas, c, e); } else { for (let i of fromEnum(this.dc.series)) { if (this.xn(i)) { if (typeCast(IHasCategoryAxis_$type, i) !== null) { let j = i.ix() > 0 ? i.ix() : i.getCategoryWidth(); if (!isNaN_(j) && !isInfinity(j) && j > 0) { f = Math.min(f, j); } } if (!i.eu) { if (!i.isVertical) { g = false; } } let k = false; if (i.ei && this.aar == 0 || this.aar == 3 || this.aar == 2) { if (this.aar == 0 || this.aar == 2) { k = true; } i.p3((l) => { this.ael(l, c, e); return true; }); } if (!k) { this.ael(i, c, e); } } } } } if (this.abj && this.aaf == 2) { let l = 0; let m = 0; let n = 1.7976931348623157E+308; let o = 1.7976931348623157E+308; let p = -1.7976931348623157E+308; let 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 (let r = 0; r < e.count; r++) { let s = e._inner[r]; if (s.c != null) { let t = s.e; let 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(); } } } } } this.aek(c, d, e); } sv(a, b) { super.sv(a, b); let c = b.width - this.af8.width; let d = b.height - this.af8.height; let e = 0; if (Math.abs(c) > Math.abs(d)) { e = c; this.ab2 = c * this.wx.width; } else { e = d; this.ab2 = d * this.wx.height; } if (e > 0 && this.ab2 > 5) { this.abh = true; } if (e < 0 && this.ab2 > 5) { this.abg = true; } } su(a, b) { super.su(a, b); if (!a.equals1(b)) { this.abf = true; } } get af9() { return this.af7; } set af9(a) { this.af7 = a; } aek(a, b, c) { if (this.dc != null) { this.af8 = this.dc.wh; } if (this.wx.isEmpty) { return; } this.af9 = new Rect(0, this.wx.left, this.wx.top, this.wx.width, this.wx.height); if (this.aa5 != null && this.ac8 != null && this.ac8 != this.aa5.bd) { this.aef(); } if (this.aa5 != null && this.aa5.j != this.aa7()) { this.aef(); } if (this.aa5 == null) { let d = this.aa6(); if (d != null) { this.aa5 = d; let e = this.aa5; e.labelsMoved = delegateCombine(e.labelsMoved, runOn(this, this.aec)); } else { let f = this.wo(this.cw); let g = new Array(2); g[0] = 0; g[1] = 3; if (this.aas != null) { if (this.aas.isVertical) { g = new Array(2); g[0] = 2; g[1] = 1; } } else { let h = false; if (this.dc != null && this.dc.series.count > 0) { h = true; for (let i of fromEnum(this.dc.series)) { if (!i.eu) { if (!i.isVertical) { h = false; } } } } if (h) { g = new Array(2); g[0] = 2; g[1] = 1; } } if (this.aai == 4 || this.aai == 6) { g = new Array(4); g[0] = 10; g[1] = 11; g[2] = 8; g[3] = 9; } if (this.aai == 5) { g = new Array(4); g[0] = 9; g[1] = 10; g[2] = 11; g[3] = 8; } if (this.aai == 7) { g = new Array(4); g = new Array(4); g[0] = 8; g[1] = 10; g[2] = 11; g[3] = 9; } this.aa5 = new LabelCollisionManager(this.wx.right, this.wx.bottom, this.wx, this.aal.k(), this.acc, this.aa7(), g, this.acj(), this.aci(), this.abk, this.aaa); this.aa5.v = this.abn; if (this.ac8 != null) { this.aa5.bd = this.ac8; this.aa5.bb = this; } let j = this.aa5; j.labelsMoved = delegateCombine(j.labelsMoved, runOn(this, this.aec)); } } if (this.abg) { this.abg = false; if (this.aa5.a9 > 2) { this.abe = true; } } if (this.abh) { this.abh = false; if (this.ab2 > 5) { this.abe = true; } } if (this.abf) { this.abf = false; this.aa5.bs(this.wx.right, this.wx.bottom, this.wx); this.abe = true; } let k = new HashSet$1(CalloutAnnotationWrapper.$, 0); let l = new HashSet$1(CalloutAnnotationWrapper.$, 0); let m = new List$1(CalloutAnnotationWrapper.$, 0); let n = new List$1(CalloutAnnotationWrapper.$, 0); let o = new HashSet$1(CalloutAnnotationWrapper.$, 0); for (let p = 0; p < b.count; p++) { o.add_1(b._inner[p]); } for (let q = 0; q < c.count; q++) { o.add_1(c._inner[q]); } let r = this.abx.c; while (r != null) { let s = r.a; if (!o.contains(r.c)) { n.add(r.c); l.add_1(r.c); let t = r.c.b; t.propertyChanged = delegateRemove(t.propertyChanged, runOn(this, this.aed)); this.abx.h(r); this.abu.removeItem(r.c); this.aa5.br(r.c.c); } r = s; } for (let u = 0; u < b.count; u++) { if (!this.abu.containsKey(b._inner[u])) { this.abx.f(b._inner[u]); let v = b._inner[u].b; v.propertyChanged = delegateCombine(v.propertyChanged, runOn(this, this.aed)); this.abu.addItem(b._inner[u], this.abx.d); m.add(b._inner[u]); k.add_1(b._inner[u]); this.abe = true; } } for (let w = 0; w < c.count; w++) { if (!this.abu.containsKey(c._inner[w])) { this.abx.f(c._inner[w]); this.abu.addItem(c._inner[w], this.abx.d); let x = c._inner[w].b; x.propertyChanged = delegateCombine(x.propertyChanged, runOn(this, this.aed)); m.add(c._inner[w]); k.add_1(c._inner[w]); this.abe = true; } } if (this.abb == true) { this.abb = false; this.abe = true; } let y = false; if (this.abz.count > 0) { y = true; this.abz.clear(); this.abw.clear(); } r = this.abx.c; while (r != null) { let z = this.aa8(r.c); if (z == null) { return; } if (!Base.equalsStatic(z, r.c.c.e)) { let aa = false; if (r.c.c.e == null) { aa = true; } let 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.aa5.ad(ab, false); } if (aa) { this.aa5.be(ab); } else { this.aa5.bo(ab); } } } r = r.a; } let ac = this.aa5.ba(); let ad = this.aa5.af(); if (!this.abe && y && (ac != 0 || ad)) { { this.abe = true; } } if (ad) { if (this.aa5.x()) { this.abe = true; } } if (this.abe && (ac != 0 || ad || this.abc)) { this.abc = false; this.abe = false; this.acf = 0x7FFFFFFF; if (this.ac8 != null) { let ae = true; for (let af = 0; af < this.dc.series.count; af++) { let ag = this.dc.series._inner[af]; if (ag.eu && typeCast(CalloutLayer.$, ag) !== null) { let ah = ag; if (ah.ac8 == this.ac8) { if (!ah.af9.equals1(this.aa5.b0)) { ae = false; break; } } } } if (ae) { this.aa5.bv(); } else { this.aa5.bf(); this.aa5.bg(); } } else { this.aa5.bv(); } } else { this.aa5.bg(); } let ai = this.abx.c; let aj; let ak; let al; let am; let an; let ao; let ap; let aq; let ar; let as; let at; let au; let av; let aw; let ax; let ay; let az = this.abl; let a0 = this.abn; let a1 = this.cw.b5(); while (ai != null) { let a2 = ai.c; let a3 = a2.b; aj = a3.bm; ak = a3.bp; al = a3.bo; am = a3.backgroundPadding.left; an = a3.backgroundPadding.top; ao = a3.backgroundPadding.right; ap = a3.backgroundPadding.bottom; ar = a3.backgroundCornerRadius; aq = a3.y; as = a3.bq; at = a3.ao; au = a3.aa; let a4 = a2.c; av = a4.s - (a4.k - a4.p); aw = a4.t - (a4.l - a4.o); ax = a4.k - a4.p; ay = a4.l - a4.o; let a5 = false; if (a0) { if (a4.c != null && this.aa5.ab(a4.c)) { a5 = true; } } if (a2.c.h && !a5) { av = NaN; aw = NaN; } if (!a2.c.h && (a2.c.b == 8 || a2.c.b == 9)) { al = a1; av = a4.k; aw = a4.l; } if (a5) { at = this.adx(a2, at); let a6 = this.aa5.as(a2.c.c); if (a6 > 0) { ax += a6; av -= a6; } } if (az) { let a7 = new CalloutRenderStyleUpdatingEventArgs(); a7.background = aj; a7.outline = ak; a7.leaderBrush = al; a7.strokeThickness = aq; a7.textColor = as; a7.item = au; a7.series = a3.l; a7.actualPosition = a4.b; a7.xValue = a3.ac; a7.yValue = a3.ad; if (this.calloutRenderStyleUpdating != null) { this.calloutRenderStyleUpdating(this, a7); aj = a7.background; ak = a7.outline; al = a7.leaderBrush; aq = a7.strokeThickness; as = a7.textColor; } } a.n.add1(a2); a.f.add(aj); a.i.add(ak); a.h.add(al); a.k.add(am); a.m.add(an); a.l.add(ao); a.j.add(ap); a.g.add(ar); a.o.add(aq); a.p.add(as); a.q.add1(at); a.r.add1(au); a.u.add(av); a.v.add(aw); a.s.add(ax); a.t.add(ay); ai = ai.a; } } adx(a, b) { let c = Math.max(this.aa5.as(a.c.c), this.aa5.at(a.c.c)); if (c <= 0) { return b; } let d = b.length; let e = this.aal.c7(b, a.b.backgroundPadding); let f = e.width; let g = f - c; while (f - g > 0.0001 && d > 0) { d--; b = b.substr(0, d) + "…"; e = this.aal.c7(b, a.b.backgroundPadding); f = e.width; } return b; } aef() { if (this.aa5 != null) { let a = this.abx.c; while (a != null) { let b = a.c.c; if (b != null) { this.aa5.br(b); } a = a.a; } let c = this.aa5; c.labelsMoved = delegateRemove(c.labelsMoved, runOn(this, this.aec)); this.aa5 = null; } this.aee(); } aa6() { if (this.dc == null) { return null; } for (let a = 0; a < this.dc.series.count; a++) { let b = this.dc.series._inner[a]; if (b.eu && typeCast(CalloutLayer.$, b) !== null) { let c = b; if (c != this) { if (c.ac8 != null && c.ac8 == this.ac8) { if (c.aa5 != null) { return c.aa5; } } } } } return null; } aci() { return 20000; } acj() { return 300; } aa7() { switch (this.aai) { 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; } aec(a) { let b = this.aa5.ba(); let c = this.acf; if (b < this.acf) { this.acf = b; if (c != 0x7FFFFFFF) { this.ru(false); } } } aa8(a) { let b = this.aas; if (a.b.l != null) { b = a.b.l; } if (b == null) { for (let c = 0; c < this.dc.series.count; c++) { let d = this.dc.series._inner[c]; if (!d.eu) { b = d; break; } } } if (b == null) { return null; } let e = b.ai(); let f = b.iz(); let g = null; let h = null; let i = false; for (let j = 0; j < e.length; j++) { if (e[j] == null) { continue; } if (e[j].b9) { i = true; g = e[j]; } else if (e[j].cm) { i = true; h = e[j]; } else if (e[j].cp) { h = e[j]; } else { g = e[j]; } } if (g == null || h == null) { return null; } if (!g.co() || !h.co()) { return null; } let k = 0; let l = 0; if (g.cb && g.categoryMode != 0) { if (b.e8) { k = b.getOffsetValue(); } else if (b.e0) { k = b.getOffsetValue(); } } if (h.cb && h.categoryMode != 0) { if (b.e0) { l = b.getOffsetValue(); } } let m = new ScalerParams(0, this.dc.wh, g.kh, g.ch, g.kc()); m.b = f; let n = new ScalerParams(0, this.dc.wh, h.kh, h.ch, h.kc()); n.b = f; let o = 0; let p = 0; if (i) { o = g.el(this.ace(a.b.ac), m) + k; p = h.el(this.ace(a.b.ad), n) + l; let q = o; let r = p; let s = { $type: Point_$type, x: 0.5, y: 0.5 }; let t = s.x + (r * Math.cos(q)); o = ViewportUtils.e(t, m.e, m.d, m.c); let u = s.y + (r * Math.sin(q)); p = ViewportUtils.i(u, n.e, n.d, n.c); } else { o = g.el(this.ace(a.b.ac), m) + k; p = h.el(this.ace(a.b.ad), n) + l; } let v = new QuadTreeBoundingBox(); v.d = o; v.e = p; v.g = 3; v.f = 3; v.i = a.b; return v; } ace(a) { if (typeCast(Date_$type, a) !== null) { return a.getTime(); } if (a == null) { return 0; } return a; } ab1() { let a = new List$1(CalloutAnnotationWrapper.$, 0); for (let b = 0; b < this.ab0.count; b++) { if (stringIsNullOrEmpty(this.ab0._inner[b].b.ao)) { continue; } if (this.ab0._inner[b].c == null) { let c = new LabelCollisionInfo(); this.ab0._inner[b].c = c; let d = this.aal.c7(this.ack(this.ab0._inner[b]), this.ab0._inner[b].b.backgroundPadding); c.o = d.height / 2; c.p = d.width / 2; } let e = this.aa8(this.ab0._inner[b]); if (e == null || e.d < this.wx.left || e.d > this.wx.right || e.e < this.wx.top || e.e > this.wx.bottom) { continue; } a.add(this.ab0._inner[b]); } return a; } ack(a) { return a.b.ao; } xn(a) { if (!super.xn(a)) { return false; } if (this.ads != null) { if (a.isFragment) { let b = a.ne(); if (!Base.equalsStatic(this.ads, b)) { return false; } } else { if (!Base.equalsStatic(this.ads, a.name)) { return false; } } } return true; } qr() { super.qr(); if (!this.a1.c && !this.d4()) { return; } if (this.aba) { this.aba = false; this.aem(); this.aeh(); } if (this.d4()) { this.aep(this.xi, false); } else { this.aep(this.xg, false); } } aei() { if (!this.abd) { this.abd = true; this.ru(true); } } ael(a, b, c) { let d = false; if (this.abd) { this.abd = false; d = true; } a.kj = this.aad; if (!a.gj && a.ed(this.aby, this.abt, this.abp, this.acg, false)) { let e = this.aby; for (let f = 0; f < this.aby.count; f++) { let g = e._inner[f]; let h = g.b != null ? g.b.item : null; let i = g.b.item != null ? g.b.item : g.b; let j = g.g; let k = a; let l = new CalloutKey(i, k); let m = new CalloutAnnotationWrapper(); let n = new CalloutAnnotation(); m.b = n; n.key = l; let o = false; if (this.abu.containsKey(m)) { m = this.abu.item(m).c; n = m.b; o = d; } else { o = true; } let p = n.ac; let q = n.ad; if (this.ace(p) != this.ace(g.d) && (!isNaN_(this.ace(p)) || !isNaN_(this.ace(g.d)))) { n.xValue = g.d; } if (this.ace(q) != this.ace(g.e) && (!isNaN_(this.ace(q)) || !isNaN_(this.ace(g.e)))) { n.yValue = g.e; } n.itemColor = j; n.series = a; let r = false; if (g.f != n.az) { n.az = g.f; r = true; } if (o || r) { if (this.calloutLabelUpdating != null) { let s = ((() => { let $ret = new CalloutLabelUpdatingEventArgs(); $ret.d = n.ac; $ret.e = n.ad; $ret.item = h; $ret.a = a; $ret.f = a.name; return $ret; })()); this.calloutLabelUpdating(this, s); if (s.c != null && !Base.equalsStatic(s.c, m.b.ao)) { let t = s.c; if (this.aad != null) { m.b.text = this.aad.i(t); } else { m.b.text = t != null ? t.toString() : ""; } } } else { if (g.f != null) { n.text = g.f; } } } if (n.ao == null) { continue; } if (o || r) { if (this.calloutContentUpdating != null) { let u = ((() => { let $ret = new CalloutContentUpdatingEventArgs(); $ret.c = n.ac; $ret.d = n.ad; $ret.item = h; $ret.a = i; return $ret; })()); this.calloutContentUpdating(this, u); if (u.a != null && u.a != m.b.aa) { m.b.content = u.a; } } else { if (i != null && i != m.b.aa) { m.b.content = i; } } } if (o) { this.aer(m); } if (m.c == null) { let v = new LabelCollisionInfo(); m.c = v; let w = this.aal.c7(this.ack(m), m.b.backgroundPadding); v.o = w.height / 2; v.p = w.width / 2; } let x = this.aa8(m); if (x == null || x.d < this.wx.left || x.d > this.wx.right || x.e < this.wx.top || x.e > this.wx.bottom) { continue; } m.e = x.d; m.f = x.e; if (g.a != null) { m.c.a = g.a; } c.add(m); } } a.kj = null; } b3() { return 1; } a2(a, b) { let c = this.aa5.i(a, b); if (c == null) { return null; } return c.y; } gx(a, b) { if (this.aa5 == null) { return false; } return this.aa5.i(a, b) != null; } aep(a, b) { let c = 0; let d = new HashSet$1(CalloutAnnotationWrapper.$, 0); for (c = 0; c < a.q.count; c++) { let e = a.n._inner[c]; if (isNaN_(a.u._inner[c]) || isNaN_(a.v._inner[c])) { continue; } let f = this.aal.cr.item(e); d.add_1(e); if (f.h != a.q._inner[c]) { f.h = a.q._inner[c]; let g = f.u(); } f.e = a.o._inner[c]; f.m = a.f._inner[c]; f.p = a.p._inner[c]; f.o =