UNPKG

igniteui-react-charts

Version:

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

1,263 lines (1,262 loc) 46.2 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 { 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 { 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 { CSSColorUtil } 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 { CategoryAxisBase } from "./CategoryAxisBase"; 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 */ var DataAnnotationShapeLayer = /** @class */ /*@__PURE__*/ (function (_super) { __extends(DataAnnotationShapeLayer, _super); function DataAnnotationShapeLayer() { var _this = _super.call(this) || this; _this.stylingOverlayText = null; _this.stylingShapeAnnotation = null; _this.stylingAxisAnnotation = null; _this.adr = null; _this.adp = null; _this.ado = null; _this.ad5 = null; _this.ad4 = null; _this.ad6 = new List$1(DataAnnotationItem.$, 0); _this.ags = null; _this.aep = 0; _this.adv = false; _this.adf = null; _this.adg = null; _this.adm = null; _this.adn = null; var a = new DataAnnotationShapeLayerFrame(); var b = new DataAnnotationShapeLayerFrame(); var c = new DataAnnotationShapeLayerFrame(); var d = _this.kn / 1000; _this.xy = a; _this.xx = b; _this.xz = c; _this.ab = DataAnnotationShapeLayer.$; return _this; } DataAnnotationShapeLayer.prototype.get_ad3 = function () { return true; }; Object.defineProperty(DataAnnotationShapeLayer.prototype, "ad3", { get: function () { return this.get_ad3(); }, enumerable: false, configurable: true }); Object.defineProperty(DataAnnotationShapeLayer.prototype, "ads", { get: function () { return this.adr; }, set: function (a) { if (this.adr != a) { var b = this.adr; this.adr = a; this.raisePropertyChanged("OverlayTextColumn", b, this.adr); } }, enumerable: false, configurable: true }); Object.defineProperty(DataAnnotationShapeLayer.prototype, "adq", { get: function () { return this.adp; }, set: function (a) { var b = this.adp; if (OverlayTextUtil.q(a)) { a = OverlayTextUtil.c(); } this.adp = a; if (b != this.adp) { this.raisePropertyChanged("OverlayTextStyle", b, this.adp); } }, enumerable: false, configurable: true }); DataAnnotationShapeLayer.prototype.rr = function (a, b, c, d) { if (b == "CrosshairPoint") { return; } _super.prototype.rr.call(this, a, b, c, d); switch (b) { case "SeriesViewer": if (d == null) { if (this.ad4 != null && this.ad4.count > 0) { var e = void 0; if (this.d4()) { e = this.xz; } else { e = this.xx; } e.bp(); this.afv(e, true, true); } } break; case DataAnnotationShapeLayer.$$p[0]: case "AreaFillOpacity": this.r9(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.acb(); break; case "FastItemsSource": this.afs(c, d); this.afp(); this.acb(); break; case DataAnnotationShapeLayer.$$p[21]: case DataAnnotationShapeLayer.$$p[20]: if (this.dp != null) { this.dp.deregisterColumn(this.ads); this.ads = this.dn(this.afg); } break; } }; DataAnnotationShapeLayer.prototype.adx = function (a) { return !stringIsNullOrEmpty(a); }; DataAnnotationShapeLayer.prototype.dl = function (a) { if (this.dp == null) { return null; } if (!this.adx(a)) { return null; } return _super.prototype.dl.call(this, a); }; DataAnnotationShapeLayer.prototype.dn = function (a) { if (this.dp == null) { return null; } if (!this.adx(a)) { return null; } return _super.prototype.dn.call(this, a); }; DataAnnotationShapeLayer.prototype.afo = function (a) { if (this.dp != null) { this.dp.deregisterColumn(a); } }; DataAnnotationShapeLayer.prototype.afs = function (a, b) { this.ad6.clear(); if (typeCast(IFastItemsSource_$type, a) != null) { var c = a; c.deregisterColumn(this.ads); this.ads = null; } if (typeCast(IFastItemsSource_$type, b) != null) { this.ads = this.dn(this.afg); } }; DataAnnotationShapeLayer.prototype.pp = function (a, b, c, d) { _super.prototype.pp.call(this, a, b, c, d); switch (a) { case 3: this.afq(b); break; case 1: for (var e = b; e < b + c; e++) { if (this.ad6.count > e) { var f = new DataAnnotationItem(); this.ad6.insert(e, f); this.afq(e); } } break; case 0: this.ad6.v(b, c); break; case 2: for (var g = b; g < b + c; g++) { this.afq(g); } break; case 4: this.afp(); break; } this.r9(true); }; DataAnnotationShapeLayer.prototype.ct = function () { return new DataAnnotationShapeLayerView(this); }; DataAnnotationShapeLayer.prototype.ri = function (a) { _super.prototype.ri.call(this, a); this.adi = a; }; DataAnnotationShapeLayer.prototype.afr = function () { this.jz = Defaults.dataAnnotationShapeThickness; this.it = Defaults.dataAnnotationShapeThickness; this.im = Defaults.dataAnnotationShapeThickness; this.is = Defaults.dataAnnotationShapeFillOpacity; this.abd = Defaults.dataAnnotationLabelThickness; this.adp = OverlayTextUtil.c(); }; DataAnnotationShapeLayer.prototype.q5 = function () { _super.prototype.q5.call(this); if (!this.a1.c && !this.d4()) { return; } if (this.aaz) { this.aaz = false; this.afp(); } if (this.d4()) { this.afw(this.xz, false); } else { this.afw(this.xx, false); } }; DataAnnotationShapeLayer.prototype.afp = function () { this.ad6.clear(); if (this.dp == null || this.dp.count == 0) { return; } for (var a = 0; a < this.dp.count; a++) { var b = new DataAnnotationItem(); this.ad6.add(b); this.afq(a); } }; DataAnnotationShapeLayer.prototype.afq = function (a) { }; DataAnnotationShapeLayer.prototype.afw = function (a, b) { var c = false; if (this.ad4 == null) { c = true; this.ad5 = new List$1(Axis.$, 0); this.ad4 = new Dictionary$2(Axis.$, Pool$1.$.specialize(AxisAnnotation.$), 0); } this.afv(a, c, b); }; DataAnnotationShapeLayer.prototype.afv = function (a, b, c) { DataAnnotationShapeFrameManager.c(this, a, b, this.ad4, this.ad5, c, this.abg, this.abf); }; DataAnnotationShapeLayer.prototype.zg = function (a, b) { var e_1, _a; _super.prototype.zg.call(this, a, b); var c = a; var d = true; c.bp(); this.adi.cu(); this.aep = 0; if (this.aaw != null) { if (this.aa5(this.aaw)) { this.afu(this.aaw, c, d); } } else { if (typeCast(XamDataChart.$, this.dc) !== null) { var e = this.da.aau(this.aay); try { for (var _b = __values(fromEnum(e)), _c = _b.next(); !_c.done; _c = _b.next()) { var f = _c.value; this.afu(f, 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; } } } } }; DataAnnotationShapeLayer.prototype.aem = function (a) { return isNaN_(this.aec) ? 0 : this.aec; }; DataAnnotationShapeLayer.prototype.afu = function (a, b, c) { var e_2, _a; if (b == null) { return; } if (a == null) { return; } this.adf = null; this.adg = null; this.adm = null; this.adn = null; var d = this.getEffectiveViewport(); var e = this.dc.ys; if (a.dz) { this.adg = a; if (this.adg.an != null) { this.adf = this.adg.an; } else { this.adf = this.ade(a); } this.adv = false; } else { this.adf = a; if (this.adf.an != null) { this.adg = this.adf.an; } else { this.adg = this.ade(a); } this.adv = true; } if (this.adf == null) { return; } if (this.adg == null) { return; } this.adn = new ScalerParams(1, e, this.adg.o8, this.adg.dn); this.adm = new ScalerParams(1, e, this.adf.o8, this.adf.dn); this.adm.c = d; this.adn.c = d; var f = this.im; var g = this.aac(); if (g == null) { g = BrushUtil.l(255, 0, 0, 0); } var h = this.ad3 ? this.aad() : g; if (h == null) { h = BrushUtil.l(255, 0, 0, 0); } g = OverlayTextUtil.ah(g, this.ya, this.xk); h = OverlayTextUtil.ah(h, this.ya, this.xk); var i = this.adv; this.afp(); this.aft(); var j = this.adq; var k = OverlayTextUtil.o(j, this.ad2); var l = this.adk; if (l == 18) { k = false; } if (k) { this.adi.cq.count = this.ad6.count; this.adi.cp.count = this.ad6.count; } for (var m = 0; m < this.ad6.count; m++) { var n = this.ad6._inner[m]; n.dataIndex = m; n.shapeBrush = n.shapeBrush != null ? n.shapeBrush : g; n.shapeOutline = n.shapeOutline != null ? n.shapeOutline : h; if (this.ad3) { n.shapeBrush = BrushUtil.u(n.shapeBrush, this.is); } 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; var o = new List$1(Point_$type, 0); for (var p = 0; p < n.c.count; p++) { var q = n.c._inner[p]; var r = this.agv(q.at, false); o.add(r); var s = this.agv(q.at, 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); } var 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.bk.add(o); b.bi.add(n.a); b.bh.add(n.shapeBrush); b.bj.add(n.shapeOutline); b.bl.add(n.shapeThickness); b.bm.add(this.adt); var u = this.ac5; if (u == null) { u = this.aa0 ? g : Defaults.dataAnnotationLabelBackground; } var v = this.ac8; if (v == null) { v = this.aa2 ? h : Defaults.dataAnnotationLabelBorderStroke; } var w = this.ad3 ? n.shapeOutline : n.shapeBrush; var x = this.ac9; if (x == null) { x = this.aa4 ? w : this.ac9; } var y = OverlayTextUtil.t(this.abd, Defaults.dataAnnotationLabelBorderThickness); var z = OverlayTextUtil.t(this.abb, Defaults.dataAnnotationLabelBorderRadius); try { for (var _b = (e_2 = void 0, __values(fromEnum(t))), _c = _b.next(); !_c.done; _c = _b.next()) { var aa = _c.value; 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.abc, this.aau); aa.background = OverlayTextUtil.ah(aa.background, this.aa6, this.aat); aa.textColor = OverlayTextUtil.af(aa.background, aa.textColor, this.abe, this.aav); if (isNaN_(aa.borderThickness)) { aa.borderThickness = y; } if (isNaN_(aa.borderRadius)) { aa.borderRadius = z; } var ab = this.agv(aa.at, false); aa.xAxisPixel = ab.x; aa.yAxisPixel = ab.y; aa.xAxisWindow = this.aen(ab.x); aa.yAxisWindow = this.aeo(ab.y); aa.xAxisValue = aa.j ? this.adf.ga(ab.x, this.adm) : NaN; aa.yAxisValue = aa.k ? this.adg.ga(ab.y, this.adn) : NaN; var ac = aa.a; var ad = aa.b; aa.xAxisLabel = this.aer(this.adf, aa, true); aa.yAxisLabel = this.aer(this.adg, aa, false); aa.dataIndex = n.dataIndex; aa.isXAxisBadgeEnabled = this.adu(n.dataIndex, false); aa.isYAxisBadgeEnabled = this.adu(n.dataIndex, true); aa.xAxisBadgeBackground = this.agm(n.dataIndex, false, false, aa.background); aa.yAxisBadgeBackground = this.agm(n.dataIndex, false, true, aa.background); aa.xAxisBadgeOutline = this.agm(n.dataIndex, true, false, aa.background); aa.yAxisBadgeOutline = this.agm(n.dataIndex, true, true, aa.background); aa.xAxisBadgeImagePath = this.aet(n.dataIndex, false); aa.yAxisBadgeImagePath = this.aet(n.dataIndex, true); aa.xAxisBadgeOutlineThickness = this.aa9; aa.yAxisBadgeOutlineThickness = this.aa9; aa.xAxisBadgeRadius = this.aa7; aa.yAxisBadgeRadius = this.aa7; aa.xAxisBadgeSize = this.aba; aa.yAxisBadgeSize = this.aba; aa.xAxisBadgeMargin = this.aa8; aa.yAxisBadgeMargin = this.aa8; aa.xAxisUserAnnotation = this.ado; aa.yAxisUserAnnotation = this.ado; if (this.stylingAxisAnnotation != null) { this.stylingAxisAnnotation(this, aa); } if (ac != aa.a) { aa.xAxisLabel = this.aer(this.adf, aa, true); } if (ad != aa.b) { aa.yAxisLabel = this.aer(this.adg, aa, 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 (this.aa3) { for (var ae = 0; ae < t.count; ae++) { var af = t._inner[ae]; var ag = !stringIsNullOrEmpty(af.xAxisLabel); var ah = !stringIsNullOrEmpty(af.yAxisLabel); DataAnnotationShapeFrameManager.b(b, af, this.ada, ag, ah, this.adf, this.adg, this.adm, this.adn); } } var ai = this.aew; if (stringIsNullOrEmpty(ai)) { ai = this.aeu(m, this.ads); } var aj = new Size(1, 0, 0); var ak = { $type: Point_$type, x: NaN, y: NaN }; var al = this.aem(a); var am = this.agr; if (am == null && this.ad1) { am = g; } var an = this.agp; if (an == null && this.adz) { an = g; } var ao = this.agq; if (ao == null && this.ad0) { ao = g; } var ap = new OverlayTextUpdatingEventArgs(); ap.dataIndex = m; ap.backgroundMode = this.adb; ap.backgroundShift = this.aed; ap.background = an; ap.borderMode = this.adc; ap.borderShift = this.aef; ap.borderStroke = ao; ap.borderRadius = this.aee; ap.borderThickness = this.aeg; ap.textLocation = this.adk; ap.textAngle = al; ap.textVisible = this.ad2; ap.textContent = ai; ap.textColorMode = this.add; ap.textColorShift = this.aeh; ap.textColor = am; ap.shapeBrush = g; ap.shapeOutline = h; ap.f = !i; ap.horizontalMargin = this.aei; ap.verticalPadding = this.ael; ap.verticalMargin = this.aek; ap.horizontalPadding = this.aej; if (this.stylingOverlayText != null && k) { this.stylingOverlayText(this, ap); } OverlayTextUtil.ad(ap); if (k && !ap.textEmpty && ap.textVisible) { aj = this.cw.cc(ap.textContent, j); ak = OverlayTextUtil.ak(ap.textLocation, aj, ap.textAngle, ap.horizontalMargin, ap.verticalMargin, ap.horizontalPadding, ap.verticalPadding, n.ac, i); } else { ap.textVisible = false; } if (!Extensions.a(ak)) { ap.textVisible = false; } b.a5.add(ap.borderThickness); b.a3.add(ap.borderStroke); b.a4.add(ap.borderRadius); b.a2.add(ap.background); b.bd.add(aj); b.a8.add(j); b.a6.add(ap.textColor); b.a1.add(ap.textAngle); b.a7.add(ap.textContent); b.ba.add(ap.horizontalPadding); b.bf.add(ap.verticalPadding); b.a9.add(ap.horizontalMargin); b.be.add(ap.verticalMargin); b.bg.add(ap.textVisible); b.bb.add(ak.x); b.bc.add(ak.y); } }; DataAnnotationShapeLayer.prototype.aft = function () { if (OverlayTextUtil.q(this.adp)) { this.adp = OverlayTextUtil.c(); } else if (OverlayTextUtil.k(this.adp)) { this.adp = this.cw.l(this.adp.fontString); } }; DataAnnotationShapeLayer.prototype.aes = function (a, b, c, d) { if (isNaN_(b)) { return null; } if (c >= 0) { var e = new NumberFormatSpecifier(); e.minimumFractionDigits = c; e.maximumFractionDigits = d > 0 ? d : c; var f = new BindingFormatter(); f.j = "{0}"; f.d = [e]; return f.i(b); } var g = 0; if (d >= 0) { g = d; } else if (a.dq) { var h = a.gk(); g = h == 0 ? 0 : truncate(Math.max(-Math.floor(log10(h)), 0)); g += 1; } return round10N(b, g).toString(); }; DataAnnotationShapeLayer.prototype.aer = function (a, b, c) { var d = c ? b.dataValueX : b.dataValueY; var e = c ? b.dataLabelX : b.dataLabelY; var f = c ? b.xAxisValue : b.yAxisValue; var g = c ? b.xAxisPixel : b.yAxisPixel; var h = c ? b.xAxisWindow : b.yAxisWindow; var i = c ? b.a : b.b; if (i == 6) { return null; } if (this.aax != 0 && i == 0) { i = this.aax; } if (i == 0) { if (!stringIsNullOrEmpty(e)) { i = 2; } else if (!isNaN_(f)) { i = 3; } else if (!isNaN_(d)) { i = 1; } } if (i == 1) { return this.aes(a, d, this.abg, this.abf); } else if (i == 2) { if (stringIsNullOrEmpty(e)) { return null; } else { return e; } } else if (i == 4) { var j = this.abg; if (j < 0) { j = 0; } var k = this.abg; if (k < 0) { k = 0; } return this.aes(a, g, j, k); } else if (i == 5) { var l = this.abg; if (l < 0) { l = 2; } var m = this.abg; if (m < 0) { m = 2; } return this.aes(a, h, l, m); } else if (i == 3) { if (a.dq) { return this.aes(a, f, this.abg, this.abf); } else { return a.ja(d); } } return null; }; DataAnnotationShapeLayer.prototype.adu = function (a, b) { return this.aa1; }; DataAnnotationShapeLayer.prototype.agm = function (a, b, c, d) { return this.ac6; }; DataAnnotationShapeLayer.prototype.aet = function (a, b) { return this.abo; }; DataAnnotationShapeLayer.prototype.ago = function (a, b) { if (a == null) { return OverlayTextUtil.ae(b); } return a; }; DataAnnotationShapeLayer.prototype.agn = function (a, b) { if (b == null || b.count <= a) { return null; } var c = b.item(a); if (typeof c === 'string') { return CSSColorUtil.g(c); } if (typeCast(Brush.$, c) !== null) { return c; } return null; }; DataAnnotationShapeLayer.prototype.zj = function (a, b) { var e_3, _a, e_4, _b; _super.prototype.zj.call(this, a, b); var c = this.adi.co; var d = a; var e = d.bk.count; var f = 0; var g = b.b9.top; var h = b.b9.left; var i = b.b9.right; var j = b.b9.bottom; var k = Math.min(h, i); var l = Math.min(g, j); var m = Math.max(h, i); var n = Math.max(g, j); var o = m - k; var p = n - l; for (var q = 0; q < e; q++) { if (d.bm._inner[q]) { var r = null; var s = this.afn(c, f, q, d); r = s.c; f = s.d; var t = true; var u = new List$1(PathFigure.$, 0); var v = null; var _loop_1 = function (w) { if (!Extensions.a(w)) { t = true; if (v != null && v._segments.count > 0) { u.add(v); } return "continue"; } if (t) { t = false; v = new PathFigure(); v._startPoint = w; } else { var x = ((function () { var $ret = new LineSegment(1); $ret.c = w; return $ret; })()); v._segments.add(x); } }; try { for (var _c = (e_3 = void 0, __values(fromEnum(d.bk._inner[q]))), _d = _c.next(); !_d.done; _d = _c.next()) { var w = _d.value; _loop_1(w); } } catch (e_3_1) { e_3 = { error: e_3_1 }; } finally { try { if (_d && !_d.done && (_a = _c.return)) _a.call(_c); } finally { if (e_3) throw e_3.error; } } if (v != null && v._segments.count > 0) { u.add(v); } var y = new PathGeometry(); try { for (var _e = (e_4 = void 0, __values(fromEnum(u))), _f = _e.next(); !_f.done; _f = _e.next()) { var z = _f.value; z._isClosed = d.bi._inner[q]; y.c.add(z); } } catch (e_4_1) { e_4 = { error: e_4_1 }; } finally { try { if (_f && !_f.done && (_b = _e.return)) _b.call(_e); } finally { if (e_4) throw e_4.error; } } r.an = y; } if (d.bg._inner[q]) { this.adi.cq.item(q)._visibility = 0; this.adi.cp.item(q)._visibility = 0; } else { this.adi.cq.item(q)._visibility = 1; this.adi.cp.item(q)._visibility = 1; } if (d.bg._inner[q]) { var aa = new OverlayTextInfo(); aa.background = d.a2._inner[q]; aa.textColor = d.a6._inner[q]; aa.verticalPadding = d.bf._inner[q]; aa.horizontalPadding = d.ba._inner[q]; aa.horizontalMargin = d.a9._inner[q]; aa.verticalMargin = d.be._inner[q]; aa.borderThickness = d.a5._inner[q]; aa.borderStroke = d.a3._inner[q]; aa.borderRadius = d.a4._inner[q]; aa.textLocation = this.adk; aa.textAngle = d.a1._inner[q]; aa.textVisible = d.bg._inner[q]; aa.textContent = d.a7._inner[q]; aa.f = d.a8._inner[q]; aa.ad = d.bd._inner[q]; aa.u = this.adi.cq.item(q); aa.ac = this.adi.cp.item(q); var ab = d.bb._inner[q]; var ac = d.bc._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.afw(this.xz, true); } else { this.afw(this.xx, false); } }; DataAnnotationShapeLayer.prototype.afn = function (a, b, c, d) { var e = a.item(b); b++; e.ad = d.bl._inner[c]; e._stroke = d.bj._inner[c]; e._fill = d.bh._inner[c]; e.ai = this.aae; e.am = this.wq; e.al = this.wp; e.ak = this.wp; e.aj = this.wo; e.ac = this.jq; return new Tuple$2(Path.$, Number_$type, e, b); }; DataAnnotationShapeLayer.prototype.xo = function () { return 3; }; DataAnnotationShapeLayer.prototype.yc = function () { return 0.1; }; DataAnnotationShapeLayer.prototype.yf = function () { return -0.4; }; DataAnnotationShapeLayer.prototype.ye = function () { return NaN; }; DataAnnotationShapeLayer.prototype.zo = function () { _super.prototype.zo.call(this); this.ya = this.yi(); }; DataAnnotationShapeLayer.prototype.yi = function () { if (isNaN_(this.yl)) { switch (this.xk) { case 1: return this.yc(); case 2: return this.yf(); case 4: case 3: return this.ye(); } } return this.yl; }; DataAnnotationShapeLayer.prototype.aah = function () { if (this.ags == null) { this.ags = new DoubleCollection(); this.ags.add(DeviceUtils.g(2)); this.ags.add(DeviceUtils.g(4)); } return this.ags; }; DataAnnotationShapeLayer.prototype.aeu = function (a, b) { if (b == null || b.count <= a) { return null; } var c = b.item(a); return c != null ? c.toString() : null; }; DataAnnotationShapeLayer.prototype.aeb = function (a, b, c) { if (b == null || b.count <= a) { return NaN; } var d = b.item(a); if (c != null && c.df && !c.dj) { var e = typeCast(CategoryAxisBase.$, c); if (e.categoryMode != 0) { var f = 0.5; d += f; } } return d; }; DataAnnotationShapeLayer.prototype.agu = function (a, b) { if (b == null || b.count <= a) { return { $type: Point_$type, x: NaN, y: NaN }; } var c = b.item(a); if (c == null || getInstanceType(c) != Point_$type) { return { $type: Point_$type, x: NaN, y: NaN }; } return b.item(a); }; DataAnnotationShapeLayer.prototype.agv = function (a, b) { if (b === void 0) { b = false; } var c = b ? 1 : 2; var d = b ? 0 : -1; if (this.ady) { var e = a.x; var 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.yk({ $type: Point_$type, x: e, y: f }); } else { var g = a.x; var h = a.y; var i = false; var j = false; if (isInfinity(g) && g > 0) { g = Math.floor(this.ad9(c)); i = true; } if (isInfinity(g) && g < 0) { g = Math.floor(this.ad9(d)); i = true; } if (isInfinity(h) && h > 0) { h = Math.floor(this.aea(c)); j = true; } if (isInfinity(h) && h < 0) { h = Math.floor(this.aea(d)); j = true; } if (!i && !isNaN_(g)) { g = this.adf.f7(g, this.adm); } if (!j && !isNaN_(h)) { h = this.adg.f7(h, this.adn); } return { $type: Point_$type, x: g, y: h }; } }; DataAnnotationShapeLayer.prototype.ad7 = function (a) { return this.adf.f7(a, this.adm); }; DataAnnotationShapeLayer.prototype.ad8 = function (a) { return this.adg.f7(a, this.adn); }; DataAnnotationShapeLayer.prototype.adw = function (a) { if (this.adf == null) { return false; } if (this.adg == null) { return false; } if (this.adm == null) { return false; } if (this.adn == null) { return false; } if (this.dp == null) { return false; } if (a < 0 || a >= this.dp.count) { return false; } if (this.ad6 == null) { return false; } if (a < 0 || a >= this.ad6.count) { return false; } return true; }; DataAnnotationShapeLayer.prototype.ade = function (a) { var e_5, _a; if (typeCast(XamDataChart.$, this.dc) !== null) { var b = this.dc; try { for (var _b = __values(fromEnum(b.zr)), _c = _b.next(); !_c.done; _c = _b.next()) { var c = _c.value; if (c.dz && !a.dz) { return c; } if (!c.dz && a.dz) { return c; } } } catch (e_5_1) { e_5 = { error: e_5_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_5) throw e_5.error; } } } return null; }; DataAnnotationShapeLayer.prototype.agt = function (a) { return this.dc.yk(a); }; DataAnnotationShapeLayer.prototype.ad9 = function (a) { return this.dc.yk({ $type: Point_$type, x: a, y: NaN }).x; }; DataAnnotationShapeLayer.prototype.aea = function (a) { return this.dc.yk({ $type: Point_$type, x: NaN, y: a }).y; }; DataAnnotationShapeLayer.prototype.agw = function (a) { return this.dc.ym(a); }; DataAnnotationShapeLayer.prototype.aen = function (a) { return this.dc.ym({ $type: Point_$type, x: a, y: NaN }).x; }; DataAnnotationShapeLayer.prototype.aeo = function (a) { return this.dc.ym({ $type: Point_$type, x: NaN, y: a }).y; }; DataAnnotationShapeLayer.$t = markType(DataAnnotationShapeLayer, 'DataAnnotationShapeLayer', DataAnnotationAxisLayer.$); DataAnnotationShapeLayer.$$p = markDep(DependencyProperty, PropertyMetadata, DataAnnotationShapeLayer, 'raisePropertyChanged', ['AnnotationShapeVisible:adt:afx', [0, true], 'ItemsUseWorldCoordinates:ady:afy', [0, false], 'OverlayTextAngle:aec:afz', [1, NaN], 'OverlayTextBackgroundMatchLayer:adz:af0', [0, false], 'OverlayTextBackgroundMode:adb:af1', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'OverlayTextBackground:agp:af2', [Brush.$, null], 'OverlayTextBackgroundShift:aed:af3', [1, NaN], 'OverlayTextBorderColor:agq:af4', [Brush.$, null], 'OverlayTextBorderMatchLayer:ad0:af5', [0, false], 'OverlayTextBorderMode:adc:af6', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'OverlayTextBorderRadius:aee:af7', [1, NaN], 'OverlayTextBorderShift:aef:af8', [1, NaN], 'OverlayTextBorderThickness:aeg:af9', [1, 1], 'OverlayTextColorMatchLayer:ad1:aga', [0, true], 'OverlayTextColorMode:add:agb', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'OverlayTextColor:agr:agc', [Brush.$, null], 'OverlayTextColorShift:aeh:agd', [1, NaN], 'OverlayTextHorizontalMargin:aei:age', [1, NaN], 'OverlayTextHorizontalPadding:aej:agf', [1, NaN], 'OverlayTextLocation:adk:agg', [OverlayTextLocation_$type, enumGetBox(OverlayTextLocation_$type, 0)], 'OverlayTextMemberPath:afg:agh', [2, null], 'OverlayText:aew:agi', [2, null], 'OverlayTextVerticalMargin:aek:agj', [1, NaN], 'OverlayTextVerticalPadding:ael:agk', [1, NaN], 'OverlayTextVisible:ad2:agl', [0, true]]); return DataAnnotationShapeLayer; }(DataAnnotationAxisLayer)); export { DataAnnotationShapeLayer }; /** * @hidden */ var DataAnnotationShapeLayerView = /** @class */ /*@__PURE__*/ (function (_super) { __extends(DataAnnotationShapeLayerView, _super); function DataAnnotationShapeLayerView(a) { var _this = _super.call(this, a) || this; _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); return _this; } DataAnnotationShapeLayerView.prototype.a4 = function () { var _this = this; _super.prototype.a4.call(this); this.co = ((function () { var $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 = ((function () { var $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 = ((function () { var $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.afr(); }; DataAnnotationShapeLayerView.prototype.cu = function () { }; DataAnnotationShapeLayerView.prototype.c5 = function () { var a = new TextBlock(); this.cs.add(a); return a; }; DataAnnotationShapeLayerView.prototype.c2 = function (a) { if (this.cs.contains(a)) { this.cs.remove(a); } }; DataAnnotationShapeLayerView.prototype.c1 = function (a) { a._visibility = 0; a.s = 0; }; DataAnnotationShapeLayerView.prototype.c3 = function (a) { a._visibility = 1; }; DataAnnotationShapeLayerView.prototype.c7 = function () { var a = new Rectangle(); this.cr.add(a); return a; }; DataAnnotationShapeLayerView.prototype.cz = function (a) { a.dataContext = null; if (this.cr.contains(a)) { this.cr.remove(a); } }; DataAnnotationShapeLayerView.prototype.cy = function (a) { a._visibility = 0; }; DataAnnotationShapeLayerView.prototype.c0 = function (a) { a._visibility = 1; }; DataAnnotationShapeLayerView.prototype.c6 = function () { var a = new Path(); a.j = new TranslateTransform(); this.ct.add(a); return a; }; DataAnnotationShapeLayerView.prototype.cv = function (a) { a._visibility = 0; }; DataAnnotationShapeLayerView.prototype.cx = function (a) { a._visibility = 1; }; DataAnnotationShapeLayerView.prototype.cw = function (a) { this.ct.remove(a); }; DataAnnotationShapeLayerView.prototype.c4 = function (a, b, c, d) { if (a.an == null || a.an.c.x != d || a.an.d.x != c) { var e = ((function () { var $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; } }; DataAnnotationShapeLayerView.prototype.bj = function (a, b) { _super.prototype.bj.call(this, a, b); if (a.d && !b) { for (var c = 0; c < this.ct.count; c++) { var d = this.ct._inner[c]; if (d._visibility == 0) { a.t(d); } } for (var e = 0; e < this.cr.count; e++) { var f = this.cr._inner[e]; if (f._visibility == 0 && f.width > 0 && f.height > 0) { a.w(f); } } for (var g = 0; g < this.cs.count; g++) { var h = this.cs._inner[g]; if (h._visibility == 0 && h.width > 0 && h.height > 0 && !stringIsNullOrEmpty(h.al)) { a.af(h.dataContext); a.x(h); } } } }; DataAnnotationShapeLayerView.prototype.ax = function (a) { _super.prototype.ax.call(this, a); for (var b = 0; b < this.ct.count; b++) { this.f.bc.exportPathData(a, this.ct._inner[b], "DataAnnotationPath", ["Main", "DataAnnotation"]); } }; DataAnnotationShapeLayerView.$t = markType(DataAnnotationShapeLayerView, 'DataAnnotationShapeLayerView', AnnotationLayerView.$); return DataAnnotationShapeLayerView; }(AnnotationLayerView)); export { DataAnnotationShapeLayerView };