UNPKG

igniteui-angular-charts

Version:

Ignite UI Angular charting components for building rich data visualizations for modern web apps.

1,449 lines (1,448 loc) 70.2 kB
/* THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE AGREEMENT ("AGREEMENT") LOCATED HERE: https://www.infragistics.com/legal/license/igultimate-la https://www.infragistics.com/legal/license/igultimate-eula GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company. */ import { AxisLabelPanelBase } from "./AxisLabelPanelBase"; import { Boolean_$type, typeCast, markType, Number_$type, enumGetBox, Point_$type, typeGetValue, fromEnum, runOn, markDep } from "igniteui-angular-core"; import { AxisLabelPanelBaseView } from "./AxisLabelPanelBaseView"; import { Rect } from "igniteui-angular-core"; import { Extensions } from "igniteui-angular-core"; import { Axis } from "./Axis"; import { List$1 } from "igniteui-angular-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-angular-core"; import { CategoryAxisRenderer } from "./CategoryAxisRenderer"; import { PolarAxisRenderingManager } from "./PolarAxisRenderingManager"; import { AxisLabelManager } from "./AxisLabelManager"; import { ViewportUtils } from "./ViewportUtils"; import { GeometryUtil } from "igniteui-angular-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-angular-core"; import { PropertyMetadata } from "igniteui-angular-core"; import { RangeInfo } from "./RangeInfo"; import { isNaN_, isInfinity } from "igniteui-angular-core"; import { NumericAxisBase } from "./NumericAxisBase"; import { LogarithmicTickmarkValues } from "./LogarithmicTickmarkValues"; import { PolarAxisRenderingParameters } from "./PolarAxisRenderingParameters"; import { MathUtil } from "igniteui-angular-core"; import { RadialAxisLabelPanel } from "./RadialAxisLabelPanel"; import { LinearTickmarkValues } from "./LinearTickmarkValues"; import { IPolarRadialRenderingParameters_$type } from "./IPolarRadialRenderingParameters"; import { PathGeometry } from "igniteui-angular-core"; import { PathFigure } from "igniteui-angular-core"; import { ArcSegment } from "igniteui-angular-core"; import { Size } from "igniteui-angular-core"; import { CategoryAxisBaseView } from "./CategoryAxisBaseView"; import { AxisDefaults } from "./AxisDefaults"; import { NumericAxisBaseView } from "./NumericAxisBaseView"; /** * @hidden */ export let AngleAxisLabelPanel = /*@__PURE__*/ (() => { class AngleAxisLabelPanel extends AxisLabelPanelBase { constructor() { super(); this.df = false; this.dn = null; this.dk = 0; this.dh = 0; this.dj = 0; this.di = 0; this.dg = 0; } af() { return new AngleAxisLabelPanelView(this); } cl(a) { super.cl(a); this.de = a; } aw(a, b) { if (!Extensions.b(b)) { return false; } if (this.ae == null || this.ae.o3.isEmpty) { return super.aw(a, b); } return true; } ba() { let a = new List$1(Rect.$, 0); let b = new List$1(Boolean_$type, 0); if (this.bg.count != this.bf.count) { return a; } let c = 1; if (typeCast(CategoryAngleAxis.$, this.ae) !== null) { c = this.ae.rb(); } else if (typeCast(NumericAngleAxis.$, this.ae) !== null) { c = this.ae.s8(); } if (c == 2) { this.de.a0(a, b); } else { this.de.a1(a, b); } let d = false; this.aq = this.ap(a, b); if (!this.ae.db()) { d = true; switch (c) { case 1: this.dq(); break; case 2: this.dp(); break; } } else { d = true; this.de.ab(); } if (d) { for (let e = 0; e < a.count; e++) { let f = this.bg._inner[e]; let g = this.bf._inner[e]; let h = a._inner[e]; let i = this.dn(g.h, h.width, h.height); let j = i.x - this.bp(f) / 2; let k = i.y - this.bo(f) / 2; h.x = j; h.y = k; a._inner[e] = h; } } return a; } dq() { this.bm = this.dk / 2; this.bm = this.bm + this.dl(); } dp() { this.bm = 5; this.bm = this.bm + this.dm(); } dm() { let a; let b; b = this.ae; a = null; if (b != null) { a = typeCast(XamDataChart.$, b.b2); } if (a == null || b == null) { return 0; } let c = new List$1(Axis.$, 0); for (let d = 0; d < a.zq.count; d++) { let e = a.zq._inner[d]; if ((typeCast(NumericAngleAxis.$, e) !== null || typeCast(CategoryAngleAxis.$, e) !== null) && typeCast(AngleAxisLabelPanel.$, e.a1) !== null && e.a1.bg.count > 0 && (!e.db()) && !e.c2() && (e.an == null || this.ae.an == null || e.an.td == b.an.td)) { c.add(e); } } let f = c.indexOf(b); if (f == -1) { return 0; } let g = 0; if (f > 0) { if (typeCast(CategoryAngleAxis.$, c._inner[f - 1]) !== null) { let h = c._inner[f - 1]; if (h.ra == 2) { g += h.a1.dg; } else { g += c._inner[f - 1].a1.bm; } } else if (typeCast(NumericAngleAxis.$, c._inner[f - 1]) !== null) { let i = c._inner[f - 1]; if (i.ra == 2) { g += i.a1.dg; } else { g += c._inner[f - 1].a1.bm; } } } return g; } dl() { let a; let b; b = this.ae; a = null; if (b != null) { a = typeCast(XamDataChart.$, b.b2); } if (a == null || b == null) { return 0; } let c = new List$1(Axis.$, 0); for (let d = 0; d < a.zq.count; d++) { let e = a.zq._inner[d]; if ((typeCast(NumericAngleAxis.$, e) !== null || typeCast(CategoryAngleAxis.$, e) !== null) && typeCast(AngleAxisLabelPanel.$, e.a1) !== null && e.a1.bg.count > 0 && (!e.db()) && !e.c2() && (e.an == null || this.ae.an == null || e.an.td == b.an.td)) { c.add(e); } } let f = c.indexOf(b); if (f == -1) { return 0; } let g = 0; let h = 5; if (f == 0) { g += h; } else { if (typeCast(CategoryAngleAxis.$, c._inner[f - 1]) !== null) { let i = c._inner[f - 1]; if (i.ra == 2) { g += i.a1.dg; } else { g += c._inner[f - 1].a1.bm; } } else if (typeCast(NumericAngleAxis.$, c._inner[f - 1]) !== null) { let j = c._inner[f - 1]; if (j.s7 == 2) { g += j.a1.dg; } else { g += c._inner[f - 1].a1.bm; } } g += c._inner[f].a1.bm * 2 + h; } return g; } aj() { return 4; } a3(a) { return a == 4 || a == 5; } } AngleAxisLabelPanel.$t = markType(AngleAxisLabelPanel, 'AngleAxisLabelPanel', AxisLabelPanelBase.$); return AngleAxisLabelPanel; })(); /** * @hidden */ export let CategoryAngleAxis = /*@__PURE__*/ (() => { class CategoryAngleAxis extends CategoryAxisBase { constructor() { super(); this.ri = null; this.rf = null; this.rj = false; this.rq = NaN; this.rg = null; this.rr = 0; this.ro = 0; this.rp = 0; this.r7 = 1; this.ab = CategoryAngleAxis.$; this.rf = this.re(); this.ri = new PolarAxisRenderingManager(); } bo() { return new CategoryAngleAxisView(this); } k3(a) { super.k3(a); this.rd = a; } al() { return new CategoryAngleAxis(); } kj(a) { super.kj(a); this.km(a, "ActualInterval"); this.km(a, "ActualMinorInterval"); this.km(a, "StartAngleOffset"); this.km(a, "LabelMode"); } km(a, b) { super.km(a, b); let c = typeCast(CategoryAngleAxis.$, a); if (c == null) { return; } let d = this; if (b == "ActualMinorInterval") { c.r4 = Axis.gr(d.rv, d.rt); } if (b == "ActualInterval") { c.r3 = Axis.gr(d.ru, d.rs); } if (b == "StartAngleOffset") { c.r3 = Axis.gr(d.rw, d.r6); } if (b == "LabelMode") { c.ra = d.q9 != 0 ? d.q9 : d.ra; } } get_dc() { return true; } kt(a) { super.kt(a); switch (a) { case CategoryAngleAxis.$$p[0]: case CategoryAngleAxis.$$p[2]: this.ko(a); break; case CategoryAngleAxis.$$p[1]: case CategoryAngleAxis.$$p[3]: this.kp(a); break; } } a0() { let a = new AngleAxisLabelPanel(); a.dn = (b, c, d) => { let e = this.b2 != null ? this.b2.yr : Rect.empty; let f = !e.isEmpty ? this.o3 : Rect.empty; let g = this.oy(); switch (this.ra) { case 2: return this.sw(b, c, d, { $type: Point_$type, x: 0.5, y: 0.5 }, e, f, g, this.a1.bm); case 0: case 1: default: return this.sx(b, { $type: Point_$type, x: 0.5, y: 0.5 }, e, f, g, this.a1.bm); } }; return a; } rm(a) { return false; } sg() { return null; } r5(a) { return Math.round(a * Math.pow(10, 10)) / Math.pow(10, 10); } re() { let a = ((() => { let $ret = new AxisLabelManager(); $ret.a = this; $ret.f = this.eq; $ret.e = this.ep; $ret.b = this.a1; return $ret; })()); if (this.a4 != null) { this.a4.registerAxis(this); } let b = new CategoryAxisRenderer(a); b.u = () => { let c = this.bp.ba(); let d = this.bp.bd(); let e = this.bp.bb(); let f = this.bp.bc(); this.l7(); this.kh(c); this.kh(d); this.kh(e); this.kh(f); }; b.o = (c, d) => !d.isEmpty && !c.isEmpty && this.rh != null; b.d = (c, d, e, f) => this.rc(c, d, e, f); b.v = () => { if (!this.rj) { this.rj = true; this.rh.ec(); this.rj = false; } }; b.g = (c, d) => { let e = typeGetValue(c); if (e == this.p7 - 1) { if (this.ds) { if (this.rm(e)) { return this.sg(); } } } if (e > this.p7 - 1) { e -= this.p7; } if (this.rn(e)) { return null; } let f = this.pj.item(e); return this.hv(f); }; b.b.c = (c) => { if ((this.a4 == null || this.a4.visibility == 0) && this.rh != null && this.rq != c) { let d = typeCast(XamDataChart.$, this.b2); if (d == null) { return; } this.rq = c; this.a1.bl = c; d.pr(); for (let e of fromEnum(d.zq)) { if (e != this && typeCast(AngleAxisLabelPanel.$, e.a1) !== null) { e.bp.ao(); } } } }; b.k = (c, d, e) => { let f = typeCast(RadialAxisRenderingParameters.$, c); this.ri.o(d, e, c.aa, c.z, c.ab, f.minLength, f.maxLength, f.center); }; b.l = (c, d, e, f) => { let g = typeCast(RadialAxisRenderingParameters.$, c); this.ri.p(d, e, f, g.aa, g.z, c.ab, g.minLength, g.maxLength, g.center); }; b.m = (c, d) => this.getScaledAngle(d); b.q = (c, d) => { if (this.r5(d - this.rr) < 0) { return false; } if (this.r5(d - this.rr - (2 * Math.PI)) > 0) { return false; } return true; }; b.j = (c) => { let d = typeCast(RadialAxisRenderingParameters.$, c); if (d.e == d.k._inner[0]) { this.ri.k(c.u, c.n, c.aa, c.z, c.ab, d.center, d.minAngle, d.maxAngle); } }; b.e = (c) => { c.n = this.rx(); c.r = c.n; }; b.p = (c, d, e) => { let f = typeCast(RadialAxisRenderingParameters.$, c); if (e) { return false; } let g = this.sx(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 = (c, d, e, f) => { let g = c.z; let h = new ScalerParams(0, c.ab, c.aa, this.dn, g); let i = d; if (this.categoryMode != 0) { let j = (e * f) + 1; j = Math.min(j, this.p7); let k = this.f5(j, h); i = (d + k) / 2; } return i; }; b.f = runOn(this, this.getGroupCenter); b.i = runOn(this, this.r2); return b; } rn(a) { return false; } sx(a, b, c, d, e, f) { let g = this.rx(); let h = ViewportUtils.a(f, c, d, e); if (this.a4 != null && (this.a4.c == 5 || this.a4.c == 1)) { h *= -1; } let i = b.x + (g + h) * Math.cos(a); let 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 }; } sw(a, b, c, d, e, f, g, h) { if (!isNaN_(b) && !isNaN_(c)) { let i = this.rx(); let j = b / f.width; let k = c / f.width; let l = ViewportUtils.a(h, e, f, g); let m = GeometryUtil.i(i, a, j, k); let n = d.x + (m + l) * Math.cos(a); let 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.sx(a, d, e, f, g, h); } } rx() { if (this.rh == null) { return 0; } if (!this.c2()) { return this.rh.ti(); } else { return this.rh.tj((this.hq)); } } rc(a, b, c, d) { if (this.pj == null) { return null; } let e = new RadialAxisRenderingParameters(); let f = this.p8 - 1; let g = this.bp.ba(); let h = this.bp.bd(); let i = this.bp.bb(); let j = this.bp.bc(); 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.rl(); e.p = this.r3; e.o = this.gl(); e.s = this.r9(); e.q = this.r4; e.t = this.hw; let k = this.ri.h(b, a, c); let l = this.ri.i(b, a, c); let m = 0.5 * this.rh.td; let n = 0.5 * this.rh.tc; let o = k; let p = l; let q = this.rh.ti(); if (isNaN_(q) || isInfinity(q)) { return null; } if (p >= m) { p = q; } if (o < n) { o = n; } let r = a.width; this.ri.m(b, a, c, e, 0, this.p8, this.dn, runOn(this, this.getUnscaledAngle), r); let 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.p8; e.ac = this.categoryMode; e.ae = true; e.ad = this.dn; e.ag = this.p9; e.f = new CategoryTickmarkValues(); e.j = this.d9; return e; } r9() { return -1; } getMinMaxAngle(a, b, c, d, e) { let f = this.ri.n(a, b, c, d, e); d = f.p3; e = f.p4; return { p3: d, p4: e }; } ac() { super.ac(); this.lv(false); } get rh() { if (this.rg != null) { return this.rg; } let a = typeCast(XamDataChart.$, this.b2); if (a != null) { for (let b = 0; b < a.zq.count; b++) { if (typeCast(NumericRadiusAxis.$, a.zq._inner[b]) !== null) { return a.zq._inner[b]; } } } return this.rg; } set rh(a) { this.rg = a; } ap() { return this.rh; } rb() { if (this.ra == 0) { return 1; } else { return this.ra; } } getCategorySize(a, b, c) { return 2 * Math.PI / this.p7; } get_rk() { return false; } get rk() { return this.get_rk(); } rz(a, b, c, d) { return this.pw(b, c, d); } pw(a, b, c) { let d = this.p3(a, b, c); let e = 0; if (!isNaN_(this.p2)) { e = Math.min(this.p2, 1); } let f = 1 - 0.5 * d; return this.getCategorySize(a, b, c) * f / (this.p9 - (this.p9 - 1) * e); } ry(a, b, c, d, e) { return this.getGroupCenter(b, c, d, e); } getGroupCenter(a, b, c, d) { let e = 0.5; if (this.p9 > 1) { let f = this.p3(b, c, d); let g = 0; if (!isNaN_(this.p2)) { g = Math.min(this.p2, 1); } let h = 1 - 0.5 * f; let i = h / (this.p9 - (this.p9 - 1) * g); let j = (h - i) / (this.p9 - 1); e = 0.25 * f + 0.5 * i + a * j; } return this.getCategorySize(b, c, d) * e; } r2(a) { let b = 0.5; if (this.p9 > 1) { let c = this.p3(Rect.empty, Rect.empty, Rect.empty); let d = 0; if (!isNaN_(this.p2)) { d = Math.min(this.p2, 1); } let e = 1 - 0.5 * c; let f = e / (this.p9 - (this.p9 - 1) * d); let g = (e - f) / (this.p9 - 1); b = 0.25 * c + 0.5 * f + a * g; } return b; } lw(a) { super.lw(a); let b = this.b2 != null ? this.b2.yr : Rect.empty; let c = !b.isEmpty ? this.o3 : Rect.empty; let d = this.oy(); let e = this.ox(); let f = this.rf.c(a, c, b, d, e); if (f != null) { this.rs = f.f.m; this.rt = f.f.l; } } r1(a, b, c) { let d; let e; let f = this.ri.n(c, a, b, d, e); d = f.p3; e = f.p4; if (d == 0) { if (this.dn) { return this.p7; } else { return 0; } } let g = this.getUnscaledAngle(d); if (g < 0 || g > this.p7) { g = this.getUnscaledAngle(d + Math.PI * 2); } return g; } r0(a, b, c) { let d; let e; let f = this.ri.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.p7; } } let g = this.getUnscaledAngle(e); if (g < 0 || g > this.p7) { g = this.getUnscaledAngle(e + Math.PI * 2); } return g; } getScaledAngle(a) { let b = this.p7; let c = b >= 2 ? (a) / (b) : b == 1 ? 0.5 : NaN; if (this.dp) { c = 1 - c; } return (c * 2 * Math.PI) + this.rr; } getUnscaledAngle(a) { if (a < this.rr) { a += 2 * Math.PI; } let b = (a - this.rr) / (2 * Math.PI); if (this.dn) { b = 1 - b; } return b * (this.p7); } f5(a, b) { return this.getScaledAngle(a); } f8(a, b) { return this.getUnscaledAngle(a); } fp(a) { let b = { $type: Point_$type, x: 0.5, y: 0.5 }; let c = Math.sqrt(Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2)); let d = Math.acos((a.x - b.x) / c); if ((a.y - b.y) < 0) { d = (2 * Math.PI) - d; } return d; } k7(a, b, c, d) { super.k7(a, b, c, d); let e = typeCast(XamDataChart.$, this.b2); switch (b) { case "CrossingAxis": let f = typeCast(NumericRadiusAxis.$, d); this.sn(f); if (f != null) { f.ts(this); } this.d0 = true; this.lv(false); break; case CategoryAngleAxis.$$p[5]: this.rr = this.r6; while (this.rr < 0) { this.rr += 360; } while (this.rr >= 360) { this.rr -= 360; } this.rr = (this.rr * Math.PI) / 180; this.d0 = true; this.lv(false); for (let g of fromEnum(this.er)) { g.r7(false); g.qz(); } break; case "Label": case CategoryAngleAxis.$$p[4]: if (e != null) { for (let h of fromEnum(e.zq)) { h.d0 = true; h.lu(); } } break; case "CrossingValue": if (e != null) { for (let i of fromEnum(e.zq)) { if (typeCast(NumericAngleAxis.$, i) !== null || typeCast(CategoryAngleAxis.$, i) !== null) { i.d0 = true; i.lu(); } } } break; case "LabelSettings": this.rf = this.re(); this.sl(); this.d0 = true; this.lv(false); break; case CategoryAngleAxis.$$p[0]: case CategoryAngleAxis.$$p[2]: case CategoryAngleAxis.$$p[1]: case CategoryAngleAxis.$$p[3]: this.kt(b); break; } } sl() { this.rq = NaN; } sn(a) { this.rh = a; } get r3() { return this.c(CategoryAngleAxis.ss); } set r3(a) { this.h(CategoryAngleAxis.ss, a); } get rs() { return this.ro; } set rs(a) { if (this.rs != a) { let b = this.ro; this.ro = a; this.lp("ActualInterval", b, this.rs); } } gh() { return this.rs; } get r4() { return this.c(CategoryAngleAxis.su); } set r4(a) { this.h(CategoryAngleAxis.su, a); } get rt() { return this.rp; } set rt(a) { if (this.rt != a) { let b = this.rp; this.rp = a; this.lp("ActualMinorInterval", b, this.rt); } } rl() { return !isNaN_(this.r3); } get_bm() { return 2; } get bm() { return this.get_bm(); } ee() { if (this.d0 && this.ef) { this.bw = this.bv(); } if (this.pj == null) { return false; } let a = this.pj.count; if (a != this.r8) { let b = new AxisRangeChangedEventArgs(0, 1, 1, this.r8, a); this.r8 = a; this.lq(b); return true; } return false; } get r8() { return this.r7; } set r8(a) { this.r7 = a; } os(a, b, c, d, e) { let f = typeCast(RadialAxisRenderingParameters.$, this.rf.d(c, b, d, e)); if (f == null) { return null; } let g = Math.cos(a); let h = Math.sin(a); let i = f.center.x + g * f.minLength; let j = f.center.y + h * f.minLength; let k = f.center.x + g * f.maxLength; let 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); let m = new LineGeometry(); m.d = { $type: Point_$type, x: i, y: j }; m.c = { $type: Point_$type, x: k, y: l }; return m; } get isVertical() { return this.dy; } j$d(a, b) { return this.f8.apply(this, arguments); } j$c(a, b) { return this.f5.apply(this, arguments); } j$e(a, b, c, d, e) { this.kx.apply(this, arguments); } j$f(a, b, c, d) { this.ky.apply(this, arguments); } j$g(a, b, c, d) { this.kz.apply(this, arguments); } get j$b() { return this.dn; } j$a() { return this.ag.apply(this, arguments); } } CategoryAngleAxis.$t = markType(CategoryAngleAxis, 'CategoryAngleAxis', CategoryAxisBase.$, [IAngleScaler_$type]); CategoryAngleAxis.ss = DependencyProperty.i("Interval", Number_$type, CategoryAngleAxis.$, new PropertyMetadata(2, NaN, (a, b) => { a.lp("Interval", b.oldValue, b.newValue); a.lv(false); })); CategoryAngleAxis.su = DependencyProperty.i("MinorInterval", Number_$type, CategoryAngleAxis.$, new PropertyMetadata(2, NaN, (a, b) => { (typeCast(CategoryAngleAxis.$, a)).lp("MinorInterval", b.oldValue, b.newValue); (typeCast(CategoryAngleAxis.$, a)).lv(false); })); CategoryAngleAxis.$$p = markDep(DependencyProperty, PropertyMetadata, CategoryAngleAxis, 'lp', ['CompanionAxisInterval:ru:so', [1, NaN], 'CompanionAxisLabelMode:q9:sp', [AxisAngleLabelMode_$type, enumGetBox(AxisAngleLabelMode_$type, 0)], 'CompanionAxisMinorInterval:rv:sq', [1, NaN], 'CompanionAxisStartAngleOffset:rw:sr', [1, NaN], 'LabelMode:ra:st', [AxisAngleLabelMode_$type, enumGetBox(AxisAngleLabelMode_$type, 0)], 'StartAngleOffset:r6:sv', [1, 0]]); return CategoryAngleAxis; })(); /** * @hidden */ export let NumericAngleAxis = /*@__PURE__*/ (() => { class NumericAngleAxis extends NumericAxisBase { constructor() { super(); this.tc = null; this.td = false; this.te = NaN; this.tf = 0; this.ta = null; this.ab = NumericAngleAxis.$; this.tc = new PolarAxisRenderingManager(); this.ps = this.pq(); } bo() { return new NumericAngleAxisView(this); } k3(a) { super.k3(a); this.s9 = a; } al() { return new NumericAngleAxis(); } kj(a) { super.kj(a); this.km(a, "LabelMode"); this.km(a, "StartAngleOffset"); } km(a, b) { super.km(a, b); let c = typeCast(NumericAngleAxis.$, a); if (c == null) { return; } let d = this; if (b == "StartAngleOffset") { c.q1 = Axis.gr(d.tg, d.tk); } if (b == "LabelMode") { c.s7 = d.s6 != 0 ? d.s6 : d.s7; } } get_dc() { return true; } a0() { let a = new AngleAxisLabelPanel(); a.dn = (b, c, d) => { let e = this.b2 != null ? this.b2.yr : Rect.empty; let f = !e.isEmpty ? this.o3 : Rect.empty; let g = this.oy(); return this.tw(b, { $type: Point_$type, x: 0.5, y: 0.5 }, e, f, g, this.a1.bm); }; return a; } th() { if (this.tb == null) { return 0; } if (!this.c2()) { return this.tb.ti(); } else { return this.tb.tj((this.hq)); } } tj(a) { return Math.round(a * Math.pow(10, 10)) / Math.pow(10, 10); } pq() { let a = super.pq(); a.b.c = (b) => { if ((this.a4 == null || this.a4.visibility == 0) && this.tb != null && this.te != b) { let c = typeCast(XamDataChart.$, this.b2); if (c == null) { return; } this.te = b; this.a1.bl = b; c.pr(); for (let d of fromEnum(c.zq)) { if (d != this && typeCast(AngleAxisLabelPanel.$, d.a1) !== null) { d.bp.ao(); } } } }; a.e = (b) => { b.n = this.th(); b.r = b.n; }; a.j = (b) => { let c = typeCast(PolarAxisRenderingParameters.$, b); if (c.e == c.k._inner[0]) { this.tc.k(b.u, b.n, b.aa, b.z, b.ab, c.center, c.minAngle, c.maxAngle); } }; a.k = (b, c, d) => { let e = typeCast(PolarAxisRenderingParameters.$, b); this.tc.o(c, d, b.aa, b.z, b.ab, e.minLength, e.maxLength, e.center); }; a.l = (b, c, d, e) => { let f = typeCast(PolarAxisRenderingParameters.$, b); this.tc.p(c, d, e, f.aa, f.z, b.ab, f.minLength, f.maxLength, f.center); }; a.d = (b, c, d, e) => { let f = typeCast(PolarAxisRenderingParameters.$, this.pt(b, c, d, e)); return f; }; a.v = () => { if (!this.td) { this.td = true; this.tb.ec(); this.td = false; } }; a.m = (b, c) => this.getScaledAngle(c); a.o = (b, c) => !c.isEmpty && !b.isEmpty && this.tb != null; a.q = (b, c) => { if (this.tj(c - this.tf) < 0) { return false; } if (this.tj(c - this.tf - (2 * Math.PI)) > 0) { return false; } return true; }; a.p = (b, c, d) => { let e = typeCast(PolarAxisRenderingParameters.$, b); let f = this.tw(this.getScaledAngle(e.l), e.center, b.ab, b.aa, b.z, 0); let g = this.tw(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 = (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; } tw(a, b, c, d, e, f) { let g = this.th(); let h = ViewportUtils.a(f, c, d, e); if (this.a4 != null && (this.a4.c == 5 || this.a4.c == 1)) { h *= -1; } let i = b.x + (g + h) * Math.cos(a); let 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 }; } f5(a, b) { return this.getScaledAngle(a); } getScaledAngle1(a, b, c) { let d = 0; if (b) { d = (Math.log(a) - this.q3) / (this.q2 - this.q3); } else { d = (a - this.qt) / (this.qs - this.qt); } if (c) { d = 1 - d; } return (d * 2 * Math.PI) + this.tf; } getScaledAngle(a) { return this.getScaledAngle1(a, this.qe, this.dp); } f8(a, b) { return this.getUnscaledAngle(a); } getUnscaledAngle(a) { let b = (a - this.tf) / (2 * Math.PI); if (this.dn) { b = 1 - b; } if (this.qe) { return Math.exp(b * (this.q2 - this.q3) + this.q3); } else { return this.qt + b * (this.qs - this.qt); } } s8() { if (this.s7 == 0) { return 1; } else { return this.s7; } } k7(a, b, c, d) { super.k7(a, b, c, d); let e = typeCast(XamDataChart.$, this.b2); switch (b) { case "CrossingAxis": let f = typeCast(NumericRadiusAxis.$, d); this.tr(f); if (f != null) { f.ts(this); } this.lv(false); break; case NumericAngleAxis.$$p[3]: this.tf = this.tk; while (this.tf < 0) { this.tf += 360; } while (this.tf >= 360) { this.tf -= 360; } this.tf = (this.tk * Math.PI) / 180; this.lv(false); for (let g of fromEnum(this.en())) { g.r7(false); g.qz(); } break; case "Label": if (e != null) { for (let h of fromEnum(e.zq)) { h.lu(); } } break; case "CrossingValue": if (e != null) { for (let i of fromEnum(e.zq)) { if (typeCast(NumericAngleAxis.$, i) !== null || typeCast(CategoryAngleAxis.$, i) !== null) { i.lu(); } } } break; case "LabelSettings": this.ps = this.pq(); this.tp(); this.d0 = true; this.lv(false); break; case NumericAngleAxis.$$p[0]: case NumericAngleAxis.$$p[1]: this.kt(b); break; } } kt(a) { super.kt(a); switch (a) { case NumericAngleAxis.$$p[0]: case NumericAngleAxis.$$p[1]: this.kp(a); break; } } tp() { this.te = NaN; } pu() { return new PolarAxisRenderingParameters(); } pt(a, b, c, d) { let e = typeCast(PolarAxisRenderingParameters.$, super.pt(a, b, c, d)); let f = this.tc.h(b, a, c); let g = this.tc.i(b, a, c); let h = 0.5 * this.tb.td; let i = 0.5 * this.tb.tc; let j = f; let k = g; let l = this.tb.ti(); if (isNaN_(l) || isInfinity(l)) { return null; } if (k >= h) { k = l; } if (j < i) { j = i; } let m = a.width; this.tc.m(b, a, c, e, this.qt, this.qs, this.dn, runOn(this, this.getUnscaledAngle), m); let n = { $type: Point_$type, x: 0.5, y: 0.5 }; e.center = n; e.maxLength = k; e.minLength = j; e.effectiveMaximum = l; return e; } getMinMaxAngle(a, b, c, d, e) { let f = this.tc.n(a, b, c, d, e); d = f.p3; e = f.p4; return { p3: d, p4: e }; } lw(a) { super.lw(a); let b = this.b2 != null ? this.b2.yr : Rect.empty; let c = !b.isEmpty ? this.o3 : Rect.empty; let d = this.oy(); let e = this.ox(); let f = this.ps.c(a, c, b, d, e); if (f != null) { this.qr = f.f.m; this.qu = f.f.l; } } get tb() { if (this.ta != null) { return this.ta; } let a = typeCast(XamDataChart.$, this.b2); if (a != null) { for (let b = 0; b < a.zq.count; b++) { if (a.zq._inner[b].du) { return a.zq._inner[b]; } } } return this.ta; } set tb(a) { this.ta = a; } ap() { return this.tb; } tr(a) { this.tb = a; } ma(a, b) { super.ma(a, b); if (b.height != a.height || b.width != a.width) { this.ec(); } } get_bm() { return 2; } get bm() { return this.get_bm(); } os(a, b, c, d, e) { if (this.tb == null) { return null; } let f = typeCast(PolarAxisRenderingParameters.$, this.pt(c, b, d, e)); if (f == null) { return null; } let g = Math.cos(a); let h = Math.sin(a); let i = f.center.x + g * f.minLength; let j = f.center.y + h * f.minLength; let k = f.center.x + g * f.maxLength; let 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); let m = new LineGeometry(); m.d = { $type: Point_$type, x: i, y: j }; m.c = { $type: Point_$type, x: k, y: l }; return m; } } NumericAngleAxis.$t = markType(NumericAngleAxis, 'NumericAngleAxis', NumericAxisBase.$, [IAngleScaler_$type]); NumericAngleAxis.$$p = markDep(DependencyProperty, PropertyMetadata, NumericAngleAxis, 'lp', ['CompanionAxisLabelMode:s6:ts', [AxisAngleLabelMode_$type, enumGetBox(AxisAngleLabelMode_$type, 0)], 'CompanionAxisStartAngleOffset:tg:tt', [1, NaN], 'LabelMode:s7:tu', [AxisAngleLabelMode_$type, enumGetBox(AxisAngleLabelMode_$type, 0)], 'StartAngleOffset:tk:tv', [1, 0]]); return NumericAngleAxis; })(); /** * @hidden */ export let NumericRadiusAxis = /*@__PURE__*/ (() => { class NumericRadiusAxis extends NumericAxisBase { constructor() { super(); this.s9 = null; this.ta = false; this.tb = NaN; this.td = 0; this.tc = 0; this.tf = 0; this.s6 = null; this.ab = NumericRadiusAxis.$; this.td = this.tn; this.tc = this.tm; this.s9 = new PolarAxisRenderingManager(); this.ps = this.pq(); } bo() { return new NumericRadiusAxisView(this); } k3(a) { super.k3(a); this.s8 = a; } al() { return new NumericRadiusAxis(); } kj(a) { super.kj(a); this.km(a, "InnerRadiusExtentScale"); this.km(a, "RadiusExtentScale"); } km(a, b) { super.km(a, b); let c = typeCast(NumericRadiusAxis.$, a); if (c == null) { return; } let d = this; if (b == "InnerRadiusExtentScale") { c.tm = d.tm; } if (b == "RadiusExtentScale") { c.tn = d.tn; } } get_du() { return true; } f4() { let a = this.td; let b = this.tc; let c = Math.min(this.th(), this.tg()) * (a - b) / 2; c = Math.max(c, 14); return c; } th() { return this.o3.width; } tg() { return this.o3.height; } a0() { return new RadialAxisLabelPanel(); } te(a) { if (a == null) { return 0; } return a; } pq() { let a = super.pq(); a.b.c = (b) => { if ((this.a4 == null || this.a4.visibility == 0) && this.s7 != null) { if ((this.a4 == null || (this.a4.c == 4 || this.a4.c == 5)) && this.tb != b) { this.tb = b; this.a1.bl = b; this.b2.pr(); } } }; a.k = (b, c, d) => { let e = typeCast(PolarAxisRenderingParameters.$, b); this.s9.k(c, d, e.aa, e.z, e.ab, e.center, e.minAngle, e.maxAngle); }; a.l = (b, c, d, e) => { if (d == e) { return; } let f = typeCast(PolarAxisRenderingParameters.$, b); this.s9.l(c, d, e, f.aa, f.z, f.ab, f.center, f.minAngle, f.maxAngle); }; a.m = (b, c) => this.tj(c); a.q = (b, c) => { let d = typeCast(PolarAxisRenderingParameters.$, b); return c <= d.effectiveMaximum; }; a.n = (b, c) => { let d = typeCast(PolarAxisRenderingParameters.$, b); return c <= d.effectiveMaximum; }; a.j = (b) => { let c = typeCast(PolarAxisRenderingParameters.$, b); this.s9.o(b.u, c.crossingAngleRadians, b.aa, b.z, b.ab, c.minLength, c.maxLength, c.center); }; a.e = (b) => { b.n = this.a4 == null || (this.a4.c == 4 || this.a4.c == 0) ? b.aa.top : b.aa.bottom; b.r = b.n; let c = typeCast(PolarAxisRenderingParameters.$, b); c.crossingAngleRadians = (this.te(this.hq) * Math.PI) / 180; if (this.a4 == null || (this.a4.c == 4 || this.a4.c == 5)) { c.n = ViewportUtils.i(0.5, c.ab, c.aa, c.z) - b.aa.top; c.r = c.n; let d = typeCast(RadialAxisLabelPanel.$, this.a1); if (d != null) { let e = 0;