UNPKG

igniteui-angular-gauges

Version:

Ignite UI Angular gauge components.

1,512 lines (1,511 loc) 81.4 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 { CanvasScalingHelpers } 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.bq = 0; _this.formatLabel = null; _this.alignLabel = null; _this.an = null; _this.am = null; _this.al = null; _this.ar = null; _this.av = null; _this.bn = 0; _this.bm = 100; _this.a1 = 0; _this.bl = 0.5; _this.ay = 1; _this.aj = null; _this.be = false; _this.a5 = null; _this.a3 = null; _this.a2 = null; _this.a6 = null; _this.a4 = null; _this._view = null; _this.ig = null; _this.ie = null; _this.id = null; _this.bp = NaN; _this.bo = 1; _this.bg = new List$1(TextBlock.$, 0); _this.bj = new List$1(TextBlock.$, 0); _this.bi = new List$1(Path.$, 0); _this.bh = new List$1(Path.$, 0); _this.a8 = false; _this.bp = NaN; _this.bo = 1; _this.av = new XamLinearGraphRange(); var a = _this.av; a.propertyChanged = delegateCombine(a.propertyChanged, runOn(_this, _this.fv)); _this.view = new XamBulletGraphView(_this); _this.view.a9(); _this.ig = Rect.empty; _this.ie = Rect.empty; _this.id = 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.c8); var b = _this.aw; b.propertyChanged = delegateCombine(b.propertyChanged, runOn(_this, _this.fa)); _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.fm = function (a) { this.ft(a); }; XamBulletGraph.prototype.ft = 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.fa = function (a, b) { this.c0 = this.aw.o; }; Object.defineProperty(XamBulletGraph.prototype, "a7", { get: function () { return this.aw.f(); }, enumerable: false, configurable: true }); Object.defineProperty(XamBulletGraph.prototype, "c0", { get: function () { return this.bq; }, set: function (a) { var b = this.bq; this.bq = a; this.fl("TransitionProgress", b, this.bq); }, enumerable: false, configurable: true }); XamBulletGraph.prototype.f6 = function () { this.bq = 0; this.aw.w(); this.aw.v(); }; Object.defineProperty(XamBulletGraph.prototype, "bd", { get: function () { return this.c8 > 0; }, enumerable: false, configurable: true }); Object.defineProperty(XamBulletGraph.prototype, "h5", { get: function () { return this.c(XamBulletGraph.g7); }, set: function (a) { this.h(XamBulletGraph.g7, a); }, enumerable: false, configurable: true }); Object.defineProperty(XamBulletGraph.prototype, "h6", { get: function () { return this.c(XamBulletGraph.g8); }, set: function (a) { this.h(XamBulletGraph.g8, a); }, enumerable: false, configurable: true }); Object.defineProperty(XamBulletGraph.prototype, "ci", { get: function () { return this.c(XamBulletGraph.g9); }, set: function (a) { this.h(XamBulletGraph.g9, a); }, enumerable: false, configurable: true }); Object.defineProperty(XamBulletGraph.prototype, "bt", { get: function () { return this.bn; }, set: function (a) { this.bn = 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) { var b = this.bl; this.bl = a; if (b != this.bl) { this.fl("ActualHighlightValueOpacity", b, a); } }, enumerable: false, configurable: true }); XamBulletGraph.prototype.f9 = function () { this.br = isNaN_(this.b1) ? 0.5 : Math.max(0, Math.min(this.b1, 1)); }; Object.defineProperty(XamBulletGraph.prototype, "az", { get: function () { return this.ay; }, set: function (a) { this.ay = a; }, enumerable: false, configurable: true }); XamBulletGraph.prototype.f8 = function () { if (this.a0 != 1) { if (isNaN_(this.b0) || isInfinity(this.b0)) { this.az = 1; } else { this.az = 2; } } else { this.az = 1; } }; XamBulletGraph.prototype.ff = function () { this.a1 = 0; this.view.cm().an = null; }; XamBulletGraph.prototype.bz = function (a) { var b = 0; var c = a.x; if (this.as == 1) { b = a.y; c = this.ij.height; } return this.ar.k(c - b); }; XamBulletGraph.prototype.at = function () { var _this = this; var a = new BulletGraphVisualData(); a.viewport = new RectData(this.ij.left, this.ij.top, this.ij.width, this.ij.height); a.scaleLabels = new LinearGraphScaleLabelVisualDataList(); a.scaleTickmarks = new LinearGraphScaleTickmarkVisualDataList(); a.ranges = new LinearGraphRangeVisualDataList(); a.value = ((function () { var $ret = new ValueVisualData(); $ret.value = _this.c1; return $ret; })()); a.highlightValue = ((function () { var $ret = new ValueVisualData(); $ret.value = _this.b0; return $ret; })()); a.targetValue = ((function () { var $ret = new BulletGraphTargetValueVisualData(); $ret.value = _this.co; 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.dh = 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.be) { this.f5(a, null); } }; XamBulletGraph.prototype.onMouseLeave = function () { if (this.be) { this.f5({ $type: Point_$type, x: -10000, y: -10000 }, null); } }; XamBulletGraph.prototype.containerResized = function () { this.view.a7(); }; XamBulletGraph.prototype.f7 = function () { this.view.bs(); }; XamBulletGraph.prototype.fe = function () { this.view.flush(); }; XamBulletGraph.prototype.bk = 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.f5 = 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.bk(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.bk(g._inner[0]), a); if (h == true) { this.view.br(a, b, -1, "value"); return; } } for (var i = 0; i < this.bh.count; i++) { var j = new PathVisualData(1, "range", this.bh._inner[i]); var k = j.getPoints(new GetPointsSettings()); if (k.count > 0) { var l = PolygonUtil.b(this.bk(k._inner[0]), a); if (l == true) { this.view.br(a, b, i, "range"); return; } } } this.view.az(); }; XamBulletGraph.prototype.fy = 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.ij.height >= b ? this.ij.height - b : this.ij.height; this.ii = new Rect(0, 0, 0, this.ij.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.ij.width >= e ? this.ij.width - e : this.ij.width; this.ii = new Rect(0, e, 0, g, this.ij.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, "ij", { get: function () { return this.ig; }, set: function (a) { var b = this.ig; this.ig = a; if (!b.equals1(this.ig)) { this.fn(b, this.ig); } }, enumerable: false, configurable: true }); Object.defineProperty(XamBulletGraph.prototype, "ii", { get: function () { return this.ie; }, set: function (a) { this.ie = a; }, enumerable: false, configurable: true }); Object.defineProperty(XamBulletGraph.prototype, "ih", { get: function () { return this.id; }, set: function (a) { this.id = a; }, enumerable: false, configurable: true }); Object.defineProperty(XamBulletGraph.prototype, "cf", { get: function () { return this.bp; }, set: function (a) { var b = this.bp; this.bp = a; this.fl("PixelScalingRatio", b, this.bp); }, enumerable: false, configurable: true }); Object.defineProperty(XamBulletGraph.prototype, "bu", { get: function () { return this.bo; }, set: function (a) { var b = this.bo; this.bo = a; this.fl("ActualPixelScalingRatio", b, this.bo); }, enumerable: false, configurable: true }); XamBulletGraph.prototype.ba = function () { return !isNaN_(this.bt) && !isNaN_(this.bs) && !this.ij.isEmpty && this.view.s(); }; XamBulletGraph.prototype.fb = function () { if (!this.ba()) { return; } var a = this.cm(); this.ar = new LinearGraphScaler(this.bt, this.bs, a, a + this.cl(), 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.c0, this.an, this.am); this.fz(this.al); this.f1(this.al); this.f2(this.al); this.f4(this.al); } if (this.a8) { this.fp(); this.fy(); if (this.a1 == 1) { this.a1 = 2; var d = this.an.c; d.af = this.aq(this.c1, true, false); } else if (this.a1 == 4) { if (this.c8 > 0) { this.a1 = 5; var e = this.am.c; e.af = this.aq(this.c1, true, false); } else { this.ff(); } } this.fr(); this.fs(); this.fq(); this.fo(); } if (this.a8 && this.bd) { this.f6(); this.al.d(this.c0, this.an, this.am); this.fz(this.al); this.f1(this.al); this.f2(this.al); this.f4(this.al); this.f3(this.al); this.f0(this.al); } else { if (this.a8) { this.fz(this.am); this.f1(this.am); this.f2(this.am); this.f4(this.am); this.f3(this.am); this.f0(this.am); } } this.a8 = false; this.view.as(); }; XamBulletGraph.prototype.fq = function () { var a = this.am; var b = a.c; var c = this.ar; var d = this.b9; var e = this.ii; if (isNaN_(d)) { d = 3; } b.u = this.cn; b.r = this.ck; 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.bt || g.o > this.bs) { continue; } var h = g.o; var i = g.j; if (h < this.bt) { h = this.bt; } if (i > this.bs) { i = this.bs; } var j = new LinearGraphRectFrame(); j.i = g.an != null ? g.an : this.h3(f, this.ah); j.j = g.ao != null ? g.ao : this.h3(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.cg; } j.b = g.k; if (isNaN_(j.b)) { j.b = this.cg; } j.f = g.n; if (isNaN_(j.f)) { j.f = this.ch; } j.c = g.m; if (isNaN_(j.c)) { j.c = this.ch; } b.m.add(j); } b.l.i = this.h5; b.l.j = this.h6; b.l.h = this.ci; b.l.g = c.i(this.bt); b.l.d = c.i(this.bs); b.l.e = this.cg; b.l.b = this.cg; b.l.f = this.ch; b.l.c = this.ch; b.ab = this.h2; b.ad = this.h9; b.x = this.cz; b.w = this.cx; b.v = this.ct; b.ac = this.h4; b.q = this.ce; b.p = this.cc; b.o = this.ca; var k = this.b2; if (isNaN_(k)) { k = (this.bs - this.bt) / 10; } if (k == 0) { k = this.bs - this.bt; } var l = new List$1(Number_$type, 0); var m = new List$1(Number_$type, 0); if (k > 0) { var n = this.bt + this.cv; var o = this.bs - this.cw; var p = 100000; var q = Math.abs(o - n) / p; if (k >= q) { for (var r = n; r <= o || this.bf(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.ik = function () { if (!this.bb) { return new Size(1, 0, 0); } var a = this.b2; var b = this.b4; if (isNaN_(a)) { a = (this.bs - this.bt) / 10; } if (isNaN_(b)) { b = a; } if (b == 0) { b = this.bs - this.bt; } var c = new List$1(Number_$type, 0); if (b > 0) { var d = this.b5 + this.bt; var e = this.bs - this.b6; var f = 100000; var g = Math.abs(e - d) / f; if (b >= g) { for (var h = d; h <= e || this.bf(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.ck + this.cn; 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.fp = function () { var a = this.am; var b = a.c; var c = this.ar; var d = this.b2; var e = this.b4; var f = this.b9; if (isNaN_(d)) { d = (this.bs - this.bt) / 10; } if (isNaN_(e)) { e = d; } if (e == 0) { e = this.bs - this.bt; } var g = new List$1(Tuple$2.$.specialize(Number_$type, Number_$type), 0); if (e > 0) { var h = this.b5 + this.bt; var i = this.bs - this.b6; var j = 100000; var k = Math.abs(i - h) / j; if (e >= k) { for (var l = h; l <= i || this.bf(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.b3; var m = new FormatLinearGraphLabelEventArgs(); m.actualMinimumValue = this.bt; m.actualMaximumValue = this.bs; var n = new AlignLinearGraphLabelEventArgs(); n.actualMinimumValue = this.bt; n.actualMaximumValue = this.bs; 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.bb) { 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.bb) { this_2.alignLabel(this_2, n); } if (this_2.bb) { b.f[o] = n.width; b.c[o] = n.height; } else { b.f[o] = 0; b.c[o] = 0; } 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.bf = 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.fo = function () { var a = this.am; var b = a.a; b.e = this.h0; b.f = this.h1; b.c = this.bx; b.a = this.bv; b.b = this.bw; }; XamBulletGraph.prototype.fr = function () { var a = this.am; var b = a.b; var c = this.ar; b.e = this.cq; b.b = this.cq; b.f = this.cr; b.c = this.cr; b.i = this.h7; b.j = this.h8; b.h = this.cs; if (isNaN_(this.co)) { return; } var d = c.i(this.co); var e = (this.cp / 2); b.g = d - e; b.d = d + e; }; XamBulletGraph.prototype.fs = function () { var a = this.am.c; var b = this.c1; if (isNaN_(b)) { return; } var c = !(this.a1 == 0 || this.a1 == 5); a.ag = this.aq(b, false, c); var d = this.b0; 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.bt; if (isNaN_(e)) { e = this.bt; } var f = a; var g = new LinearGraphRectFrame(); var h = this.ia; var i = this.ib; if (c) { h = BrushUtil.s(h, this.br); i = BrushUtil.s(i, this.br); } g.i = h; g.j = i; g.h = this.c4; g.g = d.i(e); g.d = d.i(f); g.e = this.c2; g.b = this.c2; g.f = this.c3; g.c = this.c3; return g; }; XamBulletGraph.prototype.h3 = function (a, b) { if (b != null && b.count > 0) { return b.item(a % b.count); } else { return null; } }; XamBulletGraph.prototype.f3 = function (a) { var b = this.ii; 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.bi.count; p++) { d.n(this.bi._inner[p]); } this.bi.clear(); var q = this.cj(); var r = this.c6(); 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.bi.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.bi.add(af); }; var this_4 = this; for (var aa = 0; aa < k.length; aa++) { _loop_4(aa); } d.f = false; }; XamBulletGraph.prototype.f0 = function (a) { var b = this.ii; 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.bg.count; l++) { k.n(this.bg._inner[l]); } this.bg.clear(); var m = c.ab; var n = this.c5(); var o = this.c6(); 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); if (this.bb) { this.view.a1(s); } else { this.view.a2(s); } this.bg.add(s); } k.f = false; }; XamBulletGraph.prototype.f1 = function (a) { var b = a.c; var c = this.a4; c.f = true; for (var d = 0; d < this.bh.count; d++) { c.n(this.bh._inner[d]); } this.bh.clear(); var e = this.cj(); var f = this.c6(); var g = this.ic(); 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.bh.add(k); } this.view.bp(this.bh); 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.fz = function (a) { var b = this.ih; 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.f2 = function (a) { var b = this.view.cp(); if (isNaN_(this.co) || this.co < this.bt || this.co > this.bs) { b.an = null; return; } var c = a.b; var d = this.cj(); var e = this.c6(); var f = this.ic(); 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.f4 = function (a) { var b = this.view.cq(); var c = this.view.cm(); var d = this.c1; if (d <= this.bt || d > this.bs || isNaN_(d)) { b.an = null; c.an = null; return; } var e = this.b0; var f = this.a1 != 0; if (!f || e <= this.bt || e > this.bs || isNaN_(e)) { c.an = null; f = false; } var g = a.c; var h = this.cj(); var i = this.c6(); var j = this.ic(); 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.fn = function (a, b) { this.a8 = true; this.view.bo(); }; XamBulletGraph.prototype.fi = function (a, b) { this.a8 = true; this.view.bo(); }; XamBulletGraph.prototype.cj = function () { if (this.as == 0) { return this.bc ? this.ij.height : this.ii.height; } return this.bc ? this.ij.width : this.ii.width; }; XamBulletGraph.prototype.cl = function () { if (this.as == 0) { return this.ij.width * (this.ck - this.cn); } return this.ij.height * (this.ck - this.cn); }; XamBulletGraph.prototype.c5 = function () { if (this.as == 0) { return this.ij.height; } return this.ij.width; }; XamBulletGraph.prototype.c6 = function () { if (this.as == 0) { return this.ij.width; } return this.ij.height; }; XamBulletGraph.prototype.cm = function () { var a = this.cn; if (this.as == 0) { if (this.a9) { a = 1 - this.ck; } return this.ij.left + this.ij.width * a; } if (this.a9) { a = 1 - this.ck; } return this.ij.top + this.ij.height * a; }; XamBulletGraph.prototype.ic = function () { var a = this.ii.left; if (this.bc) { a = 0; } var b = this.cn; if (this.as == 0) { if (this.a9) { b = 1 - this.ck; } return { $type: Point_$type, x: a + this.ii.width * b, y: this.ii.top }; } if (!this.a9) { b = 1 - this.ck; } return { $type: Point_$type, x: a, y: this.ii.top + this.ii.height * b }; }; XamBulletGraph.prototype.fl = function (a, b, c) { switch (a) { case XamBulletGraph.$$p[52]: case XamBulletGraph.$$p[37]: case XamBulletGraph.$$p[41]: case XamBulletGraph.$$p[0]: case XamBulletGraph.$$p[3]: case XamBulletGraph.$$p[56]: case XamBulletGraph.$$p[44]: case XamBulletGraph.$$p[22]: this.view.a5(a, b, c); break; case XamBulletGraph.$$p[28]: this.view.ba(b, c); break; case XamBulletGraph.$$p[31]: this.view.bb(b, c); break; } switch (a) { case XamBulletGraph.$$p[13]: case XamBulletGraph.$$p[14]: if (this.ds != null) { this.aj = new BindingFormatter(); this.aj.j = this.ds; this.aj.d = this.ag; } else { this.aj = null; } this.a8 = true; this.view.bo(); break; case XamBulletGraph.$$p[51]: this.aw.r = this.c8; this.view.bo(); break; case "TransitionProgress": if (this.c0 >= 1) { this.aw.w(); var d = this.am; this.am = this.an; this.an = d; this.fp(); this.fr(); this.fs(); this.fq(); this.fo(); this.fz(this.am); this.f1(this.am); this.f2(this.am); this.f4(this.am); this.f3(this.am); this.f0(this.am); if (this.a1 == 5) { this.ff(); this.view.bo(); return; } else if (this.a1 == 2) { this.a1 = 3; } } this.al.d(this.c0, this.an, this.am); this.fz(this.al); this.f1(this.al); this.f2(this.al); this.f4(this.al); this.f3(this.al); this.f0(this.al); this.view.as(); break; case XamBulletGraph.$$p[57]: case XamBulletGraph.$$p[53]: case XamBulletGraph.$$p[55]: case XamBulletGraph.$$p[52]: case XamBulletGraph.$$p[56]: case XamBulletGraph.$$p[58]: case XamBulletGraph.$$p[37]: case XamBulletGraph.$$p[41]: case XamBulletGraph.$$p[43]: case XamBulletGraph.$$p[36]: case XamBulletGraph.$$p[38]: case XamBulletGraph.$$p[40]: case XamBulletGraph.$$p[0]: case XamBulletGraph.$$p[3]: case XamBulletGraph.$$p[44]: case XamBulletGraph.$$p[22]: case XamBulletGraph.$$p[28]: case XamBulletGraph.$$p[31]: case XamBulletGraph.$$p[20]: case XamBulletGraph.$$p[42]: case XamBulletGraph.$$p[39]: case XamBulletGraph.$$p[29]: case XamBulletGraph.$$p[30]: 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[18]: case XamBulletGraph.$$p[48]: case XamBulletGraph.$$p[49]: case XamBulletGraph.$$p[46]: case XamBulletGraph.$$p[45]: case XamBulletGraph.$$p[47]: case XamBulletGraph.$$p[25]: case XamBulletGraph.$$p[24]: case XamBulletGraph.$$p[23]: case XamBulletGraph.$$p[26]: case "ScaleBackgroundBrush": case "ScaleBackgroundOutline": case "ScaleBackgroundThickness": this.a8 = true; this.view.bo(); break; case XamBulletGraph.$$p[32]: var e = b; var f = c; if (e != null) { var g = e; g.collectionChanged = delegateRemove(g.collectionChanged, runOn(this, this.fw)); } if (f != null) { var h = f; h.collectionChanged = delegateCombine(h.collectionChanged, runOn(this, this.fw)); } this.a8 = true; this.view.bo(); break; case XamBulletGraph.$$p[27]: case XamBulletGraph.$$p[11]: case XamBulletGraph.$$p[21]: case XamBulletGraph.$$p[19]: case XamBulletGraph.$$p[33]: case XamBulletGraph.$$p[34]: this.bt = Math.min(this.b8, this.b7); this.bs = Math.max(this.b8, this.b7); var i = this.cm(); this.ar = new LinearGraphScaler(this.bt, this.bs, i, i + this.cl(), 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.cf))) { this.bu = 1; } else { this.bu = DeviceUtils.a(this.cf); } break; case "ActualPixelScalingRatio": this.view.bf(); break; case XamBulletGraph.$$p[9]: { var j = this.az == 2; this.f8(); 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.f8(); 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.f9(); break; case "ActualHighlightValueOpacity": this.a8 = true; this.view.bo(); break; } this.fm(a); }; XamBulletGraph.prototype.fw = 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.fv)); } } 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) {