UNPKG

igniteui-react-charts

Version:

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

1,489 lines (1,488 loc) 70.3 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-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 */ export let AngleAxisLabelPanel = /*@__PURE__*/ (() => { class AngleAxisLabelPanel extends 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.o8.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.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); } let 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 (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.zr.count; d++) { let 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); } } 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.rf == 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.rf == 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.zr.count; d++) { let 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); } } 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.rf == 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.tc == 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; } } AngleAxisLabelPanel.$t = /*@__PURE__*/ markType(AngleAxisLabelPanel, 'AngleAxisLabelPanel', AxisLabelPanelBase.$); return AngleAxisLabelPanel; })(); /** * @hidden */ export let CategoryAngleAxis = /*@__PURE__*/ (() => { class CategoryAngleAxis extends CategoryAxisBase { bo() { return new CategoryAngleAxisView(this); } k8(a) { super.k8(a); this.ri = a; } al() { return new CategoryAngleAxis(); } ko(a) { super.ko(a); this.kr(a, "ActualInterval"); this.kr(a, "ActualMinorInterval"); this.kr(a, "StartAngleOffset"); this.kr(a, "LabelMode"); } kr(a, b) { super.kr(a, b); let c = typeCast(CategoryAngleAxis.$, a); if (c == null) { return; } let 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; } } get_dc() { return true; } ky(a) { super.ky(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; } } constructor() { super(); 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(); } a0() { let a = new AngleAxisLabelPanel(); a.dq = (b, c, d) => { let e = this.b7 != null ? this.b7.ys : Rect.empty; let f = !e.isEmpty ? this.o8 : Rect.empty; let 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; } rr(a) { return false; } sl() { return null; } sa(a) { return Math.round(a * Math.pow(10, 10)) / Math.pow(10, 10); } rj() { let a = ((() => { let $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); } 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.mc(); this.km(c); this.km(d); this.km(e); this.km(f); }; b.o = (c, d) => !d.isEmpty && !c.isEmpty && this.rm != null; b.d = (c, d, e, f) => this.rh(c, d, e, f); b.v = () => { if (!this.ro) { this.ro = true; this.rm.ee(); this.ro = false; } }; b.g = (c, d) => { let 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; } let f = this.po.item(e); return this.hy(f); }; b.b.c = (c) => { if ((this.a4 == null || this.a4.visibility == 0) && this.rm != null && this.rv != c) { let d = typeCast(XamDataChart.$, this.b7); if (d == null) { return; } this.rv = c; this.a1.bn = c; d.ps(); for (let e of fromEnum(d.zr)) { if (e != this && typeCast(AngleAxisLabelPanel.$, e.a1) !== null) { e.bp.ap(); } } } }; b.k = (c, d, e) => { let f = typeCast(RadialAxisRenderingParameters.$, c); this.rn.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.rn.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.sa(d - this.rw) < 0) { return false; } if (this.sa(d - this.rw - (2 * Math.PI)) > 0) { return false; } return true; }; b.j = (c) => { let 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 = (c) => { c.n = this.r2(); c.r = c.n; }; b.p = (c, d, e) => { let f = typeCast(RadialAxisRenderingParameters.$, c); if (e) { return false; } let 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 = (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.qc); let 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; } rs(a) { return false; } s2(a, b, c, d, e, f) { let g = this.r2(); 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 }; } s1(a, b, c, d, e, f, g, h) { if (!isNaN_(b) && !isNaN_(c)) { let i = this.r2(); 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.s2(a, d, e, f, g, h); } } r2() { if (this.rm == null) { return 0; } if (!this.c2()) { return this.rm.tn(); } else { return this.rm.to((this.ht)); } } rh(a, b, c, d) { if (this.po == null) { return null; } let e = new RadialAxisRenderingParameters(); let f = this.qd - 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.rq(); e.p = this.r8; e.o = this.go(); e.s = this.se(); e.q = this.r9; e.t = this.hz; let k = this.rn.h(b, a, c); let l = this.rn.i(b, a, c); let m = 0.5 * this.rm.ti; let n = 0.5 * this.rm.th; let o = k; let p = l; let q = this.rm.tn(); if (isNaN_(q) || isInfinity(q)) { return null; } if (p >= m) { p = q; } if (o < n) { o = n; } let r = a.width; this.rn.m(b, a, c, e, 0, this.qd, 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.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; } se() { return -1; } getMinMaxAngle(a, b, c, d, e) { let f = this.rn.n(a, b, c, d, e); d = f.p3; e = f.p4; return { p3: d, p4: e }; } ac() { super.ac(); this.l0(false); } get rm() { if (this.rl != null) { return this.rl; } let a = typeCast(XamDataChart.$, this.b7); if (a != null) { for (let b = 0; b < a.zr.count; b++) { if (typeCast(NumericRadiusAxis.$, a.zr._inner[b]) !== null) { return a.zr._inner[b]; } } } return this.rl; } set rm(a) { this.rl = a; } ap() { return this.rm; } rg() { if (this.rf == 0) { return 1; } else { return this.rf; } } getCategorySize(a, b, c) { return 2 * Math.PI / this.qc; } get_rp() { return false; } get rp() { return this.get_rp(); } r4(a, b, c, d) { return this.p1(b, c, d); } p1(a, b, c) { let d = this.p8(a, b, c); let e = 0; if (!isNaN_(this.p7)) { e = Math.min(this.p7, 1); } let f = 1 - 0.5 * d; return this.getCategorySize(a, b, c) * f / (this.qe - (this.qe - 1) * e); } r3(a, b, c, d, e) { return this.getGroupCenter(b, c, d, e); } getGroupCenter(a, b, c, d) { let e = 0.5; if (this.qe > 1) { let f = this.p8(b, c, d); let g = 0; if (!isNaN_(this.p7)) { g = Math.min(this.p7, 1); } let h = 1 - 0.5 * f; let i = h / (this.qe - (this.qe - 1) * g); let j = (h - i) / (this.qe - 1); e = 0.25 * f + 0.5 * i + a * j; } return this.getCategorySize(b, c, d) * e; } r7(a) { let b = 0.5; if (this.qe > 1) { let c = this.p8(Rect.empty, Rect.empty, Rect.empty); let d = 0; if (!isNaN_(this.p7)) { d = Math.min(this.p7, 1); } let e = 1 - 0.5 * c; let f = e / (this.qe - (this.qe - 1) * d); let g = (e - f) / (this.qe - 1); b = 0.25 * c + 0.5 * f + a * g; } return b; } l1(a) { super.l1(a); let b = this.b7 != null ? this.b7.ys : Rect.empty; let c = !b.isEmpty ? this.o8 : Rect.empty; let d = this.o3(); let e = this.o2(); let f = this.rk.c(a, c, b, d, e); if (f != null) { this.rx = f.f.m; this.ry = f.f.l; } } r6(a, b, c) { let d; let e; let 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; } } let g = this.getUnscaledAngle(d); if (g < 0 || g > this.qc) { g = this.getUnscaledAngle(d + Math.PI * 2); } return g; } r5(a, b, c) { let d; let e; let 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; } } let g = this.getUnscaledAngle(e); if (g < 0 || g > this.qc) { g = this.getUnscaledAngle(e + Math.PI * 2); } return g; } getScaledAngle(a) { let b = this.qc; let c = b >= 2 ? (a) / (b) : b == 1 ? 0.5 : NaN; if (this.dp) { c = 1 - c; } return (c * 2 * Math.PI) + this.rw; } getUnscaledAngle(a) { if (a < this.rw) { a += 2 * Math.PI; } let b = (a - this.rw) / (2 * Math.PI); if (this.dn) { b = 1 - b; } return b * (this.qc); } f7(a, b) { return this.getScaledAngle(a); } ga(a, b) { return this.getUnscaledAngle(a); } fr(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; } gj(a) { let b = a - this.rw; if (b < 0) { b += Math.PI * 2; } if (b > Math.PI * 2) { b -= Math.PI * 2; } return b; } lc(a, b, c, d) { super.lc(a, b, c, d); let e = typeCast(XamDataChart.$, this.b7); switch (b) { case "CrossingAxis": let 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); for (let g of fromEnum(this.et)) { g.r9(false); g.q1(); } break; case "Label": case CategoryAngleAxis.$$p[4]: if (e != null) { for (let h of fromEnum(e.zr)) { h.d1 = true; h.lz(); } } break; case "CrossingValue": if (e != null) { for (let i of fromEnum(e.zr)) { if (typeCast(NumericAngleAxis.$, i) !== null || typeCast(CategoryAngleAxis.$, i) !== null) { i.d1 = true; i.lz(); } } } 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; } } sq() { this.rv = NaN; } ss(a) { this.rm = a; } get r8() { return this.c(CategoryAngleAxis.sx); } set r8(a) { this.h(CategoryAngleAxis.sx, a); } get rx() { return this.rt; } set rx(a) { if (this.rx != a) { let b = this.rt; this.rt = a; this.lu("ActualInterval", b, this.rx); } } gk() { return this.rx; } get r9() { return this.c(CategoryAngleAxis.sz); } set r9(a) { this.h(CategoryAngleAxis.sz, a); } get ry() { return this.ru; } set ry(a) { if (this.ry != a) { let b = this.ru; this.ru = a; this.lu("ActualMinorInterval", b, this.ry); } } rq() { return !isNaN_(this.r8); } get_bm() { return 2; } get bm() { return this.get_bm(); } eg() { if (this.d1 && this.eh) { this.b1 = this.b0(); } if (this.po == null) { return false; } let a = this.po.count; if (a != this.sd) { let b = new AxisRangeChangedEventArgs(0, 1, 1, this.sd, a); this.sd = a; this.lv(b); return true; } return false; } get sd() { return this.sc; } set sd(a) { this.sc = a; } ox(a, b, c, d, e) { let f = typeCast(RadialAxisRenderingParameters.$, this.rk.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.dz; } j$d(a, b) { return this.ga.apply(this, arguments); } j$c(a, b) { return this.f7.apply(this, arguments); } j$e(a, b, c, d, e) { this.k2.apply(this, arguments); } j$f(a, b, c, d) { this.k3.apply(this, arguments); } j$g(a, b, c, d) { this.k4.apply(this, arguments); } get j$b() { return this.dn; } j$a() { return this.ag.apply(this, arguments); } } CategoryAngleAxis.$t = /*@__PURE__*/ markType(CategoryAngleAxis, 'CategoryAngleAxis', CategoryAxisBase.$, [IAngleScaler_$type]); CategoryAngleAxis.sx = /*@__PURE__*/ DependencyProperty.i("Interval", Number_$type, CategoryAngleAxis.$, /*@__PURE__*/ new PropertyMetadata(2, NaN, (a, b) => { a.lu("Interval", b.oldValue, b.newValue); a.l0(false); })); CategoryAngleAxis.sz = /*@__PURE__*/ DependencyProperty.i("MinorInterval", Number_$type, CategoryAngleAxis.$, /*@__PURE__*/ new PropertyMetadata(2, NaN, (a, b) => { (typeCast(CategoryAngleAxis.$, a)).lu("MinorInterval", b.oldValue, b.newValue); (typeCast(CategoryAngleAxis.$, a)).l0(false); })); CategoryAngleAxis.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, CategoryAngleAxis, 'lu', ['CompanionAxisInterval:rz:st', [1, NaN], 'CompanionAxisLabelMode:re:su', [AxisAngleLabelMode_$type, /*@__PURE__*/ enumGetBox(AxisAngleLabelMode_$type, 0)], 'CompanionAxisMinorInterval:r0:sv', [1, NaN], 'CompanionAxisStartAngleOffset:r1:sw', [1, NaN], 'LabelMode:rf:sy', [AxisAngleLabelMode_$type, /*@__PURE__*/ enumGetBox(AxisAngleLabelMode_$type, 0)], 'StartAngleOffset:sb:s0', [1, 0]]); return CategoryAngleAxis; })(); /** * @hidden */ export let NumericAngleAxis = /*@__PURE__*/ (() => { class NumericAngleAxis extends NumericAxisBase { bo() { return new NumericAngleAxisView(this); } k8(a) { super.k8(a); this.te = a; } al() { return new NumericAngleAxis(); } ko(a) { super.ko(a); this.kr(a, "LabelMode"); this.kr(a, "StartAngleOffset"); } kr(a, b) { super.kr(a, b); let c = typeCast(NumericAngleAxis.$, a); if (c == null) { return; } let 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; } } get_dc() { return true; } constructor() { super(); 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(); } a0() { let a = new AngleAxisLabelPanel(); a.dq = (b, c, d) => { let e = this.b7 != null ? this.b7.ys : Rect.empty; let f = !e.isEmpty ? this.o8 : Rect.empty; let g = this.o3(); return this.t1(b, { $type: Point_$type, x: 0.5, y: 0.5 }, e, f, g, this.a1.bo); }; return a; } tm() { if (this.tg == null) { return 0; } if (!this.c2()) { return this.tg.tn(); } else { return this.tg.to((this.ht)); } } to(a) { return Math.round(a * Math.pow(10, 10)) / Math.pow(10, 10); } pw() { let a = super.pw(); a.b.c = (b) => { if ((this.a4 == null || this.a4.visibility == 0) && this.tg != null && this.tj != b) { let c = typeCast(XamDataChart.$, this.b7); if (c == null) { return; } this.tj = b; this.a1.bn = b; c.ps(); for (let d of fromEnum(c.zr)) { if (d != this && typeCast(AngleAxisLabelPanel.$, d.a1) !== null) { d.bp.ap(); } } } }; a.e = (b) => { b.n = this.tm(); b.r = b.n; }; a.j = (b) => { let 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 = (b, c, d) => { let e = typeCast(PolarAxisRenderingParameters.$, b); this.th.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.th.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.pz(b, c, d, e)); return f; }; a.v = () => { if (!this.ti) { this.ti = true; this.tg.ee(); this.ti = false; } }; a.m = (b, c) => this.getScaledAngle(c); a.o = (b, c) => !c.isEmpty && !b.isEmpty && this.tg != null; a.q = (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 = (b, c, d) => { let e = typeCast(PolarAxisRenderingParameters.$, b); let f = this.t1(this.getScaledAngle(e.l), e.center, b.ab, b.aa, b.z, 0); let 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 = (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; } t1(a, b, c, d, e, f) { let g = this.tm(); 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 }; } f7(a, b) { return this.getScaledAngle(a); } getScaledAngle1(a, b, c) { let 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; } getScaledAngle(a) { return this.getScaledAngle1(a, this.qj, this.dp); } ga(a, b) { return this.getUnscaledAngle(a); } getUnscaledAngle(a) { let 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); } } td() { if (this.tc == 0) { return 1; } else { return this.tc; } } lc(a, b, c, d) { super.lc(a, b, c, d); let e = typeCast(XamDataChart.$, this.b7); switch (b) { case "CrossingAxis": let 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); for (let g of fromEnum(this.ep())) { g.r9(false); g.q1(); } break; case "Label": if (e != null) { for (let h of fromEnum(e.zr)) { h.lz(); } } break; case "CrossingValue": if (e != null) { for (let i of fromEnum(e.zr)) { if (typeCast(NumericAngleAxis.$, i) !== null || typeCast(CategoryAngleAxis.$, i) !== null) { i.lz(); } } } 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; } } ky(a) { super.ky(a); switch (a) { case NumericAngleAxis.$$p[0]: case NumericAngleAxis.$$p[1]: this.ku(a); break; } } tu() { this.tj = NaN; } p0() { return new PolarAxisRenderingParameters(); } pz(a, b, c, d) { let e = typeCast(PolarAxisRenderingParameters.$, super.pz(a, b, c, d)); let f = this.th.h(b, a, c); let g = this.th.i(b, a, c); let h = 0.5 * this.tg.ti; let i = 0.5 * this.tg.th; let j = f; let k = g; let l = this.tg.tn(); if (isNaN_(l) || isInfinity(l)) { return null; } if (k >= h) { k = l; } if (j < i) { j = i; } let m = a.width; this.th.m(b, a, c, e, this.qy, this.qx, 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.th.n(a, b, c, d, e); d = f.p3; e = f.p4; return { p3: d, p4: e }; } l1(a) { super.l1(a); let b = this.b7 != null ? this.b7.ys : Rect.empty; let c = !b.isEmpty ? this.o8 : Rect.empty; let d = this.o3(); let e = this.o2(); let f = this.py.c(a, c, b, d, e); if (f != null) { this.qw = f.f.m; this.qz = f.f.l; } } get tg() { if (this.tf != null) { return this.tf; } let a = typeCast(XamDataChart.$, this.b7); if (a != null) { for (let b = 0; b < a.zr.count; b++) { if (a.zr._inner[b].dv) { return a.zr._inner[b]; } } } return this.tf; } set tg(a) { this.tf = a; } ap() { return this.tg; } tw(a) { this.tg = a; } mf(a, b) { super.mf(a, b); if (b.height != a.height || b.width != a.width) { this.ee(); } } get_bm() { return 2; } get bm() { return this.get_bm(); } ox(a, b, c, d, e) { if (this.tg == null) { return null; } let f = typeCast(PolarAxisRenderingParameters.$, this.pz(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; } gj(a) { let b = a - this.tk; if (b < 0) { b += Math.PI * 2; } if (b > Math.PI * 2) { b -= Math.PI * 2; } return b; } } NumericAngleAxis.$t = /*@__PURE__*/ markType(NumericAngleAxis, 'NumericAngleAxis', NumericAxisBase.$, [IAngleScaler_$type]); NumericAngleAxis.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, NumericAngleAxis, 'lu', ['CompanionAxisLabelMode:tb:tx', [AxisAngleLabelMode_$type, /*@__PURE__*/ enumGetBox(AxisAngleLabelMode_$type, 0)], 'CompanionAxisStartAngleOffset:tl:ty', [1, NaN], 'LabelMode:tc:tz', [AxisAngleLabelMode_$type, /*@__PURE__*/ enumGetBox(AxisAngleLabelMode_$type, 0)], 'StartAngleOffset:tp:t0', [1, 0]]); return NumericAngleAxis; })(); /** * @hidden */ export let NumericRadiusAxis = /*@__PURE__*/ (() => { class NumericRadiusAxis extends NumericAxisBase { bo() { return new NumericRadiusAxisView(this); } k8(a) { super.k8(a); this.td = a; } al() { return new NumericRadiusAxis(); } ko(a) { super.ko(a); this.kr(a, "InnerRadiusExtentScale"); this.kr(a, "RadiusExtentScale"); } kr(a, b) { super.kr(a, b); let c = typeCast(NumericRadiusAxis.$, a); if (c == null) { return; } let d = this; if (b == "InnerRadiusExtentScale") { c.tr = d.tr; } if (b == "RadiusExtentScale") { c.ts = d.ts; } } get_dv() { return true; } f6() { let a = this.ti; let b = this.th; let c = Math.min(this.tm(), this.tl()) * (a - b) / 2; c = Math.max(c, 14); return c; } tm() { return this.o8.width; } tl() { return this.o8.height; } constructor() { super(); this.te = null; this.tf = false; this.tg = NaN; this.ti = 0; this.th = 0; this.tk = 0; this.tb = null; this.ab = NumericRadiusAxis.$; this.ti = this.ts; this.th = this.tr; this.te = new PolarAxisRenderingManager(); this.py = this.pw(); } a0() { return new RadialAxisLabelPanel(); } tj(a) { if (a == null) { return 0; } return a; } pw() { let a = super.pw(); a.b.c = (b) => { if ((this.a4 == null || this.a4.visibility == 0) && this.tc != null) { if ((this.a4 == null || (this.a4.c == 4 || this.a4.c == 5)) && this.tg != b) { this.tg = b; this.a1.bn = b; this.b7.ps(); } } }; a.k = (b, c, d) => { let e = typeCast(PolarAxisRenderingParameters.$, b); this.te.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.te.l(c, d, e, f.aa, f.z, f.ab, f.center, f.minAngle, f.maxAngle); }; a.m = (b, c) => this.to(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.te.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.tj(this.ht) * 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.tc == null) { return false; } if (c > e.effectiveMaximum) { return false; } let f = false; f = this.a4 == null || (this.a4.c == 4 || this.a4.c == 5);