UNPKG

igniteui-react-charts

Version:

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

1,487 lines (1,486 loc) 78.6 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 { AxisLabelPanelBase } from "./AxisLabelPanelBase"; import { Boolean_$type, typeCast, markType, Number_$type, enumGetBox, Point_$type, typeGetValue, fromEnum, runOn, markDep } from "igniteui-react-core"; import { AxisLabelPanelBaseView } from "./AxisLabelPanelBaseView"; import { Rect } from "igniteui-react-core"; import { Extensions } from "igniteui-react-core"; import { Axis } from "./Axis"; import { List$1 } from "igniteui-react-core"; import { AxisAngleLabelMode_$type } from "./AxisAngleLabelMode"; import { LabelPosition } from "./LabelPosition"; import { XamDataChart } from "./XamDataChart"; import { CategoryAxisBase } from "./CategoryAxisBase"; import { IAngleScaler_$type } from "./IAngleScaler"; import { DependencyProperty } from "igniteui-react-core"; import { CategoryAxisRenderer } from "./CategoryAxisRenderer"; import { PolarAxisRenderingManager } from "./PolarAxisRenderingManager"; import { AxisLabelManager } from "./AxisLabelManager"; import { ViewportUtils } from "./ViewportUtils"; import { GeometryUtil } from "igniteui-react-core"; import { RadialAxisRenderingParameters } from "./RadialAxisRenderingParameters"; import { CategoryTickmarkValues } from "./CategoryTickmarkValues"; import { SeriesViewer } from "./SeriesViewer"; import { ScalerParams } from "./ScalerParams"; import { AxisRangeChangedEventArgs } from "./AxisRangeChangedEventArgs"; import { LineGeometry } from "igniteui-react-core"; import { PropertyMetadata } from "igniteui-react-core"; import { RangeInfo } from "./RangeInfo"; import { isNaN_, isInfinity } from "igniteui-react-core"; import { NumericAxisBase } from "./NumericAxisBase"; import { LogarithmicTickmarkValues } from "./LogarithmicTickmarkValues"; import { PolarAxisRenderingParameters } from "./PolarAxisRenderingParameters"; import { MathUtil } from "igniteui-react-core"; import { RadialAxisLabelPanel } from "./RadialAxisLabelPanel"; import { LinearTickmarkValues } from "./LinearTickmarkValues"; import { IPolarRadialRenderingParameters_$type } from "./IPolarRadialRenderingParameters"; import { PathGeometry } from "igniteui-react-core"; import { PathFigure } from "igniteui-react-core"; import { ArcSegment } from "igniteui-react-core"; import { Size } from "igniteui-react-core"; import { CategoryAxisBaseView } from "./CategoryAxisBaseView"; import { AxisDefaults } from "./AxisDefaults"; import { NumericAxisBaseView } from "./NumericAxisBaseView"; import { RectUtil } from "igniteui-react-core"; import { Convert } from "igniteui-react-core"; /** * @hidden */ var AngleAxisLabelPanel = /** @class */ /*@__PURE__*/ (function (_super) { __extends(AngleAxisLabelPanel, _super); function AngleAxisLabelPanel() { var _this = _super.call(this) || this; _this.dh = false; _this.dq = null; _this.dm = 0; _this.dj = 0; _this.dl = 0; _this.dk = 0; _this.di = 0; return _this; } AngleAxisLabelPanel.prototype.af = function () { return new AngleAxisLabelPanelView(this); }; AngleAxisLabelPanel.prototype.cn = function (a) { _super.prototype.cn.call(this, a); this.dg = a; }; AngleAxisLabelPanel.prototype.aw = function (a, b) { if (!Extensions.b(b)) { return false; } if (this.ae == null || this.ae.o8.isEmpty) { return _super.prototype.aw.call(this, a, b); } return true; }; AngleAxisLabelPanel.prototype.bc = function () { var a = new List$1(Rect.$, 0); var b = new List$1(Boolean_$type, 0); if (this.bi.count != this.bh.count) { return a; } var c = 1; if (typeCast(CategoryAngleAxis.$, this.ae) !== null) { c = this.ae.rg(); } else if (typeCast(NumericAngleAxis.$, this.ae) !== null) { c = this.ae.td(); } if (c == 2) { this.dg.a0(a, b); } else { this.dg.a1(a, b); } var d = false; this.aq = this.ap(a, b); if (!this.ae.db()) { d = true; switch (c) { case 1: this.ds(); break; case 2: this.dr(); break; } } else { d = true; this.dg.ab(); } if (d) { for (var e = 0; e < a.count; e++) { var f = this.bi._inner[e]; var g = this.bh._inner[e]; var h = a._inner[e]; var i = this.dq(g.h, h.width, h.height); var j = i.x - this.br(f) / 2; var k = i.y - this.bq(f) / 2; h.x = j; h.y = k; a._inner[e] = h; } } return a; }; AngleAxisLabelPanel.prototype.ds = function () { this.bo = this.dm / 2; this.bo = this.bo + this.dn(); }; AngleAxisLabelPanel.prototype.dr = function () { this.bo = 5; this.bo = this.bo + this.dp(); }; AngleAxisLabelPanel.prototype.dp = function () { var a; var b; b = this.ae; a = null; if (b != null) { a = typeCast(XamDataChart.$, b.b7); } if (a == null || b == null) { return 0; } var c = new List$1(Axis.$, 0); for (var d = 0; d < a.zr.count; d++) { var e = a.zr._inner[d]; if ((typeCast(NumericAngleAxis.$, e) !== null || typeCast(CategoryAngleAxis.$, e) !== null) && typeCast(AngleAxisLabelPanel.$, e.a1) !== null && e.a1.bi.count > 0 && (!e.db()) && !e.c2() && (e.an == null || this.ae.an == null || e.an.ti == b.an.ti)) { c.add(e); } } var f = c.indexOf(b); if (f == -1) { return 0; } var g = 0; if (f > 0) { if (typeCast(CategoryAngleAxis.$, c._inner[f - 1]) !== null) { var h = c._inner[f - 1]; if (h.rf == 2) { g += h.a1.di; } else { g += c._inner[f - 1].a1.bo; } } else if (typeCast(NumericAngleAxis.$, c._inner[f - 1]) !== null) { var i = c._inner[f - 1]; if (i.rf == 2) { g += i.a1.di; } else { g += c._inner[f - 1].a1.bo; } } } return g; }; AngleAxisLabelPanel.prototype.dn = function () { var a; var b; b = this.ae; a = null; if (b != null) { a = typeCast(XamDataChart.$, b.b7); } if (a == null || b == null) { return 0; } var c = new List$1(Axis.$, 0); for (var d = 0; d < a.zr.count; d++) { var e = a.zr._inner[d]; if ((typeCast(NumericAngleAxis.$, e) !== null || typeCast(CategoryAngleAxis.$, e) !== null) && typeCast(AngleAxisLabelPanel.$, e.a1) !== null && e.a1.bi.count > 0 && (!e.db()) && !e.c2() && (e.an == null || this.ae.an == null || e.an.ti == b.an.ti)) { c.add(e); } } var f = c.indexOf(b); if (f == -1) { return 0; } var g = 0; var h = 5; if (f == 0) { g += h; } else { if (typeCast(CategoryAngleAxis.$, c._inner[f - 1]) !== null) { var i = c._inner[f - 1]; if (i.rf == 2) { g += i.a1.di; } else { g += c._inner[f - 1].a1.bo; } } else if (typeCast(NumericAngleAxis.$, c._inner[f - 1]) !== null) { var j = c._inner[f - 1]; if (j.tc == 2) { g += j.a1.di; } else { g += c._inner[f - 1].a1.bo; } } g += c._inner[f].a1.bo * 2 + h; } return g; }; AngleAxisLabelPanel.prototype.aj = function () { return 4; }; AngleAxisLabelPanel.prototype.a3 = function (a) { return a == 4 || a == 5; }; AngleAxisLabelPanel.$t = markType(AngleAxisLabelPanel, 'AngleAxisLabelPanel', AxisLabelPanelBase.$); return AngleAxisLabelPanel; }(AxisLabelPanelBase)); export { AngleAxisLabelPanel }; /** * @hidden */ var CategoryAngleAxis = /** @class */ /*@__PURE__*/ (function (_super) { __extends(CategoryAngleAxis, _super); function CategoryAngleAxis() { var _this = _super.call(this) || this; _this.rn = null; _this.rk = null; _this.ro = false; _this.rv = NaN; _this.rl = null; _this.rw = 0; _this.rt = 0; _this.ru = 0; _this.sc = 1; _this.ab = CategoryAngleAxis.$; _this.rk = _this.rj(); _this.rn = new PolarAxisRenderingManager(); return _this; } CategoryAngleAxis.prototype.bo = function () { return new CategoryAngleAxisView(this); }; CategoryAngleAxis.prototype.k8 = function (a) { _super.prototype.k8.call(this, a); this.ri = a; }; CategoryAngleAxis.prototype.al = function () { return new CategoryAngleAxis(); }; CategoryAngleAxis.prototype.ko = function (a) { _super.prototype.ko.call(this, a); this.kr(a, "ActualInterval"); this.kr(a, "ActualMinorInterval"); this.kr(a, "StartAngleOffset"); this.kr(a, "LabelMode"); }; CategoryAngleAxis.prototype.kr = function (a, b) { _super.prototype.kr.call(this, a, b); var c = typeCast(CategoryAngleAxis.$, a); if (c == null) { return; } var d = this; if (b == "ActualMinorInterval") { c.r9 = Axis.gu(d.r0, d.ry); } if (b == "ActualInterval") { c.r8 = Axis.gu(d.rz, d.rx); } if (b == "StartAngleOffset") { c.r8 = Axis.gu(d.r1, d.sb); } if (b == "LabelMode") { c.rf = d.re != 0 ? d.re : d.rf; } }; CategoryAngleAxis.prototype.get_dc = function () { return true; }; CategoryAngleAxis.prototype.ky = function (a) { _super.prototype.ky.call(this, a); switch (a) { case CategoryAngleAxis.$$p[0]: case CategoryAngleAxis.$$p[2]: this.kt(a); break; case CategoryAngleAxis.$$p[1]: case CategoryAngleAxis.$$p[3]: this.ku(a); break; } }; CategoryAngleAxis.prototype.a0 = function () { var _this = this; var a = new AngleAxisLabelPanel(); a.dq = function (b, c, d) { var e = _this.b7 != null ? _this.b7.ys : Rect.empty; var f = !e.isEmpty ? _this.o8 : Rect.empty; var g = _this.o3(); switch (_this.rf) { case 2: return _this.s1(b, c, d, { $type: Point_$type, x: 0.5, y: 0.5 }, e, f, g, _this.a1.bo); case 0: case 1: default: return _this.s2(b, { $type: Point_$type, x: 0.5, y: 0.5 }, e, f, g, _this.a1.bo); } }; return a; }; CategoryAngleAxis.prototype.rr = function (a) { return false; }; CategoryAngleAxis.prototype.sl = function () { return null; }; CategoryAngleAxis.prototype.sa = function (a) { return Math.round(a * Math.pow(10, 10)) / Math.pow(10, 10); }; CategoryAngleAxis.prototype.rj = function () { var _this = this; var a = ((function () { var $ret = new AxisLabelManager(); $ret.a = _this; $ret.f = _this.es; $ret.e = _this.er; $ret.b = _this.a1; return $ret; })()); if (this.a4 != null) { this.a4.registerAxis(this); } var b = new CategoryAxisRenderer(a); b.u = function () { var c = _this.bp.bb(); var d = _this.bp.be(); var e = _this.bp.bc(); var f = _this.bp.bd(); _this.mc(); _this.km(c); _this.km(d); _this.km(e); _this.km(f); }; b.o = function (c, d) { return !d.isEmpty && !c.isEmpty && _this.rm != null; }; b.d = function (c, d, e, f) { return _this.rh(c, d, e, f); }; b.v = function () { if (!_this.ro) { _this.ro = true; _this.rm.ee(); _this.ro = false; } }; b.g = function (c, d) { var e = typeGetValue(c); if (e == _this.qc - 1) { if (_this.ds) { if (_this.rr(e)) { return _this.sl(); } } } if (e > _this.qc - 1) { e -= _this.qc; } if (_this.rs(e)) { return null; } var f = _this.po.item(e); return _this.hy(f); }; b.b.c = function (c) { var e_1, _a; if ((_this.a4 == null || _this.a4.visibility == 0) && _this.rm != null && _this.rv != c) { var d = typeCast(XamDataChart.$, _this.b7); if (d == null) { return; } _this.rv = c; _this.a1.bn = c; d.ps(); try { for (var _b = __values(fromEnum(d.zr)), _c = _b.next(); !_c.done; _c = _b.next()) { var e = _c.value; if (e != _this && typeCast(AngleAxisLabelPanel.$, e.a1) !== null) { e.bp.ap(); } } } 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; } } } }; b.k = function (c, d, e) { var f = typeCast(RadialAxisRenderingParameters.$, c); _this.rn.o(d, e, c.aa, c.z, c.ab, f.minLength, f.maxLength, f.center); }; b.l = function (c, d, e, f) { var g = typeCast(RadialAxisRenderingParameters.$, c); _this.rn.p(d, e, f, g.aa, g.z, c.ab, g.minLength, g.maxLength, g.center); }; b.m = function (c, d) { return _this.getScaledAngle(d); }; b.q = function (c, d) { if (_this.sa(d - _this.rw) < 0) { return false; } if (_this.sa(d - _this.rw - (2 * Math.PI)) > 0) { return false; } return true; }; b.j = function (c) { var d = typeCast(RadialAxisRenderingParameters.$, c); if (d.e == d.k._inner[0]) { _this.rn.k(c.u, c.n, c.aa, c.z, c.ab, d.center, d.minAngle, d.maxAngle); } }; b.e = function (c) { c.n = _this.r2(); c.r = c.n; }; b.p = function (c, d, e) { var f = typeCast(RadialAxisRenderingParameters.$, c); if (e) { return false; } var g = _this.s2(d, f.center, c.ab, c.aa, c.z, 0); if (g.x < c.aa.right && g.x >= c.aa.left && g.y < c.aa.bottom && g.y >= c.aa.top) { return true; } return false; }; b.a = function (c, d, e, f) { var g = c.z; var h = new ScalerParams(0, c.ab, c.aa, _this.dn, g); var i = d; if (_this.categoryMode != 0) { var j = (e * f) + 1; j = Math.min(j, _this.qc); var k = _this.f7(j, h); i = (d + k) / 2; } return i; }; b.f = runOn(this, this.getGroupCenter); b.i = runOn(this, this.r7); return b; }; CategoryAngleAxis.prototype.rs = function (a) { return false; }; CategoryAngleAxis.prototype.s2 = function (a, b, c, d, e, f) { var g = this.r2(); var h = ViewportUtils.a(f, c, d, e); if (this.a4 != null && (this.a4.c == 5 || this.a4.c == 1)) { h *= -1; } var i = b.x + (g + h) * Math.cos(a); var j = b.y + (g + h) * Math.sin(a); i = ViewportUtils.e(i, c, d, e); j = ViewportUtils.i(j, c, d, e); return { $type: Point_$type, x: i, y: j }; }; CategoryAngleAxis.prototype.s1 = function (a, b, c, d, e, f, g, h) { if (!isNaN_(b) && !isNaN_(c)) { var i = this.r2(); var j = b / f.width; var k = c / f.width; var l = ViewportUtils.a(h, e, f, g); var m = GeometryUtil.i(i, a, j, k); var n = d.x + (m + l) * Math.cos(a); var o = d.y + (m + l) * Math.sin(a); n = ViewportUtils.e(n, e, f, g); o = ViewportUtils.i(o, e, f, g); return { $type: Point_$type, x: n, y: o }; } else { return this.s2(a, d, e, f, g, h); } }; CategoryAngleAxis.prototype.r2 = function () { if (this.rm == null) { return 0; } if (!this.c2()) { return this.rm.tn(); } else { return this.rm.to((this.ht)); } }; CategoryAngleAxis.prototype.rh = function (a, b, c, d) { if (this.po == null) { return null; } var e = new RadialAxisRenderingParameters(); var f = this.qd - 1; var g = this.bp.bb(); var h = this.bp.be(); var i = this.bp.bc(); var j = this.bp.bd(); e.u = g; e.x = h; e.v = i; e.w = j; e.l = f; e.m = 0; e.h = false; e.aa = a; e.z = c; e.y = d; e.ab = b; e.g = this.rq(); e.p = this.r8; e.o = this.go(); e.s = this.se(); e.q = this.r9; e.t = this.hz; var k = this.rn.h(b, a, c); var l = this.rn.i(b, a, c); var m = 0.5 * this.rm.ti; var n = 0.5 * this.rm.th; var o = k; var p = l; var q = this.rm.tn(); if (isNaN_(q) || isInfinity(q)) { return null; } if (p >= m) { p = q; } if (o < n) { o = n; } var r = a.width; this.rn.m(b, a, c, e, 0, this.qd, this.dn, runOn(this, this.getUnscaledAngle), r); var s = { $type: Point_$type, x: 0.5, y: 0.5 }; e.center = s; e.maxLength = p; e.minLength = o; e.effectiveMaximum = q; e.af = this.qd; e.ac = this.categoryMode; e.ae = true; e.ad = this.dn; e.ag = this.qe; e.f = new CategoryTickmarkValues(); e.j = this.eb; return e; }; CategoryAngleAxis.prototype.se = function () { return -1; }; CategoryAngleAxis.prototype.getMinMaxAngle = function (a, b, c, d, e) { var f = this.rn.n(a, b, c, d, e); d = f.p3; e = f.p4; return { p3: d, p4: e }; }; CategoryAngleAxis.prototype.ac = function () { _super.prototype.ac.call(this); this.l0(false); }; Object.defineProperty(CategoryAngleAxis.prototype, "rm", { get: function () { if (this.rl != null) { return this.rl; } var a = typeCast(XamDataChart.$, this.b7); if (a != null) { for (var b = 0; b < a.zr.count; b++) { if (typeCast(NumericRadiusAxis.$, a.zr._inner[b]) !== null) { return a.zr._inner[b]; } } } return this.rl; }, set: function (a) { this.rl = a; }, enumerable: false, configurable: true }); CategoryAngleAxis.prototype.ap = function () { return this.rm; }; CategoryAngleAxis.prototype.rg = function () { if (this.rf == 0) { return 1; } else { return this.rf; } }; CategoryAngleAxis.prototype.getCategorySize = function (a, b, c) { return 2 * Math.PI / this.qc; }; CategoryAngleAxis.prototype.get_rp = function () { return false; }; Object.defineProperty(CategoryAngleAxis.prototype, "rp", { get: function () { return this.get_rp(); }, enumerable: false, configurable: true }); CategoryAngleAxis.prototype.r4 = function (a, b, c, d) { return this.p1(b, c, d); }; CategoryAngleAxis.prototype.p1 = function (a, b, c) { var d = this.p8(a, b, c); var e = 0; if (!isNaN_(this.p7)) { e = Math.min(this.p7, 1); } var f = 1 - 0.5 * d; return this.getCategorySize(a, b, c) * f / (this.qe - (this.qe - 1) * e); }; CategoryAngleAxis.prototype.r3 = function (a, b, c, d, e) { return this.getGroupCenter(b, c, d, e); }; CategoryAngleAxis.prototype.getGroupCenter = function (a, b, c, d) { var e = 0.5; if (this.qe > 1) { var f = this.p8(b, c, d); var g = 0; if (!isNaN_(this.p7)) { g = Math.min(this.p7, 1); } var h = 1 - 0.5 * f; var i = h / (this.qe - (this.qe - 1) * g); var j = (h - i) / (this.qe - 1); e = 0.25 * f + 0.5 * i + a * j; } return this.getCategorySize(b, c, d) * e; }; CategoryAngleAxis.prototype.r7 = function (a) { var b = 0.5; if (this.qe > 1) { var c = this.p8(Rect.empty, Rect.empty, Rect.empty); var d = 0; if (!isNaN_(this.p7)) { d = Math.min(this.p7, 1); } var e = 1 - 0.5 * c; var f = e / (this.qe - (this.qe - 1) * d); var g = (e - f) / (this.qe - 1); b = 0.25 * c + 0.5 * f + a * g; } return b; }; CategoryAngleAxis.prototype.l1 = function (a) { _super.prototype.l1.call(this, a); var b = this.b7 != null ? this.b7.ys : Rect.empty; var c = !b.isEmpty ? this.o8 : Rect.empty; var d = this.o3(); var e = this.o2(); var f = this.rk.c(a, c, b, d, e); if (f != null) { this.rx = f.f.m; this.ry = f.f.l; } }; CategoryAngleAxis.prototype.r6 = function (a, b, c) { var d; var e; var f = this.rn.n(c, a, b, d, e); d = f.p3; e = f.p4; if (d == 0) { if (this.dn) { return this.qc; } else { return 0; } } var g = this.getUnscaledAngle(d); if (g < 0 || g > this.qc) { g = this.getUnscaledAngle(d + Math.PI * 2); } return g; }; CategoryAngleAxis.prototype.r5 = function (a, b, c) { var d; var e; var f = this.rn.n(c, a, b, d, e); d = f.p3; e = f.p4; if (e > Math.PI * 2) { e = e - Math.PI * 2; } if (e == Math.PI * 2) { if (this.dn) { return 0; } else { return this.qc; } } var g = this.getUnscaledAngle(e); if (g < 0 || g > this.qc) { g = this.getUnscaledAngle(e + Math.PI * 2); } return g; }; CategoryAngleAxis.prototype.getScaledAngle = function (a) { var b = this.qc; var c = b >= 2 ? (a) / (b) : b == 1 ? 0.5 : NaN; if (this.dp) { c = 1 - c; } return (c * 2 * Math.PI) + this.rw; }; CategoryAngleAxis.prototype.getUnscaledAngle = function (a) { if (a < this.rw) { a += 2 * Math.PI; } var b = (a - this.rw) / (2 * Math.PI); if (this.dn) { b = 1 - b; } return b * (this.qc); }; CategoryAngleAxis.prototype.f7 = function (a, b) { return this.getScaledAngle(a); }; CategoryAngleAxis.prototype.ga = function (a, b) { return this.getUnscaledAngle(a); }; CategoryAngleAxis.prototype.fr = function (a) { var b = { $type: Point_$type, x: 0.5, y: 0.5 }; var c = Math.sqrt(Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2)); var d = Math.acos((a.x - b.x) / c); if ((a.y - b.y) < 0) { d = (2 * Math.PI) - d; } return d; }; CategoryAngleAxis.prototype.gj = function (a) { var b = a - this.rw; if (b < 0) { b += Math.PI * 2; } if (b > Math.PI * 2) { b -= Math.PI * 2; } return b; }; CategoryAngleAxis.prototype.lc = function (a, b, c, d) { var e_2, _a, e_3, _b, e_4, _c; _super.prototype.lc.call(this, a, b, c, d); var e = typeCast(XamDataChart.$, this.b7); switch (b) { case "CrossingAxis": var f = typeCast(NumericRadiusAxis.$, d); this.ss(f); if (f != null) { f.tx(this); } this.d1 = true; this.l0(false); break; case CategoryAngleAxis.$$p[5]: this.rw = this.sb; while (this.rw < 0) { this.rw += 360; } while (this.rw >= 360) { this.rw -= 360; } this.rw = (this.rw * Math.PI) / 180; this.d1 = true; this.l0(false); try { for (var _d = __values(fromEnum(this.et)), _e = _d.next(); !_e.done; _e = _d.next()) { var g = _e.value; g.r9(false); g.q1(); } } catch (e_2_1) { e_2 = { error: e_2_1 }; } finally { try { if (_e && !_e.done && (_a = _d.return)) _a.call(_d); } finally { if (e_2) throw e_2.error; } } break; case "Label": case CategoryAngleAxis.$$p[4]: if (e != null) { try { for (var _f = __values(fromEnum(e.zr)), _g = _f.next(); !_g.done; _g = _f.next()) { var h = _g.value; h.d1 = true; h.lz(); } } catch (e_3_1) { e_3 = { error: e_3_1 }; } finally { try { if (_g && !_g.done && (_b = _f.return)) _b.call(_f); } finally { if (e_3) throw e_3.error; } } } break; case "CrossingValue": if (e != null) { try { for (var _h = __values(fromEnum(e.zr)), _j = _h.next(); !_j.done; _j = _h.next()) { var i = _j.value; if (typeCast(NumericAngleAxis.$, i) !== null || typeCast(CategoryAngleAxis.$, i) !== null) { i.d1 = true; i.lz(); } } } catch (e_4_1) { e_4 = { error: e_4_1 }; } finally { try { if (_j && !_j.done && (_c = _h.return)) _c.call(_h); } finally { if (e_4) throw e_4.error; } } } break; case "LabelSettings": this.rk = this.rj(); this.sq(); this.d1 = true; this.l0(false); break; case CategoryAngleAxis.$$p[0]: case CategoryAngleAxis.$$p[2]: case CategoryAngleAxis.$$p[1]: case CategoryAngleAxis.$$p[3]: this.ky(b); break; } }; CategoryAngleAxis.prototype.sq = function () { this.rv = NaN; }; CategoryAngleAxis.prototype.ss = function (a) { this.rm = a; }; Object.defineProperty(CategoryAngleAxis.prototype, "r8", { get: function () { return this.c(CategoryAngleAxis.sx); }, set: function (a) { this.h(CategoryAngleAxis.sx, a); }, enumerable: false, configurable: true }); Object.defineProperty(CategoryAngleAxis.prototype, "rx", { get: function () { return this.rt; }, set: function (a) { if (this.rx != a) { var b = this.rt; this.rt = a; this.lu("ActualInterval", b, this.rx); } }, enumerable: false, configurable: true }); CategoryAngleAxis.prototype.gk = function () { return this.rx; }; Object.defineProperty(CategoryAngleAxis.prototype, "r9", { get: function () { return this.c(CategoryAngleAxis.sz); }, set: function (a) { this.h(CategoryAngleAxis.sz, a); }, enumerable: false, configurable: true }); Object.defineProperty(CategoryAngleAxis.prototype, "ry", { get: function () { return this.ru; }, set: function (a) { if (this.ry != a) { var b = this.ru; this.ru = a; this.lu("ActualMinorInterval", b, this.ry); } }, enumerable: false, configurable: true }); CategoryAngleAxis.prototype.rq = function () { return !isNaN_(this.r8); }; CategoryAngleAxis.prototype.get_bm = function () { return 2; }; Object.defineProperty(CategoryAngleAxis.prototype, "bm", { get: function () { return this.get_bm(); }, enumerable: false, configurable: true }); CategoryAngleAxis.prototype.eg = function () { if (this.d1 && this.eh) { this.b1 = this.b0(); } if (this.po == null) { return false; } var a = this.po.count; if (a != this.sd) { var b = new AxisRangeChangedEventArgs(0, 1, 1, this.sd, a); this.sd = a; this.lv(b); return true; } return false; }; Object.defineProperty(CategoryAngleAxis.prototype, "sd", { get: function () { return this.sc; }, set: function (a) { this.sc = a; }, enumerable: false, configurable: true }); CategoryAngleAxis.prototype.ox = function (a, b, c, d, e) { var f = typeCast(RadialAxisRenderingParameters.$, this.rk.d(c, b, d, e)); if (f == null) { return null; } var g = Math.cos(a); var h = Math.sin(a); var i = f.center.x + g * f.minLength; var j = f.center.y + h * f.minLength; var k = f.center.x + g * f.maxLength; var l = f.center.y + h * f.maxLength; i = ViewportUtils.e(i, b, c, d); j = ViewportUtils.i(j, b, c, d); k = ViewportUtils.e(k, b, c, d); l = ViewportUtils.i(l, b, c, d); var m = new LineGeometry(); m.d = { $type: Point_$type, x: i, y: j }; m.c = { $type: Point_$type, x: k, y: l }; return m; }; Object.defineProperty(CategoryAngleAxis.prototype, "isVertical", { get: function () { return this.dz; }, enumerable: false, configurable: true }); CategoryAngleAxis.prototype.j$d = function (a, b) { return this.ga.apply(this, arguments); }; CategoryAngleAxis.prototype.j$c = function (a, b) { return this.f7.apply(this, arguments); }; CategoryAngleAxis.prototype.j$e = function (a, b, c, d, e) { this.k2.apply(this, arguments); }; CategoryAngleAxis.prototype.j$f = function (a, b, c, d) { this.k3.apply(this, arguments); }; CategoryAngleAxis.prototype.j$g = function (a, b, c, d) { this.k4.apply(this, arguments); }; Object.defineProperty(CategoryAngleAxis.prototype, "j$b", { get: function () { return this.dn; }, enumerable: false, configurable: true }); CategoryAngleAxis.prototype.j$a = function () { return this.ag.apply(this, arguments); }; CategoryAngleAxis.$t = markType(CategoryAngleAxis, 'CategoryAngleAxis', CategoryAxisBase.$, [IAngleScaler_$type]); CategoryAngleAxis.sx = DependencyProperty.i("Interval", Number_$type, CategoryAngleAxis.$, new PropertyMetadata(2, NaN, function (a, b) { a.lu("Interval", b.oldValue, b.newValue); a.l0(false); })); CategoryAngleAxis.sz = DependencyProperty.i("MinorInterval", Number_$type, CategoryAngleAxis.$, new PropertyMetadata(2, NaN, function (a, b) { (typeCast(CategoryAngleAxis.$, a)).lu("MinorInterval", b.oldValue, b.newValue); (typeCast(CategoryAngleAxis.$, a)).l0(false); })); CategoryAngleAxis.$$p = markDep(DependencyProperty, PropertyMetadata, CategoryAngleAxis, 'lu', ['CompanionAxisInterval:rz:st', [1, NaN], 'CompanionAxisLabelMode:re:su', [AxisAngleLabelMode_$type, enumGetBox(AxisAngleLabelMode_$type, 0)], 'CompanionAxisMinorInterval:r0:sv', [1, NaN], 'CompanionAxisStartAngleOffset:r1:sw', [1, NaN], 'LabelMode:rf:sy', [AxisAngleLabelMode_$type, enumGetBox(AxisAngleLabelMode_$type, 0)], 'StartAngleOffset:sb:s0', [1, 0]]); return CategoryAngleAxis; }(CategoryAxisBase)); export { CategoryAngleAxis }; /** * @hidden */ var NumericAngleAxis = /** @class */ /*@__PURE__*/ (function (_super) { __extends(NumericAngleAxis, _super); function NumericAngleAxis() { var _this = _super.call(this) || this; _this.th = null; _this.ti = false; _this.tj = NaN; _this.tk = 0; _this.tf = null; _this.ab = NumericAngleAxis.$; _this.th = new PolarAxisRenderingManager(); _this.py = _this.pw(); return _this; } NumericAngleAxis.prototype.bo = function () { return new NumericAngleAxisView(this); }; NumericAngleAxis.prototype.k8 = function (a) { _super.prototype.k8.call(this, a); this.te = a; }; NumericAngleAxis.prototype.al = function () { return new NumericAngleAxis(); }; NumericAngleAxis.prototype.ko = function (a) { _super.prototype.ko.call(this, a); this.kr(a, "LabelMode"); this.kr(a, "StartAngleOffset"); }; NumericAngleAxis.prototype.kr = function (a, b) { _super.prototype.kr.call(this, a, b); var c = typeCast(NumericAngleAxis.$, a); if (c == null) { return; } var d = this; if (b == "StartAngleOffset") { c.q7 = Axis.gu(d.tl, d.tp); } if (b == "LabelMode") { c.tc = d.tb != 0 ? d.tb : d.tc; } }; NumericAngleAxis.prototype.get_dc = function () { return true; }; NumericAngleAxis.prototype.a0 = function () { var _this = this; var a = new AngleAxisLabelPanel(); a.dq = function (b, c, d) { var e = _this.b7 != null ? _this.b7.ys : Rect.empty; var f = !e.isEmpty ? _this.o8 : Rect.empty; var g = _this.o3(); return _this.t1(b, { $type: Point_$type, x: 0.5, y: 0.5 }, e, f, g, _this.a1.bo); }; return a; }; NumericAngleAxis.prototype.tm = function () { if (this.tg == null) { return 0; } if (!this.c2()) { return this.tg.tn(); } else { return this.tg.to((this.ht)); } }; NumericAngleAxis.prototype.to = function (a) { return Math.round(a * Math.pow(10, 10)) / Math.pow(10, 10); }; NumericAngleAxis.prototype.pw = function () { var _this = this; var a = _super.prototype.pw.call(this); a.b.c = function (b) { var e_5, _a; if ((_this.a4 == null || _this.a4.visibility == 0) && _this.tg != null && _this.tj != b) { var c = typeCast(XamDataChart.$, _this.b7); if (c == null) { return; } _this.tj = b; _this.a1.bn = b; c.ps(); try { for (var _b = __values(fromEnum(c.zr)), _c = _b.next(); !_c.done; _c = _b.next()) { var d = _c.value; if (d != _this && typeCast(AngleAxisLabelPanel.$, d.a1) !== null) { d.bp.ap(); } } } 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; } } } }; a.e = function (b) { b.n = _this.tm(); b.r = b.n; }; a.j = function (b) { var c = typeCast(PolarAxisRenderingParameters.$, b); if (c.e == c.k._inner[0]) { _this.th.k(b.u, b.n, b.aa, b.z, b.ab, c.center, c.minAngle, c.maxAngle); } }; a.k = function (b, c, d) { var e = typeCast(PolarAxisRenderingParameters.$, b); _this.th.o(c, d, b.aa, b.z, b.ab, e.minLength, e.maxLength, e.center); }; a.l = function (b, c, d, e) { var f = typeCast(PolarAxisRenderingParameters.$, b); _this.th.p(c, d, e, f.aa, f.z, b.ab, f.minLength, f.maxLength, f.center); }; a.d = function (b, c, d, e) { var f = typeCast(PolarAxisRenderingParameters.$, _this.pz(b, c, d, e)); return f; }; a.v = function () { if (!_this.ti) { _this.ti = true; _this.tg.ee(); _this.ti = false; } }; a.m = function (b, c) { return _this.getScaledAngle(c); }; a.o = function (b, c) { return !c.isEmpty && !b.isEmpty && _this.tg != null; }; a.q = function (b, c) { if (_this.to(c - _this.tk) < 0) { return false; } if (_this.to(c - _this.tk - (2 * Math.PI)) > 0) { return false; } return true; }; a.p = function (b, c, d) { var e = typeCast(PolarAxisRenderingParameters.$, b); var f = _this.t1(_this.getScaledAngle(e.l), e.center, b.ab, b.aa, b.z, 0); var g = _this.t1(c, e.center, b.ab, b.aa, b.z, 0); if (d && MathUtil.h(f.x - g.x, f.y - g.y) < 2) { return false; } if (g.x < b.aa.right && g.x >= b.aa.left && g.y < b.aa.bottom && g.y >= b.aa.top) { return true; } return false; }; a.r = function (b, c, d, e) { if (c < b.m && typeCast(LogarithmicTickmarkValues.$, b.f) !== null) { return b.m; } else if (c > b.l && (typeCast(LogarithmicTickmarkValues.$, b.f) !== null || b.h)) { return b.l; } return c; }; return a; }; NumericAngleAxis.prototype.t1 = function (a, b, c, d, e, f) { var g = this.tm(); var h = ViewportUtils.a(f, c, d, e); if (this.a4 != null && (this.a4.c == 5 || this.a4.c == 1)) { h *= -1; } var i = b.x + (g + h) * Math.cos(a); var j = b.y + (g + h) * Math.sin(a); i = ViewportUtils.e(i, c, d, e); j = ViewportUtils.i(j, c, d, e); return { $type: Point_$type, x: i, y: j }; }; NumericAngleAxis.prototype.f7 = function (a, b) { return this.getScaledAngle(a); }; NumericAngleAxis.prototype.getScaledAngle1 = function (a, b, c) { var d = 0; if (b) { d = (Math.log(a) - this.q9) / (this.q8 - this.q9); } else { d = (a - this.qy) / (this.qx - this.qy); } if (c) { d = 1 - d; } return (d * 2 * Math.PI) + this.tk; }; NumericAngleAxis.prototype.getScaledAngle = function (a) { return this.getScaledAngle1(a, this.qj, this.dp); }; NumericAngleAxis.prototype.ga = function (a, b) { return this.getUnscaledAngle(a); }; NumericAngleAxis.prototype.getUnscaledAngle = function (a) { var b = (a - this.tk) / (2 * Math.PI); if (this.dn) { b = 1 - b; } if (this.qj) { return Math.exp(b * (this.q8 - this.q9) + this.q9); } else { return this.qy + b * (this.qx - this.qy); } }; NumericAngleAxis.prototype.td = function () { if (this.tc == 0) { return 1; } else { return this.tc; } }; NumericAngleAxis.prototype.lc = function (a, b, c, d) { var e_6, _a, e_7, _b, e_8, _c; _super.prototype.lc.call(this, a, b, c, d); var e = typeCast(XamDataChart.$, this.b7); switch (b) { case "CrossingAxis": var f = typeCast(NumericRadiusAxis.$, d); this.tw(f); if (f != null) { f.tx(this); } this.l0(false); break; case NumericAngleAxis.$$p[3]: this.tk = this.tp; while (this.tk < 0) { this.tk += 360; } while (this.tk >= 360) { this.tk -= 360; } this.tk = (this.tp * Math.PI) / 180; this.l0(false); try { for (var _d = __values(fromEnum(this.ep())), _e = _d.next(); !_e.done; _e = _d.next()) { var g = _e.value; g.r9(false); g.q1(); } } catch (e_6_1) { e_6 = { error: e_6_1 }; } finally { try { if (_e && !_e.done && (_a = _d.return)) _a.call(_d); } finally { if (e_6) throw e_6.error; } } break; case "Label": if (e != null) { try { for (var _f = __values(fromEnum(e.zr)), _g = _f.next(); !_g.done; _g = _f.next()) { var h = _g.value; h.lz(); } } catch (e_7_1) { e_7 = { error: e_7_1 }; } finally { try { if (_g && !_g.done && (_b = _f.return)) _b.call(_f); } finally { if (e_7) throw e_7.error; } } } break; case "CrossingValue": if (e != null) { try { for (var _h = __values(fromEnum(e.zr)), _j = _h.next(); !_j.done; _j = _h.next()) { var i = _j.value; if (typeCast(NumericAngleAxis.$, i) !== null || typeCast(CategoryAngleAxis.$, i) !== null) { i.lz(); } } } catch (e_8_1) { e_8 = { error: e_8_1 }; } finally { try { if (_j && !_j.done && (_c = _h.return)) _c.call(_h); } finally { if (e_8) throw e_8.error; } } } break; case "LabelSettings": this.py = this.pw(); this.tu(); this.d1 = true; this.l0(false); break; case NumericAngleAxis.$$p[0]: case NumericAngleAxis.$$p[1]: this.ky(b); break; } }; NumericAngleAxis.prototype.ky = function (a) { _super.prototype.ky.call(this, a); switch (a) { case NumericAngleAxis.$$p[0]: case NumericAngleAxis.$$p[1]: this.ku(a); break; } }; NumericAngleAxis.prototype.tu = function () { this.tj = NaN; }; NumericAngleAxis.prototype.p0 = function () { return new PolarAxisRenderingParameters(); }; NumericAngleAxis.prototype.pz = function (a, b, c, d) { var e = typeCast(PolarAxisRenderingParameters.$, _super.prototype.pz.call(this, a, b, c, d)); var f = this.th.h(b, a, c); var g = this.th.i(b, a, c); var h = 0.5 * this.tg.ti; var i = 0.5 * this.tg.th; var j = f; var k = g; var l = this.tg.tn(); if (isNaN_(l) || isInfinity(l)) { return null; } if (k >= h) { k = l; } if (j < i) { j = i; } var m = a.width; this.th.m(b, a, c, e, this.qy, this.qx, this.dn, runOn(this, this.getUnscaledAngle), m); var n = { $type: Point_$type, x: 0.5, y: 0.5 }; e.center = n; e.maxLength = k; e.minLength = j; e.effectiveMaximum = l; return e; }; NumericAngleAxis.prototype.getMinMaxAngle = function (a, b, c, d, e) { var f = this.th.n(a, b, c, d, e); d = f.p3; e = f.p4; return { p3: d, p4: e }; }; NumericAngleAxis.prototype.l1 = function (a) { _super.prototype.l1.call(this, a); var b = this.b7 != null ? this.b7.ys : Rect.empty; var c = !b.isEmpty ? this.o8 : Rect.empty; var d = this.o3(); var e = this.o2(); var f = this.py.c(a, c, b, d, e); if (f != null) { this.qw = f.f.m; this.qz = f.f.l; } }; Object.defineProperty(NumericAngleAxis.prototype, "tg", { get: function () { if (this.tf != null) { return this.tf; } var a = typeCast(XamDataChart.$, this.b7); if (a != null) { for (var b = 0; b < a.zr.count; b++) { if (a.zr._inner[b].dv) { return a.zr._inner[b]; } } } return this.tf; }, set: function (a) { this.tf = a; }, enumerable: false, configurable: true }); NumericAngleAxis.prototype.ap = function () { return this.tg; }; NumericAngleAxis.prototype.tw = function (a) { this.tg = a; }; NumericAngleAxis.prototype.mf = function (a, b) { _super.prototype.mf.call(this, a, b);