UNPKG

igniteui-angular-charts

Version:

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

1,685 lines 61.5 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"; import { RectUtil } from "igniteui-angular-core"; import { Convert } from "igniteui-angular-core"; /** * @hidden */ export class AngleAxisLabelPanel extends AxisLabelPanelBase { static { this.$t = markType(AngleAxisLabelPanel, 'AngleAxisLabelPanel', AxisLabelPanelBase.$); } af() { return new AngleAxisLabelPanelView(this); } cn(a) { super.cn(a); this.dg = a; } constructor() { super(); this.dh = false; this.dq = null; this.dm = 0; this.dj = 0; this.dl = 0; this.dk = 0; this.di = 0; } aw(a, b) { if (!Extensions.b(b)) { return false; } if (this.ae == null || this.ae.pk.isEmpty) { return super.aw(a, b); } return true; } bc() { let a = new List$1(Rect.$, 0); let b = new List$1(Boolean_$type, 0); if (this.bi.count != this.bh.count) { return a; } let c = 1; if (typeCast(CategoryAngleAxis.$, this.ae) !== null) { c = this.ae.rv(); } else if (typeCast(NumericAngleAxis.$, this.ae) !== null) { c = this.ae.tp(); } if (c == 2) { this.dg.a0(a, b); } else { this.dg.a1(a, b); } let d = false; this.aq = this.ap(a, b); if (!this.ae.de()) { d = true; switch (c) { case 1: this.ds(); break; case 2: this.dr(); break; } } else { d = true; this.dg.ab(); } if (d) { for (let e = 0; e < a.count; e++) { let f = this.bi._inner[e]; let g = this.bh._inner[e]; let h = a._inner[e]; let i = this.dq(g.h, h.width, h.height); let j = i.x - this.br(f) / 2; let k = i.y - this.bq(f) / 2; h.x = j; h.y = k; a._inner[e] = h; } } return a; } ds() { this.bo = this.dm / 2; this.bo = this.bo + this.dn(); } dr() { this.bo = 5; this.bo = this.bo + this.dp(); } dp() { let a; let b; b = this.ae; a = null; if (b != null) { a = typeCast(XamDataChart.$, b.b7); } if (a == null || b == null) { return 0; } let c = new List$1(Axis.$, 0); for (let d = 0; d < a.zu.count; d++) { let e = a.zu._inner[d]; if ((typeCast(NumericAngleAxis.$, e) !== null || typeCast(CategoryAngleAxis.$, e) !== null) && typeCast(AngleAxisLabelPanel.$, e.a1) !== null && e.a1.bi.count > 0 && (!e.de()) && !e.c5() && (e.an == null || this.ae.an == null || e.an.tu == b.an.tu)) { 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.ru == 2) { g += h.a1.di; } else { g += c._inner[f - 1].a1.bo; } } else if (typeCast(NumericAngleAxis.$, c._inner[f - 1]) !== null) { let i = c._inner[f - 1]; if (i.ru == 2) { g += i.a1.di; } else { g += c._inner[f - 1].a1.bo; } } } return g; } dn() { let a; let b; b = this.ae; a = null; if (b != null) { a = typeCast(XamDataChart.$, b.b7); } if (a == null || b == null) { return 0; } let c = new List$1(Axis.$, 0); for (let d = 0; d < a.zu.count; d++) { let e = a.zu._inner[d]; if ((typeCast(NumericAngleAxis.$, e) !== null || typeCast(CategoryAngleAxis.$, e) !== null) && typeCast(AngleAxisLabelPanel.$, e.a1) !== null && e.a1.bi.count > 0 && (!e.de()) && !e.c5() && (e.an == null || this.ae.an == null || e.an.tu == b.an.tu)) { 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.ru == 2) { g += i.a1.di; } else { g += c._inner[f - 1].a1.bo; } } else if (typeCast(NumericAngleAxis.$, c._inner[f - 1]) !== null) { let j = c._inner[f - 1]; if (j.to == 2) { g += j.a1.di; } else { g += c._inner[f - 1].a1.bo; } } g += c._inner[f].a1.bo * 2 + h; } return g; } aj() { return 4; } a3(a) { return a == 4 || a == 5; } } /** * @hidden */ export class CategoryAngleAxis extends CategoryAxisBase { static { this.$t = markType(CategoryAngleAxis, 'CategoryAngleAxis', CategoryAxisBase.$, [IAngleScaler_$type]); } bo() { return new CategoryAngleAxisView(this); } lg(a) { super.lg(a); this.rx = a; } al() { return new CategoryAngleAxis(); } kw(a) { super.kw(a); this.kz(a, "ActualInterval"); this.kz(a, "ActualMinorInterval"); this.kz(a, "StartAngleOffset"); this.kz(a, "LabelMode"); } kz(a, b) { super.kz(a, b); let c = typeCast(CategoryAngleAxis.$, a); if (c == null) { return; } let d = this; if (b == "ActualMinorInterval") { c.so = Axis.gy(d.sf, d.sd); } if (b == "ActualInterval") { c.sn = Axis.gy(d.se, d.sc); } if (b == "StartAngleOffset") { c.sn = Axis.gy(d.sg, d.sq); } if (b == "LabelMode") { c.ru = d.rt != 0 ? d.rt : d.ru; } } get_df() { return true; } k6(a) { super.k6(a); switch (a) { case CategoryAngleAxis.$$p[0]: case CategoryAngleAxis.$$p[2]: this.k1(a); break; case CategoryAngleAxis.$$p[1]: case CategoryAngleAxis.$$p[3]: this.k2(a); break; } } constructor() { super(); this.r2 = null; this.rz = null; this.r3 = false; this.sa = NaN; this.r0 = null; this.sb = 0; this.r8 = 0; this.r9 = 0; this.sr = 1; this.ab = CategoryAngleAxis.$; this.rz = this.ry(); this.r2 = new PolarAxisRenderingManager(); } a0() { let a = new AngleAxisLabelPanel(); a.dq = (b, c, d) => { let e = this.b7 != null ? this.b7.yv : Rect.empty; let f = !e.isEmpty ? this.pk : Rect.empty; let g = this.pf(); switch (this.ru) { case 2: return this.tg(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.th(b, { $type: Point_$type, x: 0.5, y: 0.5 }, e, f, g, this.a1.bo); } }; return a; } r6(a) { return false; } s0() { return null; } sp(a) { return Math.round(a * Math.pow(10, 10)) / Math.pow(10, 10); } ry() { let a = ((() => { let $ret = new AxisLabelManager(); $ret.a = this; $ret.f = this.ew; $ret.e = this.ev; $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.bb(); let d = this.bp.be(); let e = this.bp.bc(); let f = this.bp.bd(); this.mk(); this.ku(c); this.ku(d); this.ku(e); this.ku(f); }; b.o = (c, d) => !d.isEmpty && !c.isEmpty && this.r1 != null; b.d = (c, d, e, f) => this.rw(c, d, e, f); b.v = () => { if (!this.r3) { this.r3 = true; this.r1.ei(); this.r3 = false; } }; b.g = (c, d) => { let e = typeGetValue(c); if (e == this.qp - 1) { if (this.dw) { if (this.r6(e)) { return this.s0(); } } } if (e > this.qp - 1) { e -= this.qp; } if (this.r7(e)) { return null; } let f = this.p0.item(e); return this.h2(f); }; b.b.c = (c) => { if ((this.a4 == null || this.a4.visibility == 0) && this.r1 != null && this.sa != c) { let d = typeCast(XamDataChart.$, this.b7); if (d == null) { return; } this.sa = c; this.a1.bn = c; d.pt(); for (let e of fromEnum(d.zu)) { if (e != this && typeCast(AngleAxisLabelPanel.$, e.a1) !== null) { e.bp.ap(); } } } }; b.k = (c, d, e) => { let f = typeCast(RadialAxisRenderingParameters.$, c); this.r2.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.r2.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.sp(d - this.sb) < 0) { return false; } if (this.sp(d - this.sb - (2 * Math.PI)) > 0) { return false; } return true; }; b.j = (c) => { let d = typeCast(RadialAxisRenderingParameters.$, c); if (d.e == d.k._inner[0]) { this.r2.k(c.u, c.n, c.aa, c.z, c.ab, d.center, d.minAngle, d.maxAngle); } }; b.e = (c) => { c.n = this.sh(); c.r = c.n; }; b.p = (c, d, e) => { let f = typeCast(RadialAxisRenderingParameters.$, c); if (e) { return false; } let g = this.th(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.dr, g); let i = d; if (this.categoryMode != 0) { let j = (e * f) + 1; j = Math.min(j, this.qp); let k = this.gc(j, h); i = (d + k) / 2; } return i; }; b.f = runOn(this, this.getGroupCenter); b.i = runOn(this, this.sm); return b; } r7(a) { return false; } th(a, b, c, d, e, f) { let g = this.sh(); 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 }; } tg(a, b, c, d, e, f, g, h) { if (!isNaN_(b) && !isNaN_(c)) { let i = this.sh(); 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.th(a, d, e, f, g, h); } } sh() { if (this.r1 == null) { return 0; } if (!this.c5()) { return this.r1.tz(); } else { return this.r1.t1((this.hx)); } } rw(a, b, c, d) { if (this.p0 == null) { return null; } let e = new RadialAxisRenderingParameters(); let f = this.qq - 1; let g = this.bp.bb(); let h = this.bp.be(); let i = this.bp.bc(); let 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.r5(); e.p = this.sn; e.o = this.gs(); e.s = this.st(); e.q = this.so; e.t = this.h3; let k = this.r2.h(b, a, c); let l = this.r2.i(b, a, c); let m = 0.5 * this.r1.tu; let n = 0.5 * this.r1.tt; let o = k; let p = l; let q = this.r1.tz(); if (isNaN_(q) || isInfinity(q)) { return null; } if (p >= m) { p = q; } if (o < n) { o = n; } let r = a.width; this.r2.m(b, a, c, e, 0, this.qq, this.dr, 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.qq; e.ac = this.categoryMode; e.ae = true; e.ad = this.dr; e.ag = this.qr; e.f = new CategoryTickmarkValues(); e.j = this.ef; return e; } st() { return -1; } getMinMaxAngle(a, b, c, d, e) { let f = this.r2.n(a, b, c, d, e); d = f.p3; e = f.p4; return { p3: d, p4: e }; } ac() { super.ac(); this.l8(false); } get r1() { if (this.r0 != null) { return this.r0; } let a = typeCast(XamDataChart.$, this.b7); if (a != null) { for (let b = 0; b < a.zu.count; b++) { if (typeCast(NumericRadiusAxis.$, a.zu._inner[b]) !== null) { return a.zu._inner[b]; } } } return this.r0; } set r1(a) { this.r0 = a; } ap() { return this.r1; } rv() { if (this.ru == 0) { return 1; } else { return this.ru; } } getCategorySize(a, b, c) { return 2 * Math.PI / this.qp; } get_r4() { return false; } get r4() { return this.get_r4(); } sj(a, b, c, d) { return this.qe(b, c, d); } qe(a, b, c) { let d = this.ql(a, b, c); let e = 0; if (!isNaN_(this.qk)) { e = Math.min(this.qk, 1); } let f = 1 - 0.5 * d; return this.getCategorySize(a, b, c) * f / (this.qr - (this.qr - 1) * e); } si(a, b, c, d, e) { return this.getGroupCenter(b, c, d, e); } getGroupCenter(a, b, c, d) { let e = 0.5; if (this.qr > 1) { let f = this.ql(b, c, d); let g = 0; if (!isNaN_(this.qk)) { g = Math.min(this.qk, 1); } let h = 1 - 0.5 * f; let i = h / (this.qr - (this.qr - 1) * g); let j = (h - i) / (this.qr - 1); e = 0.25 * f + 0.5 * i + a * j; } return this.getCategorySize(b, c, d) * e; } sm(a) { let b = 0.5; if (this.qr > 1) { let c = this.ql(Rect.empty, Rect.empty, Rect.empty); let d = 0; if (!isNaN_(this.qk)) { d = Math.min(this.qk, 1); } let e = 1 - 0.5 * c; let f = e / (this.qr - (this.qr - 1) * d); let g = (e - f) / (this.qr - 1); b = 0.25 * c + 0.5 * f + a * g; } return b; } l9(a) { super.l9(a); let b = this.b7 != null ? this.b7.yv : Rect.empty; let c = !b.isEmpty ? this.pk : Rect.empty; let d = this.pf(); let e = this.pe(); let f = this.rz.c(a, c, b, d, e); if (f != null) { this.sc = f.f.m; this.sd = f.f.l; } } sl(a, b, c) { let d; let e; let f = this.r2.n(c, a, b, d, e); d = f.p3; e = f.p4; if (d == 0) { if (this.dr) { return this.qp; } else { return 0; } } let g = this.getUnscaledAngle(d); if (g < 0 || g > this.qp) { g = this.getUnscaledAngle(d + Math.PI * 2); } return g; } sk(a, b, c) { let d; let e; let f = this.r2.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.dr) { return 0; } else { return this.qp; } } let g = this.getUnscaledAngle(e); if (g < 0 || g > this.qp) { g = this.getUnscaledAngle(e + Math.PI * 2); } return g; } getScaledAngle(a) { let b = this.qp; let c = b >= 2 ? (a) / (b) : b == 1 ? 0.5 : NaN; if (this.ds) { c = 1 - c; } return (c * 2 * Math.PI) + this.sb; } getUnscaledAngle(a) { if (a < this.sb) { a += 2 * Math.PI; } let b = (a - this.sb) / (2 * Math.PI); if (this.dr) { b = 1 - b; } return b * (this.qp); } gc(a, b) { return this.getScaledAngle(a); } gf(a, b) { return this.getUnscaledAngle(a); } fv(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; } gn(a) { let b = a - this.sb; if (b < 0) { b += Math.PI * 2; } if (b > Math.PI * 2) { b -= Math.PI * 2; } return b; } lk(a, b, c, d) { super.lk(a, b, c, d); let e = typeCast(XamDataChart.$, this.b7); switch (b) { case "CrossingAxis": let f = typeCast(NumericRadiusAxis.$, d); this.s7(f); if (f != null) { f.t9(this); } this.d5 = true; this.l8(false); break; case CategoryAngleAxis.$$p[5]: this.sb = this.sq; while (this.sb < 0) { this.sb += 360; } while (this.sb >= 360) { this.sb -= 360; } this.sb = (this.sb * Math.PI) / 180; this.d5 = true; this.l8(false); for (let g of fromEnum(this.ex)) { g.sa(false); g.q2(); } break; case "Label": case CategoryAngleAxis.$$p[4]: if (e != null) { for (let h of fromEnum(e.zu)) { h.d5 = true; h.l7(); } } break; case "CrossingValue": if (e != null) { for (let i of fromEnum(e.zu)) { if (typeCast(NumericAngleAxis.$, i) !== null || typeCast(CategoryAngleAxis.$, i) !== null) { i.d5 = true; i.l7(); } } } break; case "LabelSettings": this.rz = this.ry(); this.s5(); this.d5 = true; this.l8(false); break; case CategoryAngleAxis.$$p[0]: case CategoryAngleAxis.$$p[2]: case CategoryAngleAxis.$$p[1]: case CategoryAngleAxis.$$p[3]: this.k6(b); break; } } s5() { this.sa = NaN; } s7(a) { this.r1 = a; } static { this.tc = DependencyProperty.i("Interval", Number_$type, CategoryAngleAxis.$, new PropertyMetadata(2, NaN, (a, b) => { a.l2("Interval", b.oldValue, b.newValue); a.l8(false); })); } get sn() { return this.c(CategoryAngleAxis.tc); } set sn(a) { this.h(CategoryAngleAxis.tc, a); } get sc() { return this.r8; } set sc(a) { if (this.sc != a) { let b = this.r8; this.r8 = a; this.l2("ActualInterval", b, this.sc); } } go() { return this.sc; } static { this.te = DependencyProperty.i("MinorInterval", Number_$type, CategoryAngleAxis.$, new PropertyMetadata(2, NaN, (a, b) => { (typeCast(CategoryAngleAxis.$, a)).l2("MinorInterval", b.oldValue, b.newValue); (typeCast(CategoryAngleAxis.$, a)).l8(false); })); } get so() { return this.c(CategoryAngleAxis.te); } set so(a) { this.h(CategoryAngleAxis.te, a); } get sd() { return this.r9; } set sd(a) { if (this.sd != a) { let b = this.r9; this.r9 = a; this.l2("ActualMinorInterval", b, this.sd); } } r5() { return !isNaN_(this.sn); } get_bm() { return 2; } get bm() { return this.get_bm(); } ek() { if (this.d5 && this.el) { this.b1 = this.b0(); } if (this.p0 == null) { return false; } let a = this.p0.count; if (a != this.ss) { let b = new AxisRangeChangedEventArgs(0, 1, 1, this.ss, a); this.ss = a; this.l3(b); return true; } return false; } get ss() { return this.sr; } set ss(a) { this.sr = a; } o9(a, b, c, d, e) { let f = typeCast(RadialAxisRenderingParameters.$, this.rz.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.d3; } j$d(a, b) { return this.gf.apply(this, arguments); } j$c(a, b) { return this.gc.apply(this, arguments); } j$e(a, b, c, d, e) { this.la.apply(this, arguments); } j$f(a, b, c, d) { this.lb.apply(this, arguments); } j$g(a, b, c, d) { this.lc.apply(this, arguments); } get j$b() { return this.dr; } j$a() { return this.ag.apply(this, arguments); } static { this.$$p = markDep(DependencyProperty, PropertyMetadata, CategoryAngleAxis, 'l2', ['CompanionAxisInterval:se:s8', [1, NaN], 'CompanionAxisLabelMode:rt:s9', [AxisAngleLabelMode_$type, enumGetBox(AxisAngleLabelMode_$type, 0)], 'CompanionAxisMinorInterval:sf:ta', [1, NaN], 'CompanionAxisStartAngleOffset:sg:tb', [1, NaN], 'LabelMode:ru:td', [AxisAngleLabelMode_$type, enumGetBox(AxisAngleLabelMode_$type, 0)], 'StartAngleOffset:sq:tf', [1, 0]]); } } /** * @hidden */ export class NumericAngleAxis extends NumericAxisBase { static { this.$t = markType(NumericAngleAxis, 'NumericAngleAxis', NumericAxisBase.$, [IAngleScaler_$type]); } bo() { return new NumericAngleAxisView(this); } lg(a) { super.lg(a); this.tq = a; } al() { return new NumericAngleAxis(); } kw(a) { super.kw(a); this.kz(a, "LabelMode"); this.kz(a, "StartAngleOffset"); } kz(a, b) { super.kz(a, b); let c = typeCast(NumericAngleAxis.$, a); if (c == null) { return; } let d = this; if (b == "StartAngleOffset") { c.rj = Axis.gy(d.tx, d.t1); } if (b == "LabelMode") { c.to = d.tn != 0 ? d.tn : d.to; } } get_df() { return true; } constructor() { super(); this.tt = null; this.tu = false; this.tv = NaN; this.tw = 0; this.tr = null; this.ab = NumericAngleAxis.$; this.tt = new PolarAxisRenderingManager(); this.qa = this.p8(); } a0() { let a = new AngleAxisLabelPanel(); a.dq = (b, c, d) => { let e = this.b7 != null ? this.b7.yv : Rect.empty; let f = !e.isEmpty ? this.pk : Rect.empty; let g = this.pf(); return this.ud(b, { $type: Point_$type, x: 0.5, y: 0.5 }, e, f, g, this.a1.bo); }; return a; } ty() { if (this.ts == null) { return 0; } if (!this.c5()) { return this.ts.tz(); } else { return this.ts.t1((this.hx)); } } t0(a) { return Math.round(a * Math.pow(10, 10)) / Math.pow(10, 10); } p8() { let a = super.p8(); a.b.c = (b) => { if ((this.a4 == null || this.a4.visibility == 0) && this.ts != null && this.tv != b) { let c = typeCast(XamDataChart.$, this.b7); if (c == null) { return; } this.tv = b; this.a1.bn = b; c.pt(); for (let d of fromEnum(c.zu)) { if (d != this && typeCast(AngleAxisLabelPanel.$, d.a1) !== null) { d.bp.ap(); } } } }; a.e = (b) => { b.n = this.ty(); b.r = b.n; }; a.j = (b) => { let c = typeCast(PolarAxisRenderingParameters.$, b); if (c.e == c.k._inner[0]) { this.tt.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.tt.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.tt.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.qb(b, c, d, e)); return f; }; a.v = () => { if (!this.tu) { this.tu = true; this.ts.ei(); this.tu = false; } }; a.m = (b, c) => this.getScaledAngle(c); a.o = (b, c) => !c.isEmpty && !b.isEmpty && this.ts != null; a.q = (b, c) => { if (this.t0(c - this.tw) < 0) { return false; } if (this.t0(c - this.tw - (2 * Math.PI)) > 0) { return false; } return true; }; a.p = (b, c, d) => { let e = typeCast(PolarAxisRenderingParameters.$, b); let f = this.ud(this.getScaledAngle(e.l), e.center, b.ab, b.aa, b.z, 0); let g = this.ud(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; } ud(a, b, c, d, e, f) { let g = this.ty(); 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 }; } gc(a, b) { return this.getScaledAngle(a); } getScaledAngle1(a, b, c) { let d = 0; if (b) { d = (Math.log(a) - this.rl) / (this.rk - this.rl); } else { d = (a - this.ra) / (this.q9 - this.ra); } if (c) { d = 1 - d; } return (d * 2 * Math.PI) + this.tw; } getScaledAngle(a) { return this.getScaledAngle1(a, this.qv, this.ds); } gf(a, b) { return this.getUnscaledAngle(a); } getUnscaledAngle(a) { let b = (a - this.tw) / (2 * Math.PI); if (this.dr) { b = 1 - b; } if (this.qv) { return Math.exp(b * (this.rk - this.rl) + this.rl); } else { return this.ra + b * (this.q9 - this.ra); } } tp() { if (this.to == 0) { return 1; } else { return this.to; } } lk(a, b, c, d) { super.lk(a, b, c, d); let e = typeCast(XamDataChart.$, this.b7); switch (b) { case "CrossingAxis": let f = typeCast(NumericRadiusAxis.$, d); this.t8(f); if (f != null) { f.t9(this); } this.l8(false); break; case NumericAngleAxis.$$p[3]: this.tw = this.t1; while (this.tw < 0) { this.tw += 360; } while (this.tw >= 360) { this.tw -= 360; } this.tw = (this.t1 * Math.PI) / 180; this.l8(false); for (let g of fromEnum(this.et())) { g.sa(false); g.q2(); } break; case "Label": if (e != null) { for (let h of fromEnum(e.zu)) { h.l7(); } } break; case "CrossingValue": if (e != null) { for (let i of fromEnum(e.zu)) { if (typeCast(NumericAngleAxis.$, i) !== null || typeCast(CategoryAngleAxis.$, i) !== null) { i.l7(); } } } break; case "LabelSettings": this.qa = this.p8(); this.t6(); this.d5 = true; this.l8(false); break; case NumericAngleAxis.$$p[0]: case NumericAngleAxis.$$p[1]: this.k6(b); break; } } k6(a) { super.k6(a); switch (a) { case NumericAngleAxis.$$p[0]: case NumericAngleAxis.$$p[1]: this.k2(a); break; } } t6() { this.tv = NaN; } qc() { return new PolarAxisRenderingParameters(); } qb(a, b, c, d) { let e = typeCast(PolarAxisRenderingParameters.$, super.qb(a, b, c, d)); let f = this.tt.h(b, a, c); let g = this.tt.i(b, a, c); let h = 0.5 * this.ts.tu; let i = 0.5 * this.ts.tt; let j = f; let k = g; let l = this.ts.tz(); if (isNaN_(l) || isInfinity(l)) { return null; } if (k >= h) { k = l; } if (j < i) { j = i; } let m = a.width; this.tt.m(b, a, c, e, this.ra, this.q9, this.dr, 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.tt.n(a, b, c, d, e); d = f.p3; e = f.p4; return { p3: d, p4: e }; } l9(a) { super.l9(a); let b = this.b7 != null ? this.b7.yv : Rect.empty; let c = !b.isEmpty ? this.pk : Rect.empty; let d = this.pf(); let e = this.pe(); let f = this.qa.c(a, c, b, d, e); if (f != null) { this.q8 = f.f.m; this.rb = f.f.l; } } get ts() { if (this.tr != null) { return this.tr; } let a = typeCast(XamDataChart.$, this.b7); if (a != null) { for (let b = 0; b < a.zu.count; b++) { if (a.zu._inner[b].dz) { return a.zu._inner[b]; } } } return this.tr; } set ts(a) { this.tr = a; } ap() { return this.ts; } t8(a) { this.ts = a; } mn(a, b) { super.mn(a, b); if (b.height != a.height || b.width != a.width) { this.ei(); } } get_bm() { return 2; } get bm() { return this.get_bm(); } o9(a, b, c, d, e) { if (this.ts == null) { return null; } let f = typeCast(PolarAxisRenderingParameters.$, this.qb(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; } gn(a) { let b = a - this.tw; if (b < 0) { b += Math.PI * 2; } if (b > Math.PI * 2) { b -= Math.PI * 2; } return b; } static { this.$$p = markDep(DependencyProperty, PropertyMetadata, NumericAngleAxis, 'l2', ['CompanionAxisLabelMode:tn:t9', [AxisAngleLabelMode_$type, enumGetBox(AxisAngleLabelMode_$type, 0)], 'CompanionAxisStartAngleOffset:tx:ua', [1, NaN], 'LabelMode:to:ub', [AxisAngleLabelMode_$type, enumGetBox(AxisAngleLabelMode_$type, 0)], 'StartAngleOffset:t1:uc', [1, 0]]); } } /** * @hidden */ export class NumericRadiusAxis extends NumericAxisBase { static { this.$t = markType(NumericRadiusAxis, 'NumericRadiusAxis', NumericAxisBase.$); } bo() { return new NumericRadiusAxisView(this); } lg(a) { super.lg(a); this.tp = a; } al() { return new NumericRadiusAxis(); } kw(a) { super.kw(a); this.kz(a, "InnerRadiusExtentScale"); this.kz(a, "RadiusExtentScale"); } kz(a, b) { super.kz(a, b); let c = typeCast(NumericRadiusAxis.$, a); if (c == null) { return; } let d = this; if (b == "InnerRadiusExtentScale") { c.t3 = d.t3; } if (b == "RadiusExtentScale") { c.t4 = d.t4; } } get_dz() { return true; } ga() { let a = this.tu; let b = this.tt; let c = Math.min(this.ty(), this.tx()) * (a - b) / 2; c = Math.max(c, 14); return c; } ty() { return this.pk.width; } tx() { return this.pk.height; } constructor() { super(); this.tq = null; this.tr = false; this.ts = NaN; this.tu = 0; this.tt = 0; this.tw = 0; this.tn = null; this.ab = NumericRadiusAxis.$; this.tu = this.t4; this.tt = this.t3; this.tq = new PolarAxisRenderingManager(); this.qa = this.p8(); } a0() { return new RadialAxisLabelPanel(); } tv(a) { if (a == null) { return 0; } return a; } p8() { let a = super.p8(); a.b.c = (b) => { if ((this.a4 == null || this.a4.visibility == 0) && this.to != null) { if ((this.a4 == null || (this.a4.c == 4 || this.a4.c == 5)) && this.ts != b) { this.ts = b; this.a1.bn = b; this.b7.pt(); } } }; a.k = (b, c, d) => { let e = typeCast(PolarAxisRenderingParameters.$, b); this.tq.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.tq.l(c, d, e, f.aa, f.z, f.ab, f.center, f.minAngle, f.maxAngle); }; a.m = (b, c) => this.t1(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.tq.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.tv(this.hx) * 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; if (this.a4 != null && this.a4.c == 4) { e = 1; } d.d6 = { $type: Point_$type, x: ViewportUtils.e(0.5, c.ab, c.aa, c.z), y: e }; d.d3 = c.crossingAngleRadians; } } }; a.p = (b, c, d) => { let e = typeCast(PolarAxisRenderingParameters.$, b); if (this.to == null) { return false; } if (c > e.effectiveMaximum) { return false; } let f = false; f = this.a4 == null || (this.a4.c == 4 || this.a4.c == 5); let g = 0; if (f) { g = this.tw; } let h = e.center.x + c * Math.cos(g); let i = e.center.y + c * Math.sin(g); h = ViewportUtils.e(h, e.ab, e.aa, e.z); i = ViewportUtils.i(i, e.ab, e.aa, e.z); if (h <= b.aa.right && h >= b.aa.left && ((i <= b.aa.bottom && i >= b.aa.top) || !f)) { return true; } return false; }; a.h = (b, c) => { let d = typeCast(PolarAxisRenderingParameters.$, b); return new LabelPosition(1, ViewportUtils.e(d.center.x + c, d.ab, d.aa, d.z), c); }; a.r = (b, c, d, e) => { if (c < b.m) { return b.m; } else if (c > b.l) { return b.l; } return c; }; return a; } gc(a, b) { return this.t1(a); } t0(a, b, c, d, e) { let f = 0; if (b) { if (a <= 0) { f = (Math.log(this.ra) - this.rl) / (this.rk - this.rl); } else { f = (Math.log(a) - this.rl) / (this.rk - this.rl); } } else { f = (a - this.ra) / (this.q9 - this.ra); } if (c) { f = 1 - f; } f = e + (f * (d - e)); f /= 2; return f; } t1(a) { return this.t0(a, this.qv, this.ds, this.tu, this.tt); } t2(a) { let b = a * 2; b = (b - this.tt) / (this.tu - this.tt); if (this.dr) { b = 1 - b; } if (this.qv) { return Math.exp(b * (this.rk - this.rl) + this.rl); } else { return this.ra + b * (this.q9 - this.ra); } } gf(a, b) { return this.t2(a); } lk(a, b, c, d) { switch (b) { case "CrossingValue": this.tw = this.tv(this.hx) * Math.PI / 180; break; } super.lk(a, b, c, d); switch (b) { case NumericRadiusAxis.$$p[1]: this.tu = this.t4; if (this.tu < 0) { this.tu = 0.1; } if (this.tu > 1) { this.tu = 1; } if (this.tt >= this.tu) { this.tt = this.tu - 0.01; if (this.tt < 0) { this.tt = 0; this.tu = 0.01; } } this.d5 = true; this.l8(false); if (this.to != null) { this.to.l7(); } for (let e of fromEnum(this.et())) { e.sa(false); } break; case NumericRadiusAxis.$$p[0]: this.tt = this.t3; if (this.tt < 0) { this.tt = 0.1; } if (this.tt > 1) { this.tt = 1; } if (this.tt >= this.tu) { this.tt = this.tu - 0.01; if (this.tt < 0) { this.tt = 0; this.tu = 0.01; } } this.d5 = true; this.l8(false); if (this.to != null) { this.to.l7(); } for (let f of fromEnum(this.et())) { f.g8 = true; f.sa(false); } if (this.b7 != null) { this.b7.p8(); } break; case "CrossingAxis": let g = typeCast(NumericAngleAxis.$, d); let h = typeCast(CategoryAngleAxis.$, d); if (g == null && h == null) { this.t9(null); } if (g != null) { this.t9(g); g.t8(this); } if (h != null) { this.t9(h); h.s7(this); } this.d5 = true; this.l8(false); break; case "IsInverted": if (this.to != null) { this.to.d5 = true; this.to.l8(false); } break; } } t9(a) { this.to = a; } get to() { if (this.tn != null) { return this.tn; } let a = typeCast(XamDataChart.$, this.b7); if (a != null) { for (let b = 0; b < a.zu.count; b++) { if (typeCast(NumericAngleAxis.$, a.zu._inner[b]) !== null || typeCast(CategoryAngleAxis.$, a.zu._inner[b]) !== null) { return a.zu._inner[b]; } } } return this.tn; } set to(a) { this.tn = a; } ap() { return this.to; } qc() { return new PolarAxisRenderingParameters(); } qb(a, b, c, d) { let e = typeCast(PolarAxisRenderingParameters.$, super.qb(a, b, c, d)); let f = this.tq.h(b, a, c); let g = this.tq.i(b, a, c); let h = 0.5 * this.tu; let i = 0.5 * this.tt; let j, k; if (Rect.l_op_Equality(b, SeriesViewer.y8)) { k = this.q9; j = this.ra; } else { k = Math.min(g, h); j = this.t2(f); k = this.t2(k); let l = this.ua(a, c, b, j, k); j = l.p3; k = l.p4; } let m = { $type: Point_$type, x: 0.5, y: 0.5 }; let n = f; let o = g; let p = Math.min(d.width, d.height) * (this.tu - this.tt) / 2; if (this.tw == 0) { p = d.widt