UNPKG

igniteui-react-charts

Version:

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

1,117 lines (1,116 loc) 41.5 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 { DataAnnotationAxisLayer } from "./DataAnnotationAxisLayer"; import { DependencyProperty } from "igniteui-react-core"; import { OverlayTextLocation_$type } from "./OverlayTextLocation"; import { Brush } from "igniteui-react-core"; import { enumGetBox, Number_$type, typeCast, fromEnum, Point_$type, markType, markDep, getInstanceType, runOn } from "igniteui-react-core"; import { AnnotationAppearanceMode_$type } from "./AnnotationAppearanceMode"; import { OverlayTextUtil } from "./OverlayTextUtil"; import { OverlayTextUpdatingEventArgs } from "./OverlayTextUpdatingEventArgs"; import { DataAnnotationItem } from "./DataAnnotationItem"; import { DataAnnotationInfo } from "./DataAnnotationInfo"; import { DataAnnotationShapeLayerFrame } from "./DataAnnotationShapeLayerFrame"; import { Dictionary$2 } from "igniteui-react-core"; import { Axis } from "./Axis"; import { Pool$1 } from "igniteui-react-core"; import { AxisAnnotation } from "./AxisAnnotation"; import { IFastItemsSource_$type } from "igniteui-react-core"; import { List$1 } from "igniteui-react-core"; import { ScalerParams } from "./ScalerParams"; import { Defaults } from "./Defaults"; import { DataAnnotationShapeFrameManager } from "./DataAnnotationShapeFrameManager"; import { XamDataChart } from "./XamDataChart"; import { CategoryAxisBase } from "./CategoryAxisBase"; import { Size } from "igniteui-react-core"; import { BrushUtil } from "igniteui-react-core"; import { TextBlock } from "igniteui-react-core"; import { Rectangle } from "igniteui-react-core"; import { Extensions } from "igniteui-react-core"; import { NumberFormatSpecifier } from "igniteui-react-core"; import { BindingFormatter } from "igniteui-react-core"; import { Path } from "igniteui-react-core"; import { Tuple$2 } from "igniteui-react-core"; import { PathFigure } from "igniteui-react-core"; import { PathGeometry } from "igniteui-react-core"; import { LineSegment } from "igniteui-react-core"; import { OverlayTextInfo } from "./OverlayTextInfo"; import { DoubleCollection } from "igniteui-react-core"; import { DeviceUtils } from "igniteui-react-core"; import { PropertyMetadata } from "igniteui-react-core"; import { truncate, isNaN_, log10, isInfinity } from "igniteui-react-core"; import { stringIsNullOrEmpty } from "igniteui-react-core"; import { round10N } from "igniteui-react-core"; import { AnnotationLayerView } from "./AnnotationLayerView"; import { TranslateTransform } from "igniteui-react-core"; import { LineGeometry } from "igniteui-react-core"; /** * @hidden */ export let DataAnnotationShapeLayer = /*@__PURE__*/ (() => { class DataAnnotationShapeLayer extends DataAnnotationAxisLayer { get_ac0() { return true; } get ac0() { return this.get_ac0(); } get acq() { return this.acp; } set acq(a) { if (this.acp != a) { let b = this.acp; this.acp = a; this.raisePropertyChanged("OverlayTextColumn", b, this.acp); } } get aco() { return this.acn; } set aco(a) { let b = this.acn; if (OverlayTextUtil.q(a)) { a = OverlayTextUtil.c(); } this.acn = a; if (b != this.acn) { this.raisePropertyChanged("OverlayTextStyle", b, this.acn); } } rh(a, b, c, d) { if (b == "CrosshairPoint") { return; } super.rh(a, b, c, d); switch (b) { case "SeriesViewer": if (d == null) { if (this.ac1 != null && this.ac1.count > 0) { let e; if (this.d4()) { e = this.xo; } else { e = this.xm; } e.a3(); this.aeq(e, true, true); } } break; case DataAnnotationShapeLayer.$$p[0]: case "AreaFillOpacity": this.rz(true); break; case DataAnnotationShapeLayer.$$p[1]: case "OverlayTextColumn": case DataAnnotationShapeLayer.$$p[24]: case DataAnnotationShapeLayer.$$p[19]: case DataAnnotationShapeLayer.$$p[2]: case DataAnnotationShapeLayer.$$p[13]: case DataAnnotationShapeLayer.$$p[14]: case DataAnnotationShapeLayer.$$p[16]: case DataAnnotationShapeLayer.$$p[15]: case DataAnnotationShapeLayer.$$p[3]: case DataAnnotationShapeLayer.$$p[4]: case DataAnnotationShapeLayer.$$p[6]: case DataAnnotationShapeLayer.$$p[5]: case DataAnnotationShapeLayer.$$p[8]: case DataAnnotationShapeLayer.$$p[9]: case DataAnnotationShapeLayer.$$p[11]: case DataAnnotationShapeLayer.$$p[7]: case DataAnnotationShapeLayer.$$p[10]: case DataAnnotationShapeLayer.$$p[12]: case DataAnnotationShapeLayer.$$p[17]: case DataAnnotationShapeLayer.$$p[18]: case DataAnnotationShapeLayer.$$p[23]: case DataAnnotationShapeLayer.$$p[22]: this.abk(); break; case "FastItemsSource": this.aen(c, d); this.abk(); break; case DataAnnotationShapeLayer.$$p[21]: case DataAnnotationShapeLayer.$$p[20]: if (this.dp != null) { this.dp.deregisterColumn(this.acq); this.acq = this.dn(this.aeb); } break; } } acu(a) { return !stringIsNullOrEmpty(a); } dl(a) { if (this.dp == null) { return null; } if (!this.acu(a)) { return null; } return super.dl(a); } dn(a) { if (this.dp == null) { return null; } if (!this.acu(a)) { return null; } return super.dn(a); } aej(a) { if (this.dp != null) { this.dp.deregisterColumn(a); } } aen(a, b) { this.ac3.clear(); if (typeCast(IFastItemsSource_$type, a) != null) { a.deregisterColumn(this.acq); this.acq = null; } if (typeCast(IFastItemsSource_$type, b) != null) { this.acq = this.dn(this.aeb); } } ph(a, b, c, d) { super.ph(a, b, c, d); switch (a) { case 3: this.ael(b); break; case 1: for (let e = b; e < b + c; e++) { let f = new DataAnnotationItem(); this.ac3.insert(e, f); this.ael(e); } break; case 0: this.ac3.v(b, c); break; case 2: for (let g = b; g < b + c; g++) { this.ael(g); } break; case 4: this.aek(); break; } this.rz(true); } constructor() { super(); this.stylingOverlayText = null; this.stylingShapeAnnotation = null; this.stylingAxisAnnotation = null; this.acp = null; this.acn = null; this.ac2 = null; this.ac1 = null; this.ac3 = new List$1(DataAnnotationItem.$, 0); this.afk = null; this.adl = 0; this.acs = false; this.ace = null; this.acf = null; this.acl = null; this.acm = null; let a = new DataAnnotationShapeLayerFrame(); let b = new DataAnnotationShapeLayerFrame(); let c = new DataAnnotationShapeLayerFrame(); let d = this.kh / 1000; this.xn = a; this.xm = b; this.xo = c; this.ab = DataAnnotationShapeLayer.$; } ct() { return new DataAnnotationShapeLayerView(this); } q8(a) { super.q8(a); this.ach = a; } aem() { this.jt = Defaults.dataAnnotationShapeThickness; this.im = Defaults.dataAnnotationShapeThickness; this.ig = Defaults.dataAnnotationShapeThickness; this.il = Defaults.dataAnnotationShapeFillOpacity; this.aav = Defaults.dataAnnotationLabelThickness; this.acn = OverlayTextUtil.c(); } qw() { super.qw(); if (!this.a1.c && !this.d4()) { return; } if (this.aam) { this.aam = false; this.aek(); } if (this.d4()) { this.aer(this.xo, false); } else { this.aer(this.xm, false); } } aek() { this.ac3.clear(); if (this.dp == null || this.dp.count == 0) { return; } for (let a = 0; a < this.dp.count; a++) { let b = new DataAnnotationItem(); this.ac3.add(b); this.ael(a); } } ael(a) { } aer(a, b) { let c = false; if (this.ac1 == null) { c = true; this.ac2 = new List$1(Axis.$, 0); this.ac1 = new Dictionary$2(Axis.$, Pool$1.$.specialize(AxisAnnotation.$), 0); } this.aeq(a, c, b); } aeq(a, b, c) { DataAnnotationShapeFrameManager.c(this, a, b, this.ac1, this.ac2, c, this.aay, this.aax); } y4(a, b) { super.y4(a, b); let c = a; let d = true; c.a3(); this.adl = 0; if (this.aaj != null) { if (this.aar(this.aaj)) { this.aep(this.aaj, c, d); } } else { if (typeCast(XamDataChart.$, this.dc) !== null) { let e = this.dc; let f = true; for (let g of fromEnum(e.axes)) { if (!this.aar(g)) { continue; } if (!g.dh) { f = false; } } for (let h of fromEnum(e.axes)) { if (!this.aar(h)) { continue; } if (this.aal == 0) { if (typeCast(CategoryAxisBase.$, h) !== null) { this.aep(h, c, d); } else if (h.dh && !h.dq && f) { this.aep(h, c, d); } } else if (this.aal == 1 && (h.c8 || h.dc)) { this.aep(h, c, d); } else if (this.aal == 4 && h.c8) { this.aep(h, c, d); } else if (this.aal == 5 && h.dc) { this.aep(h, c, d); } else if (this.aal == 6 && h.dh && !h.dq) { this.aep(h, c, d); } else if (this.aal == 7 && h.dh && h.dq) { this.aep(h, c, d); } else if (this.aal == 3 && h.dq) { this.aep(h, c, d); } else if (this.aal == 2 && !h.dq) { this.aep(h, c, d); } } } } } aep(a, b, c) { this.ace = null; this.acf = null; this.acl = null; this.acm = null; let d = this.getEffectiveViewport(); let e = this.dc.xn; if (a.dq) { this.acf = a; if (this.acf.am != null) { this.ace = this.acf.am; } else { this.ace = this.acd(a); } this.acs = false; } else { this.ace = a; if (this.ace.am != null) { this.acf = this.ace.am; } else { this.acf = this.acd(a); } this.acs = true; } if (this.ace == null) { return; } if (this.acf == null) { return; } this.acm = new ScalerParams(1, e, this.acf.n1, this.acf.df); this.acl = new ScalerParams(1, e, this.ace.n1, this.ace.df); this.acl.c = d; this.acm.c = d; let f = this.ig; let g = this.zz(); if (g == null) { g = BrushUtil.j(255, 0, 0, 0); } let h = this.ac0 ? this.z0() : g; if (h == null) { h = BrushUtil.j(255, 0, 0, 0); } g = OverlayTextUtil.ah(g, this.xy, this.w9); h = OverlayTextUtil.ah(h, this.xy, this.w9); let i = this.acs; this.aek(); this.ach.cu(); this.aeo(); let j = this.aco; let k = OverlayTextUtil.o(j, this.acz); let l = this.acj; if (l == 18) { k = false; } if (k) { this.ach.cq.count = this.ac3.count; this.ach.cp.count = this.ac3.count; } for (let m = 0; m < this.ac3.count; m++) { let n = this.ac3._inner[m]; n.dataIndex = m; n.shapeBrush = n.shapeBrush != null ? n.shapeBrush : g; n.shapeOutline = n.shapeOutline != null ? n.shapeOutline : h; if (this.ac0) { n.shapeBrush = BrushUtil.s(n.shapeBrush, this.il); } n.shapeThickness = !isNaN_(n.shapeThickness) ? n.shapeThickness : f; n.h = 1.7976931348623157E+308; n.f = 1.7976931348623157E+308; n.g = -1.7976931348623157E+308; n.d = -1.7976931348623157E+308; let o = new List$1(Point_$type, 0); for (let p = 0; p < n.c.count; p++) { let q = n.c._inner[p]; let r = this.afn(q.y, false); o.add(r); let s = this.afn(q.y, true); n.h = Math.min(s.y, n.h); n.d = Math.max(s.y, n.d); n.f = Math.min(s.x, n.f); n.g = Math.max(s.x, n.g); } let t = new List$1(DataAnnotationInfo.$, 0); t = new List$1(DataAnnotationInfo.$, 0); t.o(n.c); t.o(n.b); if (this.stylingShapeAnnotation != null) { this.stylingShapeAnnotation(this, n); } b.ay.add(o); b.aw.add(n.a); b.av.add(n.shapeBrush); b.ax.add(n.shapeOutline); b.az.add(n.shapeThickness); b.a0.add(this.acr); let u = this.ab6; if (u == null) { u = this.aan ? g : Defaults.dataAnnotationLabelBackground; } let v = this.ab7; if (v == null) { v = this.aao ? h : Defaults.dataAnnotationLabelBorderStroke; } let w = this.ac0 ? n.shapeOutline : n.shapeBrush; let x = this.ab8; if (x == null) { x = this.aaq ? w : this.ab8; } let y = OverlayTextUtil.t(this.aav, Defaults.dataAnnotationLabelBorderThickness); let z = OverlayTextUtil.t(this.aat, Defaults.dataAnnotationLabelBorderRadius); for (let aa of fromEnum(t)) { if (aa.borderColor == null) { aa.borderColor = v; } if (aa.background == null) { aa.background = u; } if (aa.textColor == null) { aa.textColor = x; } aa.borderColor = OverlayTextUtil.ah(aa.borderColor, this.aau, this.aah); aa.background = OverlayTextUtil.ah(aa.background, this.aas, this.aag); aa.textColor = OverlayTextUtil.af(aa.background, aa.textColor, this.aaw, this.aai); if (isNaN_(aa.borderThickness)) { aa.borderThickness = y; } if (isNaN_(aa.borderRadius)) { aa.borderRadius = z; } let ab = this.afn(aa.y, false); aa.xAxisPixel = ab.x; aa.yAxisPixel = ab.y; aa.xAxisWindow = this.adj(ab.x); aa.yAxisWindow = this.adk(ab.y); aa.xAxisValue = aa.c ? this.ace.fw(ab.x, this.acl) : NaN; aa.yAxisValue = aa.d ? this.acf.fw(ab.y, this.acm) : NaN; aa.xAxisLabel = this.adn(this.ace, aa, true); aa.yAxisLabel = this.adn(this.acf, aa, false); aa.dataIndex = n.dataIndex; if (this.stylingAxisAnnotation != null) { this.stylingAxisAnnotation(this, aa); } } if (this.aap) { for (let ac = 0; ac < t.count; ac++) { let ad = t._inner[ac]; let ae = !stringIsNullOrEmpty(ad.xAxisLabel); let af = !stringIsNullOrEmpty(ad.yAxisLabel); DataAnnotationShapeFrameManager.b(b, ad.xAxisValue, ad.yAxisValue, ad.xAxisLabel, ad.yAxisLabel, ad.textColor, ad.background, ad.borderColor, ad.borderThickness, ad.borderRadius, this.ab9, ae, af, this.ace, this.acf, this.acl, this.acm); } } let ag = this.adr; if (stringIsNullOrEmpty(ag)) { ag = this.adp(m, this.acq); } let ah = new Size(1, 0, 0); let ai = { $type: Point_$type, x: NaN, y: NaN }; let aj = this.afj; if (aj == null && this.acy) { aj = g; } let ak = this.afh; if (ak == null && this.acw) { ak = g; } let al = this.afi; if (al == null && this.acx) { al = g; } let am = new OverlayTextUpdatingEventArgs(); am.dataIndex = m; am.backgroundMode = this.aca; am.backgroundShift = this.ada; am.background = ak; am.borderMode = this.acb; am.borderShift = this.adc; am.borderStroke = al; am.borderRadius = this.adb; am.borderThickness = this.add; am.textLocation = this.acj; am.textAngle = this.ac9; am.textVisible = this.acz; am.textContent = ag; am.textColorMode = this.acc; am.textColorShift = this.ade; am.textColor = aj; am.shapeBrush = g; am.shapeOutline = h; am.f = !i; am.horizontalMargin = this.adf; am.verticalPadding = this.adi; am.verticalMargin = this.adh; am.horizontalPadding = this.adg; if (this.stylingOverlayText != null && k) { this.stylingOverlayText(this, am); } OverlayTextUtil.ad(am); if (k && !am.textEmpty && am.textVisible) { ah = this.cw.cc(am.textContent, j); ai = OverlayTextUtil.ak(am.textLocation, ah, am.textAngle, am.horizontalMargin, am.verticalMargin, am.horizontalPadding, am.verticalPadding, n.ac, i); } else { am.textVisible = false; } if (!Extensions.a(ai)) { am.textVisible = false; } b.aj.add(am.borderThickness); b.ah.add(am.borderStroke); b.ai.add(am.borderRadius); b.ag.add(am.background); b.ar.add(ah); b.am.add(j); b.ak.add(am.textColor); b.af.add(am.textAngle); b.al.add(am.textContent); b.ao.add(am.horizontalPadding); b.at.add(am.verticalPadding); b.an.add(am.horizontalMargin); b.as.add(am.verticalMargin); b.au.add(am.textVisible); b.ap.add(ai.x); b.aq.add(ai.y); } } aeo() { if (OverlayTextUtil.q(this.acn)) { this.acn = OverlayTextUtil.c(); } else if (OverlayTextUtil.k(this.acn)) { this.acn = this.cw.l(this.acn.fontString); } } ado(a, b, c, d) { if (isNaN_(b)) { return null; } if (c >= 0) { let e = new NumberFormatSpecifier(); e.minimumFractionDigits = c; e.maximumFractionDigits = d > 0 ? d : c; let f = new BindingFormatter(); f.j = "{0}"; f.d = [e]; return f.i(b); } let g = 0; if (d >= 0) { g = d; } else if (a.dh) { let h = a.f5(); g = h == 0 ? 0 : truncate(Math.max(-Math.floor(log10(h)), 0)); g += 1; } return round10N(b, g).toString(); } adn(a, b, c) { let d = c ? b.dataValueX : b.dataValueY; let e = c ? b.dataLabelX : b.dataLabelY; let f = c ? b.xAxisValue : b.yAxisValue; let g = c ? b.xAxisPixel : b.yAxisPixel; let h = c ? b.xAxisWindow : b.yAxisWindow; let i = c ? b.a : b.b; if (i == 6) { return null; } if (this.aak != 0 && i == 0) { i = this.aak; } if (i == 0) { if (!stringIsNullOrEmpty(e)) { return e; } else if (!isNaN_(d)) { return this.ado(a, d, this.aay, this.aax); } } else if (i == 1) { return this.ado(a, d, this.aay, this.aax); } else if (i == 2) { if (stringIsNullOrEmpty(e)) { return null; } else { return e; } } else if (i == 4) { let j = this.aay; if (j < 0) { j = 0; } let k = this.aay; if (k < 0) { k = 0; } return this.ado(a, g, j, k); } else if (i == 5) { let l = this.aay; if (l < 0) { l = 2; } let m = this.aay; if (m < 0) { m = 2; } return this.ado(a, h, l, m); } else if (i == 3) { if (a.dh) { return this.ado(a, f, this.aay, this.aax); } else { return a.ih(d); } } return null; } y7(a, b) { super.y7(a, b); let c = this.ach.co; let d = a; let e = d.ay.count; let f = 0; let g = b.b9.top; let h = b.b9.left; let i = b.b9.right; let j = b.b9.bottom; let k = Math.min(h, i); let l = Math.min(g, j); let m = Math.max(h, i); let n = Math.max(g, j); let o = m - k; let p = n - l; for (let q = 0; q < e; q++) { if (!d.a0._inner[q]) { continue; } let r = null; let s = this.aei(c, f, q, d); r = s.c; f = s.d; let t = true; let u = new List$1(PathFigure.$, 0); let v = null; for (let w of fromEnum(d.ay._inner[q])) { if (!Extensions.a(w)) { t = true; if (v != null && v._segments.count > 0) { u.add(v); } continue; } if (t) { t = false; v = new PathFigure(); v._startPoint = w; } else { let x = ((() => { let $ret = new LineSegment(1); $ret.c = w; return $ret; })()); v._segments.add(x); } } if (v != null && v._segments.count > 0) { u.add(v); } let y = new PathGeometry(); for (let z of fromEnum(u)) { z._isClosed = d.aw._inner[q]; y.c.add(z); } r.an = y; if (d.au._inner[q]) { this.ach.cq.item(q)._visibility = 0; this.ach.cp.item(q)._visibility = 0; } else { this.ach.cq.item(q)._visibility = 1; this.ach.cp.item(q)._visibility = 1; } if (d.au._inner[q]) { let aa = new OverlayTextInfo(); aa.background = d.ag._inner[q]; aa.textColor = d.ak._inner[q]; aa.verticalPadding = d.at._inner[q]; aa.horizontalPadding = d.ao._inner[q]; aa.horizontalMargin = d.an._inner[q]; aa.verticalMargin = d.as._inner[q]; aa.borderThickness = d.aj._inner[q]; aa.borderStroke = d.ah._inner[q]; aa.borderRadius = d.ai._inner[q]; aa.textLocation = this.acj; aa.textAngle = d.af._inner[q]; aa.textVisible = d.au._inner[q]; aa.textContent = d.al._inner[q]; aa.f = d.am._inner[q]; aa.ad = d.ar._inner[q]; aa.u = this.ach.cq.item(q); aa.ac = this.ach.cp.item(q); let ab = d.ap._inner[q]; let ac = d.aq._inner[q]; aa.aa = { $type: Point_$type, x: ab, y: ac }; OverlayTextUtil.y(aa.ac, aa.background, aa.borderStroke, aa.borderThickness, aa.borderRadius); OverlayTextUtil.z(aa.u, aa.textColor); OverlayTextUtil.x(aa); OverlayTextUtil.w(aa); this.cw.av(aa.u, aa.f); this.cw.aw(aa.u, aa.f); } } c.count = f; if (this.d4()) { this.aer(this.xo, true); } else { this.aer(this.xm, false); } } aei(a, b, c, d) { let e = a.item(b); b++; e.ad = d.az._inner[c]; e._stroke = d.ax._inner[c]; e._fill = d.av._inner[c]; e.ai = this.z1; e.am = this.wg; e.al = this.wf; e.ak = this.wf; e.aj = this.we; e.ac = this.jk; return new Tuple$2(Path.$, Number_$type, e, b); } xd() { return 3; } x0() { return 0.1; } x3() { return -0.4; } x2() { return NaN; } zc() { super.zc(); this.xy = this.x6(); } x6() { if (isNaN_(this.x9)) { switch (this.w9) { case 1: return this.x0(); case 2: return this.x3(); case 4: case 3: return this.x2(); } } return this.x9; } z4() { if (this.afk == null) { this.afk = new DoubleCollection(); this.afk.add(DeviceUtils.g(2)); this.afk.add(DeviceUtils.g(4)); } return this.afk; } adp(a, b) { if (b == null || b.count <= a) { return null; } let c = b.item(a); return c != null ? c.toString() : null; } ac8(a, b) { if (b == null || b.count <= a) { return NaN; } return b.item(a); } afm(a, b) { if (b == null || b.count <= a) { return { $type: Point_$type, x: NaN, y: NaN }; } let c = b.item(a); if (c == null || getInstanceType(c) != Point_$type) { return { $type: Point_$type, x: NaN, y: NaN }; } return b.item(a); } afn(a, b = false) { let c = b ? 1 : 2; let d = b ? 0 : -1; if (this.acv) { let e = a.x; let f = a.y; if (isInfinity(e) && e > 0) { e = c; } if (isInfinity(e) && e < 0) { e = d; } if (isInfinity(f) && f > 0) { f = c; } if (isInfinity(f) && f < 0) { f = d; } return this.dc.xf({ $type: Point_$type, x: e, y: f }); } else { let g = a.x; let h = a.y; let i = false; let j = false; if (isInfinity(g) && g > 0) { g = Math.floor(this.ac6(c)); i = true; } if (isInfinity(g) && g < 0) { g = Math.floor(this.ac6(d)); i = true; } if (isInfinity(h) && h > 0) { h = Math.floor(this.ac7(c)); j = true; } if (isInfinity(h) && h < 0) { h = Math.floor(this.ac7(d)); j = true; } if (!i && !isNaN_(g)) { g = this.ace.ft(g, this.acl); } if (!j && !isNaN_(h)) { h = this.acf.ft(h, this.acm); } return { $type: Point_$type, x: g, y: h }; } } ac4(a) { return this.ace.ft(a, this.acl); } ac5(a) { return this.acf.ft(a, this.acm); } act(a) { if (this.ace == null) { return false; } if (this.acf == null) { return false; } if (this.acl == null) { return false; } if (this.acm == null) { return false; } if (this.dp == null) { return false; } if (a < 0 || a >= this.dp.count) { return false; } if (this.ac3 == null) { return false; } if (a < 0 || a >= this.ac3.count) { return false; } return true; } acd(a) { if (typeCast(XamDataChart.$, this.dc) !== null) { let b = this.dc; for (let c of fromEnum(b.axes)) { if (c.dq && !a.dq) { return c; } if (!c.dq && a.dq) { return c; } } } return null; } afl(a) { return this.dc.xf(a); } ac6(a) { return this.dc.xf({ $type: Point_$type, x: a, y: NaN }).x; } ac7(a) { return this.dc.xf({ $type: Point_$type, x: NaN, y: a }).y; } afo(a) { return this.dc.xh(a); } adj(a) { return this.dc.xh({ $type: Point_$type, x: a, y: NaN }).x; } adk(a) { return this.dc.xh({ $type: Point_$type, x: NaN, y: a }).y; } } DataAnnotationShapeLayer.$t = /*@__PURE__*/ markType(DataAnnotationShapeLayer, 'DataAnnotationShapeLayer', DataAnnotationAxisLayer.$); DataAnnotationShapeLayer.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, DataAnnotationShapeLayer, 'raisePropertyChanged', ['AnnotationShapeVisible:acr:aes', [0, true], 'ItemsUseWorldCoordinates:acv:aet', [0, false], 'OverlayTextAngle:ac9:aeu', [1, NaN], 'OverlayTextBackgroundMatchLayer:acw:aev', [0, false], 'OverlayTextBackgroundMode:aca:aew', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'OverlayTextBackground:afh:aex', [Brush.$, null], 'OverlayTextBackgroundShift:ada:aey', [1, NaN], 'OverlayTextBorderColor:afi:aez', [Brush.$, null], 'OverlayTextBorderMatchLayer:acx:ae0', [0, false], 'OverlayTextBorderMode:acb:ae1', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'OverlayTextBorderRadius:adb:ae2', [1, NaN], 'OverlayTextBorderShift:adc:ae3', [1, NaN], 'OverlayTextBorderThickness:add:ae4', [1, 1], 'OverlayTextColorMatchLayer:acy:ae5', [0, true], 'OverlayTextColorMode:acc:ae6', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'OverlayTextColor:afj:ae7', [Brush.$, null], 'OverlayTextColorShift:ade:ae8', [1, NaN], 'OverlayTextHorizontalMargin:adf:ae9', [1, NaN], 'OverlayTextHorizontalPadding:adg:afa', [1, NaN], 'OverlayTextLocation:acj:afb', [OverlayTextLocation_$type, /*@__PURE__*/ enumGetBox(OverlayTextLocation_$type, 0)], 'OverlayTextMemberPath:aeb:afc', [2, null], 'OverlayText:adr:afd', [2, null], 'OverlayTextVerticalMargin:adh:afe', [1, NaN], 'OverlayTextVerticalPadding:adi:aff', [1, NaN], 'OverlayTextVisible:acz:afg', [0, true]]); return DataAnnotationShapeLayer; })(); /** * @hidden */ export let DataAnnotationShapeLayerView = /*@__PURE__*/ (() => { class DataAnnotationShapeLayerView extends AnnotationLayerView { constructor(a) { super(a); this.cn = null; this.co = null; this.ct = null; this.cs = null; this.cq = null; this.cr = null; this.cp = null; this.cn = a; this.ct = new List$1(Path.$, 0); } a4() { super.a4(); this.co = ((() => { let $ret = new Pool$1(Path.$); $ret.create = runOn(this, this.c6); $ret.activate = runOn(this, this.cv); $ret.disactivate = runOn(this, this.cx); $ret.destroy = runOn(this, this.cw); return $ret; })()); this.cs = new List$1(TextBlock.$, 0); this.cq = ((() => { let $ret = new Pool$1(TextBlock.$); $ret.create = runOn(this, this.c5); $ret.activate = runOn(this, this.c1); $ret.disactivate = runOn(this, this.c3); $ret.destroy = runOn(this, this.c2); return $ret; })()); this.cr = new List$1(Rectangle.$, 0); this.cp = ((() => { let $ret = new Pool$1(Rectangle.$); $ret.create = runOn(this, this.c7); $ret.activate = runOn(this, this.cy); $ret.disactivate = runOn(this, this.c0); $ret.destroy = runOn(this, this.cz); return $ret; })()); this.cn.aem(); } cu() { } c5() { let a = new TextBlock(); this.cs.add(a); return a; } c2(a) { if (this.cs.contains(a)) { this.cs.remove(a); } } c1(a) { a._visibility = 0; a.s = 0; } c3(a) { a._visibility = 1; } c7() { let a = new Rectangle(); this.cr.add(a); return a; } cz(a) { a.dataContext = null; if (this.cr.contains(a)) { this.cr.remove(a); } } cy(a) { a._visibility = 0; } c0(a) { a._visibility = 1; } c6() { let a = new Path(); a.j = new TranslateTransform(); this.ct.add(a); return a; } cv(a) { a._visibility = 0; } cx(a) { a._visibility = 1; } cw(a) { this.ct.remove(a); } c4(a, b, c, d) { if (a.an == null || a.an.c.x != d || a.an.d.x != c) { let e = ((() => { let $ret = new LineGeometry(); $ret.d = { $type: Point_$type, x: c, y: b }; $ret.c = { $type: Point_$type, x: d, y: b }; return $ret; })()); a.an = e; } } bj(a, b) { super.bj(a, b); if (a.d && !b) { for (let c = 0; c < this.ct.count; c++) { let d = this.ct._inner[c]; if (d._visibility == 0) { a.t(d); } } for (let e = 0; e < this.cr.count; e++) { let f = this.cr._inner[e]; if (f._visibility == 0) { a.w(f); } } for (let g = 0; g < this.cs.count; g++) { let h = this.cs._inner[g]; if (h._visibility == 0) { a.ae(h.dataContext); a.x(h); } } } } ax(a) { super.ax(a); for (let b = 0; b < this.ct.count; b++) { this.f.bc.exportPathData(a, this.ct._inner[b], "DataAnnotationPath", ["Main", "DataAnnotation"]); } } } DataAnnotationShapeLayerView.$t = /*@__PURE__*/ markType(DataAnnotationShapeLayerView, 'DataAnnotationShapeLayerView', AnnotationLayerView.$); return DataAnnotationShapeLayerView; })();