UNPKG

igniteui-angular-gauges

Version:

Ignite UI Angular gauge components.

1,507 lines (1,506 loc) 81 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 { Control } from "igniteui-angular-core"; import { INotifyPropertyChanged_$type, Base, PropertyChangedEventArgs, runOn, delegateCombine, enumGetBox, Number_$type, String_$type, Array_$type, Point_$type, delegateRemove, fromEn, markType, markDep, typeCast, fromEnum, TypeRegistrar } from "igniteui-angular-core"; import { DoubleAnimator } from "igniteui-angular-core"; import { BulletGraphFrame } from "./BulletGraphFrame"; import { LinearGraphScaler } from "./LinearGraphScaler"; import { LinearScaleOrientation_$type } from "./LinearScaleOrientation"; import { DependencyProperty } from "igniteui-angular-core"; import { Brush } from "igniteui-angular-core"; import { LinearGraphRangeCollection } from "./LinearGraphRangeCollection"; import { BrushCollection } from "igniteui-angular-core"; import { HighlightedValueDisplayMode_$type } from "igniteui-angular-core"; import { BindingFormatter } from "igniteui-angular-core"; import { StackPool$1 } from "igniteui-angular-core"; import { Path } from "igniteui-angular-core"; import { TextBlock } from "igniteui-angular-core"; import { Rect } from "igniteui-angular-core"; import { List$1 } from "igniteui-angular-core"; import { XamLinearGraphRange } from "./XamLinearGraphRange"; import { FormatLinearGraphLabelEventArgs } from "./FormatLinearGraphLabelEventArgs"; import { AlignLinearGraphLabelEventArgs } from "./AlignLinearGraphLabelEventArgs"; import { BulletGraphVisualData } from "./BulletGraphVisualData"; import { ToolTipInfo } from "./ToolTipInfo"; import { RectData } from "igniteui-angular-core"; import { LinearGraphScaleLabelVisualDataList } from "./LinearGraphScaleLabelVisualDataList"; import { LinearGraphScaleTickmarkVisualDataList } from "./LinearGraphScaleTickmarkVisualDataList"; import { LinearGraphRangeVisualDataList } from "./LinearGraphRangeVisualDataList"; import { ValueVisualData } from "./ValueVisualData"; import { BulletGraphTargetValueVisualData } from "./BulletGraphTargetValueVisualData"; import { LinearGraphRangeVisualData } from "./LinearGraphRangeVisualData"; import { LinearGraphToolTipVisualData } from "./LinearGraphToolTipVisualData"; import { LinearGraphTooltipDataContext } from "./LinearGraphTooltipDataContext"; import { AppearanceHelper } from "igniteui-angular-core"; import { PointData } from "igniteui-angular-core"; import { PathVisualData } from "igniteui-angular-core"; import { GetPointsSettings } from "igniteui-angular-core"; import { PolygonUtil } from "igniteui-angular-core"; import { LinearGraphRectFrame } from "./LinearGraphRectFrame"; import { Size } from "igniteui-angular-core"; import { Tuple$2 } from "igniteui-angular-core"; import { BrushUtil } from "igniteui-angular-core"; import { PathGeometry } from "igniteui-angular-core"; import { PathFigure } from "igniteui-angular-core"; import { LineSegment } from "igniteui-angular-core"; import { DeviceUtils } from "igniteui-angular-core"; import { FontUtil } from "igniteui-angular-core"; import { PropertyMetadata } from "igniteui-angular-core"; import { isNaN_, isInfinity, intDivide, truncate } from "igniteui-angular-core"; import { EventProxy } from "igniteui-angular-core"; import { RenderingContext } from "igniteui-angular-core"; import { Dictionary$2 } from "igniteui-angular-core"; import { CanvasViewRenderer } from "igniteui-angular-core"; import { CanvasGestureDOMEventProxy } from "igniteui-angular-core"; import { LinearGraphScaleLabelVisualData } from "./LinearGraphScaleLabelVisualData"; import { LinearGraphScaleTickmarkVisualData } from "./LinearGraphScaleTickmarkVisualData"; import { SizeData } from "igniteui-angular-core"; import { arrayCopy1 } from "igniteui-angular-core"; import { stringIsNullOrEmpty } from "igniteui-angular-core"; /** * @hidden */ var XamBulletGraph = /** @class */ /*@__PURE__*/ (function (_super) { __extends(XamBulletGraph, _super); function XamBulletGraph() { var _this = _super.call(this) || this; _this.propertyChanged = null; _this.aw = null; _this.bp = 0; _this.formatLabel = null; _this.alignLabel = null; _this.an = null; _this.am = null; _this.al = null; _this.ar = null; _this.av = null; _this.bm = 0; _this.bl = 100; _this.a1 = 0; _this.bk = 0.5; _this.ay = 1; _this.aj = null; _this.bd = false; _this.a5 = null; _this.a3 = null; _this.a2 = null; _this.a6 = null; _this.a4 = null; _this._view = null; _this.ic = null; _this.ib = null; _this.ia = null; _this.bo = NaN; _this.bn = 1; _this.bf = new List$1(TextBlock.$, 0); _this.bi = new List$1(TextBlock.$, 0); _this.bh = new List$1(Path.$, 0); _this.bg = new List$1(Path.$, 0); _this.a8 = false; _this.bo = NaN; _this.bn = 1; _this.av = new XamLinearGraphRange(); var a = _this.av; a.propertyChanged = delegateCombine(a.propertyChanged, runOn(_this, _this.ft)); _this.view = new XamBulletGraphView(_this); _this.view.a9(); _this.ic = Rect.empty; _this.ib = Rect.empty; _this.ia = Rect.empty; _this.an = new BulletGraphFrame(); _this.am = new BulletGraphFrame(); _this.al = new BulletGraphFrame(); _this.ranges = new LinearGraphRangeCollection(); _this.a8 = true; _this.aw = new DoubleAnimator(0, 1, _this.c7); var b = _this.aw; b.propertyChanged = delegateCombine(b.propertyChanged, runOn(_this, _this.e8)); _this.ab = XamBulletGraph.$; _this.a4 = ((function () { var $ret = new StackPool$1(Path.$); $ret.b = runOn(_this.view, _this.view.bj); $ret.c = runOn(_this.view, _this.view.bk); $ret.d = runOn(_this.view, _this.view.bl); $ret.j = runOn(_this.view, _this.view.cs); return $ret; })()); _this.a5 = ((function () { var $ret = new StackPool$1(Path.$); $ret.b = runOn(_this.view, _this.view.bc); $ret.c = runOn(_this.view, _this.view.bd); $ret.d = runOn(_this.view, _this.view.be); $ret.j = runOn(_this.view, _this.view.cr); return $ret; })()); _this.a3 = ((function () { var $ret = new StackPool$1(Path.$); $ret.b = runOn(_this.view, _this.view.bc); $ret.c = runOn(_this.view, _this.view.bd); $ret.d = runOn(_this.view, _this.view.be); $ret.j = runOn(_this.view, _this.view.cr); return $ret; })()); _this.a2 = ((function () { var $ret = new StackPool$1(TextBlock.$); $ret.b = runOn(_this.view, _this.view.a1); $ret.c = runOn(_this.view, _this.view.a2); $ret.d = runOn(_this.view, _this.view.a3); $ret.j = runOn(_this.view, _this.view.b0); return $ret; })()); _this.a6 = ((function () { var $ret = new StackPool$1(TextBlock.$); $ret.b = runOn(_this.view, _this.view.bt); $ret.c = runOn(_this.view, _this.view.bu); $ret.d = runOn(_this.view, _this.view.bv); $ret.j = runOn(_this.view, _this.view.b1); return $ret; })()); return _this; } XamBulletGraph.prototype.fk = function (a) { this.fr(a); }; XamBulletGraph.prototype.fr = function (a) { var b = this.propertyChanged; if (b != null) { b(this, new PropertyChangedEventArgs(a)); } }; XamBulletGraph.prototype.onDetachedFromUI = function () { this.view.a8(); }; XamBulletGraph.prototype.onAttachedToUI = function () { this.view.a4(); }; XamBulletGraph.prototype.e8 = function (a, b) { this.cz = this.aw.o; }; Object.defineProperty(XamBulletGraph.prototype, "a7", { get: function () { return this.aw.f(); }, enumerable: false, configurable: true }); Object.defineProperty(XamBulletGraph.prototype, "cz", { get: function () { return this.bp; }, set: function (a) { var b = this.bp; this.bp = a; this.fj("TransitionProgress", b, this.bp); }, enumerable: false, configurable: true }); XamBulletGraph.prototype.f4 = function () { this.bp = 0; this.aw.w(); this.aw.v(); }; Object.defineProperty(XamBulletGraph.prototype, "bc", { get: function () { return this.c7 > 0; }, enumerable: false, configurable: true }); Object.defineProperty(XamBulletGraph.prototype, "h2", { get: function () { return this.c(XamBulletGraph.g4); }, set: function (a) { this.h(XamBulletGraph.g4, a); }, enumerable: false, configurable: true }); Object.defineProperty(XamBulletGraph.prototype, "h3", { get: function () { return this.c(XamBulletGraph.g5); }, set: function (a) { this.h(XamBulletGraph.g5, a); }, enumerable: false, configurable: true }); Object.defineProperty(XamBulletGraph.prototype, "ch", { get: function () { return this.c(XamBulletGraph.g6); }, set: function (a) { this.h(XamBulletGraph.g6, a); }, enumerable: false, configurable: true }); Object.defineProperty(XamBulletGraph.prototype, "bs", { get: function () { return this.bm; }, set: function (a) { this.bm = a; }, enumerable: false, configurable: true }); Object.defineProperty(XamBulletGraph.prototype, "br", { get: function () { return this.bl; }, set: function (a) { this.bl = a; }, enumerable: false, configurable: true }); Object.defineProperty(XamBulletGraph.prototype, "bq", { get: function () { return this.bk; }, set: function (a) { var b = this.bk; this.bk = a; if (b != this.bk) { this.fj("ActualHighlightValueOpacity", b, a); } }, enumerable: false, configurable: true }); XamBulletGraph.prototype.f7 = function () { this.bq = isNaN_(this.b0) ? 0.5 : Math.max(0, Math.min(this.b0, 1)); }; Object.defineProperty(XamBulletGraph.prototype, "az", { get: function () { return this.ay; }, set: function (a) { this.ay = a; }, enumerable: false, configurable: true }); XamBulletGraph.prototype.f6 = function () { if (this.a0 != 1) { if (isNaN_(this.bz) || isInfinity(this.bz)) { this.az = 1; } else { this.az = 2; } } else { this.az = 1; } }; XamBulletGraph.prototype.fd = function () { this.a1 = 0; this.view.cm().an = null; }; XamBulletGraph.prototype.by = function (a) { var b = 0; var c = a.x; if (this.as == 1) { b = a.y; c = this.ig.height; } return this.ar.k(c - b); }; XamBulletGraph.prototype.at = function () { var _this = this; var a = new BulletGraphVisualData(); a.viewport = new RectData(this.ig.left, this.ig.top, this.ig.width, this.ig.height); a.scaleLabels = new LinearGraphScaleLabelVisualDataList(); a.scaleTickmarks = new LinearGraphScaleTickmarkVisualDataList(); a.ranges = new LinearGraphRangeVisualDataList(); a.value = ((function () { var $ret = new ValueVisualData(); $ret.value = _this.c0; return $ret; })()); a.highlightValue = ((function () { var $ret = new ValueVisualData(); $ret.value = _this.bz; return $ret; })()); a.targetValue = ((function () { var $ret = new BulletGraphTargetValueVisualData(); $ret.value = _this.cn; return $ret; })()); this.view.aw(a); var b = this.view.l(); if (b != null) { var c_1; switch (b.c) { case "range": c_1 = a.ranges._inner[b.b]; break; case "value": c_1 = a.value; break; default: c_1 = a.targetValue; break; } a.toolTip = ((function () { var $ret = new LinearGraphToolTipVisualData(); $ret.item = c_1; $ret.itemBrush = AppearanceHelper.b(b.a.brush); $ret.outline = AppearanceHelper.b(b.a.outline); $ret.thickness = b.a.thickness; return $ret; })()); } return a; }; XamBulletGraph.prototype.dg = function () { var a = this.at(); a.scaleByViewport(); return a.serialize(); }; XamBulletGraph.prototype.destroy = function () { this.provideContainer(null); }; XamBulletGraph.prototype.provideContainer = function (a) { this.view.a6(a); }; XamBulletGraph.prototype.onMouseOver = function (a, b, c) { if (this.bd) { this.f3(a, null); } }; XamBulletGraph.prototype.onMouseLeave = function () { if (this.bd) { this.f3({ $type: Point_$type, x: -10000, y: -10000 }, null); } }; XamBulletGraph.prototype.containerResized = function () { this.view.a7(); }; XamBulletGraph.prototype.f5 = function () { this.view.bs(); }; XamBulletGraph.prototype.fc = function () { this.view.flush(); }; XamBulletGraph.prototype.bj = function (a) { var b = new List$1(Point_$type, 0); for (var c = 0; c < a.count; c++) { b.add({ $type: Point_$type, x: a._inner[c].x, y: a._inner[c].y }); } return b; }; XamBulletGraph.prototype.f3 = function (a, b) { var c = new PathVisualData(1, "targetValue", this.view.cp()); var d = c.getPoints(new GetPointsSettings()); if (d.count > 0) { var e = PolygonUtil.b(this.bj(d._inner[0]), a); if (e == true) { this.view.br(a, b, -1, "targetvalue"); return; } } var f = new PathVisualData(1, "value", this.view.cq()); var g = f.getPoints(new GetPointsSettings()); if (g.count > 0) { var h = PolygonUtil.b(this.bj(g._inner[0]), a); if (h == true) { this.view.br(a, b, -1, "value"); return; } } for (var i = 0; i < this.bg.count; i++) { var j = new PathVisualData(1, "range", this.bg._inner[i]); var k = j.getPoints(new GetPointsSettings()); if (k.count > 0) { var l = PolygonUtil.b(this.bj(k._inner[0]), a); if (l == true) { this.view.br(a, b, i, "range"); return; } } } this.view.az(); }; XamBulletGraph.prototype.fw = function () { if (!this.a8) { return; } var a = this.am.c; if (this.as == 0) { var b = 0; for (var c = 0; c < a.c.length; c++) { b = Math.max(b, a.c[c]); } var d = this.ig.height >= b ? this.ig.height - b : this.ig.height; this.ie = new Rect(0, 0, 0, this.ig.width, d); } else { var e = 0; for (var f = 0; f < a.f.length; f++) { e = Math.max(e, a.f[f]); } var g = this.ig.width >= e ? this.ig.width - e : this.ig.width; this.ie = new Rect(0, e, 0, g, this.ig.height); } }; Object.defineProperty(XamBulletGraph.prototype, "view", { get: function () { return this._view; }, set: function (a) { this._view = a; }, enumerable: false, configurable: true }); Object.defineProperty(XamBulletGraph.prototype, "ig", { get: function () { return this.ic; }, set: function (a) { var b = this.ic; this.ic = a; if (!b.equals1(this.ic)) { this.fl(b, this.ic); } }, enumerable: false, configurable: true }); Object.defineProperty(XamBulletGraph.prototype, "ie", { get: function () { return this.ib; }, set: function (a) { this.ib = a; }, enumerable: false, configurable: true }); Object.defineProperty(XamBulletGraph.prototype, "id", { get: function () { return this.ia; }, set: function (a) { this.ia = a; }, enumerable: false, configurable: true }); Object.defineProperty(XamBulletGraph.prototype, "ce", { get: function () { return this.bo; }, set: function (a) { var b = this.bo; this.bo = a; this.fj("PixelScalingRatio", b, this.bo); }, enumerable: false, configurable: true }); Object.defineProperty(XamBulletGraph.prototype, "bt", { get: function () { return this.bn; }, set: function (a) { var b = this.bn; this.bn = a; this.fj("ActualPixelScalingRatio", b, this.bn); }, enumerable: false, configurable: true }); XamBulletGraph.prototype.ba = function () { return !isNaN_(this.bs) && !isNaN_(this.br) && !this.ig.isEmpty && this.view.s(); }; XamBulletGraph.prototype.e9 = function () { if (!this.ba()) { return; } var a = this.cl(); this.ar = new LinearGraphScaler(this.bs, this.br, a, a + this.ck(), this.a9); if (this.a8) { if (this.a7) { if (this.aw.g) { this.aw.t(); } var b = this.an; this.an = this.al; this.al = b; } else { var c = this.an; this.an = this.am; this.am = c; } } else if (this.a7) { this.al.d(this.cz, this.an, this.am); this.fx(this.al); this.fz(this.al); this.f0(this.al); this.f2(this.al); } if (this.a8) { this.fn(); this.fw(); if (this.a1 == 1) { this.a1 = 2; var d = this.an.c; d.af = this.aq(this.c0, true, false); } else if (this.a1 == 4) { if (this.c7 > 0) { this.a1 = 5; var e = this.am.c; e.af = this.aq(this.c0, true, false); } else { this.fd(); } } this.fp(); this.fq(); this.fo(); this.fm(); } if (this.a8 && this.bc) { this.f4(); this.al.d(this.cz, this.an, this.am); this.fx(this.al); this.fz(this.al); this.f0(this.al); this.f2(this.al); this.f1(this.al); this.fy(this.al); } else { if (this.a8) { this.fx(this.am); this.fz(this.am); this.f0(this.am); this.f2(this.am); this.f1(this.am); this.fy(this.am); } } this.a8 = false; this.view.as(); }; XamBulletGraph.prototype.fo = function () { var a = this.am; var b = a.c; var c = this.ar; var d = this.b8; var e = this.ie; if (isNaN_(d)) { d = 3; } b.u = this.cm; b.r = this.cj; b.s = 0; b.t = 1; b.m.clear(); for (var f = 0; f < this.ranges.count; f++) { var g = this.ranges._inner[f]; if (g.j <= this.bs || g.o > this.br) { continue; } var h = g.o; var i = g.j; if (h < this.bs) { h = this.bs; } if (i > this.br) { i = this.br; } var j = new LinearGraphRectFrame(); j.i = g.an != null ? g.an : this.h0(f, this.ah); j.j = g.ao != null ? g.ao : this.h0(f, this.ai); j.h = g.p; j.g = c.i(h); j.d = c.i(i); j.e = g.l; j.b = g.k; j.f = g.n; j.c = g.m; if (isNaN_(j.e)) { j.e = this.cf; } j.b = g.k; if (isNaN_(j.b)) { j.b = this.cf; } j.f = g.n; if (isNaN_(j.f)) { j.f = this.cg; } j.c = g.m; if (isNaN_(j.c)) { j.c = this.cg; } b.m.add(j); } b.l.i = this.h2; b.l.j = this.h3; b.l.h = this.ch; b.l.g = c.i(this.bs); b.l.d = c.i(this.br); b.l.e = this.cf; b.l.b = this.cf; b.l.f = this.cg; b.l.c = this.cg; b.ab = this.hz; b.ad = this.h6; b.x = this.cy; b.w = this.cw; b.v = this.cs; b.ac = this.h1; b.q = this.cd; b.p = this.cb; b.o = this.b9; var k = this.b1; if (isNaN_(k)) { k = (this.br - this.bs) / 10; } if (k == 0) { k = this.br - this.bs; } var l = new List$1(Number_$type, 0); var m = new List$1(Number_$type, 0); if (k > 0) { var n = this.bs + this.cu; var o = this.br - this.cv; var p = 100000; var q = Math.abs(o - n) / p; if (k >= q) { for (var r = n; r <= o || this.be(r, o, k); r = r + k) { l.add(c.i(r)); for (var s = 0; s < d; s++) { var t = (k / (d + 1)) * (s + 1); if (t + r > o) { continue; } m.add(c.i(t + r)); } } } } if (b.j.length != l.count || b.i.length != m.count) { b.j = new Array(l.count); b.i = new Array(m.count); } for (var u = 0; u < l.count; u++) { b.j[u] = l._inner[u]; } for (var v = 0; v < m.count; v++) { b.i[v] = m._inner[v]; } }; XamBulletGraph.prototype.ih = function () { var a = this.b1; var b = this.b3; if (isNaN_(a)) { a = (this.br - this.bs) / 10; } if (isNaN_(b)) { b = a; } if (b == 0) { b = this.br - this.bs; } var c = new List$1(Number_$type, 0); if (b > 0) { var d = this.b4 + this.bs; var e = this.br - this.b5; var f = 100000; var g = Math.abs(e - d) / f; if (b >= g) { for (var h = d; h <= e || this.be(h, e, a); h += b) { c.add(h); } } } var i = new Array(c.count); var j = new Array(c.count); var _loop_1 = function (k) { var l = c._inner[k]; if (this_1.formatLabel == null && this_1.aj == null) { l = (Math.round(l * 100) / 100); } var m = l.toString(); if (this_1.aj != null) { m = this_1.aj.i(l); } var n = new FormatLinearGraphLabelEventArgs(); n.value = l; n.label = m; if (this_1.formatLabel != null) { this_1.formatLabel(this_1, n); } m = n.label; var o = this_1.view.ct(((function () { var $ret = new TextBlock(); $ret.al = m; return $ret; })())); i[k] = o.width; j[k] = o.height; }; var this_1 = this; for (var k = 0; k < c.count; k++) { _loop_1(k); } var p = 0; var q = 0; var r = 1 - this.cj + this.cm; if (this.as == 0) { for (var s = 0; s < j.length; s++) { q = Math.max(q, j[s]); } for (var t = 0; t < i.length; t++) { p += i[t]; } if (i.length > 0) { p += i[0] / 2; } if (i.length > 1) { p += i[i.length - 1] / 2; } if (i.length > 0) { p += (i.length - 1) * 5; } if (r > 0) { p = p / Math.abs(1 - r); } } else { for (var u = 0; u < i.length; u++) { p = Math.max(p, i[u]); } for (var v = 0; v < j.length; v++) { q += j[v]; } if (j.length > 0) { q -= j[0] / 2; } if (j.length > 1) { q -= j[j.length - 1] / 2; } if (r > 0) { q = q / Math.abs(1 - r); } if (j.length > 0) { q += (j.length - 1) * 5; } } return new Size(1, p, q); }; XamBulletGraph.prototype.fn = function () { var a = this.am; var b = a.c; var c = this.ar; var d = this.b1; var e = this.b3; var f = this.b8; if (isNaN_(d)) { d = (this.br - this.bs) / 10; } if (isNaN_(e)) { e = d; } if (e == 0) { e = this.br - this.bs; } var g = new List$1(Tuple$2.$.specialize(Number_$type, Number_$type), 0); if (e > 0) { var h = this.b4 + this.bs; var i = this.br - this.b5; var j = 100000; var k = Math.abs(i - h) / j; if (e >= k) { for (var l = h; l <= i || this.be(l, i, e); l = l + e) { g.add(new Tuple$2(Number_$type, Number_$type, l, c.i(l))); } } } if (b.d.length != g.count) { b.e = new Array(g.count); b.d = new Array(g.count); b.f = new Array(g.count); b.c = new Array(g.count); b.g = new Array(g.count); b.h = new Array(g.count); } b.n = this.b2; var m = new FormatLinearGraphLabelEventArgs(); m.actualMinimumValue = this.bs; m.actualMaximumValue = this.br; var n = new AlignLinearGraphLabelEventArgs(); n.actualMinimumValue = this.bs; n.actualMaximumValue = this.br; var _loop_2 = function (o) { var p = g._inner[o].c; if (this_2.formatLabel == null) { p = (Math.round(p * 100) / 100); } var q = (p).toString(); if (this_2.aj != null) { q = this_2.aj.i(p); } m.value = p; n.value = p; m.label = q; if (this_2.formatLabel != null) { this_2.formatLabel(this_2, m); } q = m.label; n.label = q; var r = this_2.view.ct(((function () { var $ret = new TextBlock(); $ret.al = q; return $ret; })())); n.width = r.width; n.height = r.height; if (this_2.as == 0) { n.offsetX = -1 * (r.width / 2); n.offsetY = -1 * (r.height); } else { n.offsetX = -1 * r.width; n.offsetY = -1 * (r.height / 2); } if (this_2.alignLabel != null) { this_2.alignLabel(this_2, n); } b.f[o] = n.width; b.c[o] = n.height; b.g[o] = n.offsetX; b.h[o] = n.offsetY; b.d[o] = q; b.e[o] = g._inner[o].d; }; var this_2 = this; for (var o = 0; o < g.count; o++) { _loop_2(o); } }; XamBulletGraph.prototype.be = function (a, b, c) { var d = c / 10000; if (isNaN_(d)) { d = 1E-05; } var e = Math.abs(a - b); if (e < d) { return true; } return false; }; XamBulletGraph.prototype.fm = function () { var a = this.am; var b = a.a; b.e = this.hx; b.f = this.hy; b.c = this.bw; b.a = this.bu; b.b = this.bv; }; XamBulletGraph.prototype.fp = function () { var a = this.am; var b = a.b; var c = this.ar; b.e = this.cp; b.b = this.cp; b.f = this.cq; b.c = this.cq; b.i = this.h4; b.j = this.h5; b.h = this.cr; if (isNaN_(this.cn)) { return; } var d = c.i(this.cn); var e = (this.co / 2); b.g = d - e; b.d = d + e; }; XamBulletGraph.prototype.fq = function () { var a = this.am.c; var b = this.c0; if (isNaN_(b)) { return; } var c = !(this.a1 == 0 || this.a1 == 5); a.ag = this.aq(b, false, c); var d = this.bz; if (c && !isNaN_(d)) { a.af = this.aq(d, true, false); } }; XamBulletGraph.prototype.aq = function (a, b, c) { var d = this.ar; var e = this.bs; if (isNaN_(e)) { e = this.bs; } var f = a; var g = new LinearGraphRectFrame(); var h = this.h7; var i = this.h8; if (c) { h = BrushUtil.s(h, this.bq); i = BrushUtil.s(i, this.bq); } g.i = h; g.j = i; g.h = this.c3; g.g = d.i(e); g.d = d.i(f); g.e = this.c1; g.b = this.c1; g.f = this.c2; g.c = this.c2; return g; }; XamBulletGraph.prototype.h0 = function (a, b) { if (b != null && b.count > 0) { return b.item(a % b.count); } else { return null; } }; XamBulletGraph.prototype.f1 = function (a) { var b = this.ie; var c = a.c; var d = this.a5; var e = c.j; var f = c.w; var g = c.v; var h = c.ad; var i = c.x; var j = this.a3; var k = c.i; var l = c.p; var m = c.o; var n = c.ac; var o = c.q; d.f = true; for (var p = 0; p < this.bh.count; p++) { d.n(this.bh._inner[p]); } this.bh.clear(); var q = this.ci(); var r = this.c5(); var _loop_3 = function (s) { var t = void 0, u = void 0, v, w; if (this_3.as == 1) { t = b.left + q * f; u = r - e[s]; v = b.left + q * g; w = u; } else { t = b.left + e[s]; u = q * (1 - f); v = t; w = q * (1 - g); } var x = d.a(); var y = new PathGeometry(); var z = new PathFigure(); z._startPoint = { $type: Point_$type, x: t, y: u }; z._segments.add(((function () { var $ret = new LineSegment(1); $ret.c = { $type: Point_$type, x: v, y: w }; return $ret; })())); y.c.add(z); x.an = y; x._stroke = h; x.ad = i; this_3.bh.add(x); }; var this_3 = this; for (var s = 0; s < e.length; s++) { _loop_3(s); } var _loop_4 = function (aa) { var ab = void 0, ac = void 0, ad, ae; if (this_4.as == 1) { ab = b.left + q * l; ac = r - k[aa]; ad = b.left + q * m; ae = ac; } else { ab = k[aa]; ac = q * (1 - l); ad = ab; ae = q * (1 - m); } var af = d.a(); var ag = new PathGeometry(); var ah = new PathFigure(); ah._startPoint = { $type: Point_$type, x: ab, y: ac }; ah._segments.add(((function () { var $ret = new LineSegment(1); $ret.c = { $type: Point_$type, x: ad, y: ae }; return $ret; })())); ag.c.add(ah); af.an = ag; af._stroke = n; af.ad = o; this_4.bh.add(af); }; var this_4 = this; for (var aa = 0; aa < k.length; aa++) { _loop_4(aa); } d.f = false; }; XamBulletGraph.prototype.fy = function (a) { var b = this.ie; var c = a.c; var d = c.e; var e = c.d; var f = c.g; var g = c.h; var h = c.f; var i = c.c; var j = c.n; var k = this.a2; k.f = true; for (var l = 0; l < this.bf.count; l++) { k.n(this.bf._inner[l]); } this.bf.clear(); var m = c.ab; var n = this.c4(); var o = this.c5(); for (var p = 0; p < e.length; p++) { var q = void 0, r = void 0; if (this.as == 1) { q = b.left + n * j; r = b.top + o - d[p]; } else { q = b.left + d[p]; r = b.top + n * (1 - j); } var s = k.a(); s.al = e[p]; this.view.bq(s, m); var t = h[p]; var u = i[p]; var v = f[p]; var w = g[p]; this.view.bh(s, q + v, r + w); this.bf.add(s); } k.f = false; }; XamBulletGraph.prototype.fz = function (a) { var b = a.c; var c = this.a4; c.f = true; for (var d = 0; d < this.bg.count; d++) { c.n(this.bg._inner[d]); } this.bg.clear(); var e = this.ci(); var f = this.c5(); var g = this.h9(); var h = this.view.co(); h.an = b.ae(g, e, f, this.as); for (var i = 0; i < b.m.count; i++) { var j = b.m._inner[i]; var k = c.a(); k.an = j.k(g, e, f, this.as); k._fill = j.i; k._stroke = j.j; k.ad = j.h; this.bg.add(k); } this.view.bp(this.bg); c.f = false; var l = this.view.cn(); l.an = b.l.k(g, e, f, this.as); l._fill = b.l.i; l._stroke = b.l.j; l.ad = b.l.h; }; XamBulletGraph.prototype.fx = function (a) { var b = this.id; var c = this.view.cl(); var d = a.a; var e = this.as == 0 ? b.height : b.width; var f = this.as == 0 ? b.width : b.height; var g = d.g(e, f, this.as); c.an = g; c._fill = d.e; c._stroke = d.f; c.ad = d.c; }; XamBulletGraph.prototype.f0 = function (a) { var b = this.view.cp(); if (isNaN_(this.cn) || this.cn < this.bs || this.cn > this.br) { b.an = null; return; } var c = a.b; var d = this.ci(); var e = this.c5(); var f = this.h9(); var g = c.k(f, d, e, this.as); b.an = g; b._fill = c.i; b._stroke = c.j; b.ad = c.h; }; XamBulletGraph.prototype.f2 = function (a) { var b = this.view.cq(); var c = this.view.cm(); var d = this.c0; if (d <= this.bs || d > this.br || isNaN_(d)) { b.an = null; c.an = null; return; } var e = this.bz; var f = this.a1 != 0; if (!f || e <= this.bs || e > this.br || isNaN_(e)) { c.an = null; f = false; } var g = a.c; var h = this.ci(); var i = this.c5(); var j = this.h9(); var k = g.ag; b.an = k.k(j, h, i, this.as); b._fill = k.i; b._stroke = k.j; b.ad = k.h; if (f) { var l = g.af; c.an = l.k(j, h, i, this.as); c._fill = l.i; c._stroke = l.j; c.ad = l.h; } }; XamBulletGraph.prototype.fl = function (a, b) { this.a8 = true; this.view.bo(); }; XamBulletGraph.prototype.fg = function (a, b) { this.a8 = true; this.view.bo(); }; XamBulletGraph.prototype.ci = function () { if (this.as == 0) { return this.bb ? this.ig.height : this.ie.height; } return this.bb ? this.ig.width : this.ie.width; }; XamBulletGraph.prototype.ck = function () { if (this.as == 0) { return this.ig.width * (this.cj - this.cm); } return this.ig.height * (this.cj - this.cm); }; XamBulletGraph.prototype.c4 = function () { if (this.as == 0) { return this.ig.height; } return this.ig.width; }; XamBulletGraph.prototype.c5 = function () { if (this.as == 0) { return this.ig.width; } return this.ig.height; }; XamBulletGraph.prototype.cl = function () { var a = this.cm; if (this.as == 0) { if (this.a9) { a = 1 - this.cj; } return this.ig.left + this.ig.width * a; } if (this.a9) { a = 1 - this.cj; } return this.ig.top + this.ig.height * a; }; XamBulletGraph.prototype.h9 = function () { var a = this.ie.left; if (this.bb) { a = 0; } var b = this.cm; if (this.as == 0) { if (this.a9) { b = 1 - this.cj; } return { $type: Point_$type, x: a + this.ie.width * b, y: this.ie.top }; } if (!this.a9) { b = 1 - this.cj; } return { $type: Point_$type, x: a, y: this.ie.top + this.ie.height * b }; }; XamBulletGraph.prototype.fj = function (a, b, c) { switch (a) { case XamBulletGraph.$$p[51]: case XamBulletGraph.$$p[36]: case XamBulletGraph.$$p[40]: case XamBulletGraph.$$p[0]: case XamBulletGraph.$$p[3]: case XamBulletGraph.$$p[55]: case XamBulletGraph.$$p[43]: case XamBulletGraph.$$p[21]: this.view.a5(a, b, c); break; case XamBulletGraph.$$p[27]: this.view.ba(b, c); break; case XamBulletGraph.$$p[30]: this.view.bb(b, c); break; } switch (a) { case XamBulletGraph.$$p[13]: case XamBulletGraph.$$p[14]: if (this.dr != null) { this.aj = new BindingFormatter(); this.aj.j = this.dr; this.aj.d = this.ag; } else { this.aj = null; } this.a8 = true; this.view.bo(); break; case XamBulletGraph.$$p[50]: this.aw.r = this.c7; this.view.bo(); break; case "TransitionProgress": if (this.cz >= 1) { this.aw.w(); var d = this.am; this.am = this.an; this.an = d; this.fn(); this.fp(); this.fq(); this.fo(); this.fm(); this.fx(this.am); this.fz(this.am); this.f0(this.am); this.f2(this.am); this.f1(this.am); this.fy(this.am); if (this.a1 == 5) { this.fd(); this.view.bo(); return; } else if (this.a1 == 2) { this.a1 = 3; } } this.al.d(this.cz, this.an, this.am); this.fx(this.al); this.fz(this.al); this.f0(this.al); this.f2(this.al); this.f1(this.al); this.fy(this.al); this.view.as(); break; case XamBulletGraph.$$p[56]: case XamBulletGraph.$$p[52]: case XamBulletGraph.$$p[54]: case XamBulletGraph.$$p[51]: case XamBulletGraph.$$p[55]: case XamBulletGraph.$$p[57]: case XamBulletGraph.$$p[36]: case XamBulletGraph.$$p[40]: case XamBulletGraph.$$p[42]: case XamBulletGraph.$$p[35]: case XamBulletGraph.$$p[37]: case XamBulletGraph.$$p[39]: case XamBulletGraph.$$p[0]: case XamBulletGraph.$$p[3]: case XamBulletGraph.$$p[43]: case XamBulletGraph.$$p[21]: case XamBulletGraph.$$p[27]: case XamBulletGraph.$$p[30]: case XamBulletGraph.$$p[19]: case XamBulletGraph.$$p[41]: case XamBulletGraph.$$p[38]: case XamBulletGraph.$$p[28]: case XamBulletGraph.$$p[29]: case XamBulletGraph.$$p[4]: case XamBulletGraph.$$p[1]: case XamBulletGraph.$$p[2]: case XamBulletGraph.$$p[10]: case XamBulletGraph.$$p[15]: case XamBulletGraph.$$p[12]: case XamBulletGraph.$$p[16]: case XamBulletGraph.$$p[17]: case XamBulletGraph.$$p[47]: case XamBulletGraph.$$p[48]: case XamBulletGraph.$$p[45]: case XamBulletGraph.$$p[44]: case XamBulletGraph.$$p[46]: case XamBulletGraph.$$p[24]: case XamBulletGraph.$$p[23]: case XamBulletGraph.$$p[22]: case XamBulletGraph.$$p[25]: case "ScaleBackgroundBrush": case "ScaleBackgroundOutline": case "ScaleBackgroundThickness": this.a8 = true; this.view.bo(); break; case XamBulletGraph.$$p[31]: var e = b; var f = c; if (e != null) { var g = e; g.collectionChanged = delegateRemove(g.collectionChanged, runOn(this, this.fu)); } if (f != null) { var h = f; h.collectionChanged = delegateCombine(h.collectionChanged, runOn(this, this.fu)); } this.a8 = true; this.view.bo(); break; case XamBulletGraph.$$p[26]: case XamBulletGraph.$$p[11]: case XamBulletGraph.$$p[20]: case XamBulletGraph.$$p[18]: case XamBulletGraph.$$p[32]: case XamBulletGraph.$$p[33]: this.bs = Math.min(this.b7, this.b6); this.br = Math.max(this.b7, this.b6); var i = this.cl(); this.ar = new LinearGraphScaler(this.bs, this.br, i, i + this.ck(), this.a9); this.a8 = true; this.view.bo(); break; case XamBulletGraph.$$p[5]: case XamBulletGraph.$$p[6]: this.view.by(); this.a8 = true; this.view.bo(); break; case "PixelScalingRatio": if (isNaN_(DeviceUtils.a(this.ce))) { this.bt = 1; } else { this.bt = DeviceUtils.a(this.ce); } break; case "ActualPixelScalingRatio": this.view.bf(); break; case XamBulletGraph.$$p[9]: { var j = this.az == 2; this.f6(); var k = this.az == 2; this.a8 = true; if (!j && k) { this.a1 = 1; } else if (j && !k) { this.a1 = 4; } this.view.bo(); break; } case XamBulletGraph.$$p[7]: { var l = this.az == 2; this.f6(); var m = this.az == 2; this.a8 = true; if (!l && m) { this.a1 = 1; } else if (l && !m) { this.a1 = 4; } this.view.bo(); break; } case XamBulletGraph.$$p[8]: this.f7(); break; case "ActualHighlightValueOpacity": this.a8 = true; this.view.bo(); break; } this.fk(a); }; XamBulletGraph.prototype.fu = function (a, b) { var e_1, _a, e_2, _b; if (b.oldItems != null) { try { for (var _c = __values(fromEn(b.oldItems)), _d = _c.next(); !_d.done; _d = _c.next()) { var c = _d.value; c.propertyChanged = delegateRemove(c.propertyChanged, runOn(this, this.ft)); } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (_d && !_d.done && (_a = _c.return)) _a.call(_c); } finally { if (e_1) throw e_1.error; } } } if (b.newItems != null) { try { for (var _e = __values(fromEn(b.newItems)), _f = _e.next(); !_f.done; _f = _e.next()) { var d = _f.value; d.propertyChanged = delegateCombine(d.propertyChanged, runOn(this, this.ft)); } } catch (e_2_1) { e_2 = { error: e_2_1 }; } finally { try { if (_f && !_f.done && (_b = _e.return))