UNPKG

igniteui-react-charts

Version:

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

1,277 lines (1,276 loc) 49.6 kB
/* THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE AGREEMENT ("AGREEMENT") LOCATED HERE: https://www.infragistics.com/legal/license/igultimate-la https://www.infragistics.com/legal/license/igultimate-eula GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company. */ import { __extends, __values } from "tslib"; import { AnchoredRadialSeries } from "./AnchoredRadialSeries"; import { DependencyProperty } from "igniteui-react-core"; import { Point_$type, enumGetBox, runOn, typeCast, markType, markDep, PointUtil, fromEnum } from "igniteui-react-core"; import { LegendEmptyValuesMode_$type } from "igniteui-react-core"; import { Defaults } from "./Defaults"; import { Rect } from "igniteui-react-core"; import { ScalerParams } from "./ScalerParams"; import { Path } from "igniteui-react-core"; import { SliceCoords } from "./SliceCoords"; import { List$1 } from "igniteui-react-core"; import { RadialBaseView } from "./RadialBaseView"; import { CoreGeometryUtil } from "igniteui-react-core"; import { Pool$1 } from "igniteui-react-core"; import { ViewportUtils } from "./ViewportUtils"; import { Size } from "igniteui-react-core"; import { GeometryUtil } from "igniteui-react-core"; import { PathFigure } from "igniteui-react-core"; import { PathGeometry } from "igniteui-react-core"; import { PathSegmentCollection } from "igniteui-react-core"; import { ArcSegment } from "igniteui-react-core"; import { PathFigureCollection } from "igniteui-react-core"; import { EllipseGeometry } from "igniteui-react-core"; import { LineSegment } from "igniteui-react-core"; import { PieSliceCollisionGeometry } from "igniteui-react-core"; import { MathUtil } from "igniteui-react-core"; import { ProportionalCategoryAngleAxis } from "./ProportionalCategoryAngleAxis"; import { SeriesPointOfInterest } from "./SeriesPointOfInterest"; import { DataContext } from "igniteui-react-core"; import { ChartSelection } from "./ChartSelection"; import { CollisionRect } from "igniteui-react-core"; import { PropertyMetadata } from "igniteui-react-core"; import { intDivide, isNaN_ } from "igniteui-react-core"; import { AnchoredRadialSeriesView } from "./AnchoredRadialSeriesView"; /** * @hidden */ var RadialPieSeries = /** @class */ /*@__PURE__*/ (function (_super) { __extends(RadialPieSeries, _super); function RadialPieSeries() { var _this = _super.call(this) || this; _this.aej = null; _this.aeq = null; _this.aeg = 0; _this.aem = false; _this.ab = RadialPieSeries.$; return _this; } RadialPieSeries.prototype.bk = function () { return new RadialPieSeries(); }; RadialPieSeries.prototype.get_fr = function () { return true; }; RadialPieSeries.prototype.get_fp = function () { return true; }; RadialPieSeries.prototype.jt = function () { if (!isNaN_(this.js)) { return _super.prototype.jt.call(this); } return Defaults.h; }; RadialPieSeries.prototype.ct = function () { return new RadialPieSeriesView(this); }; RadialPieSeries.prototype.ri = function (a) { _super.prototype.ri.call(this, a); this.aei = a; }; RadialPieSeries.prototype.g3 = function (a, b) { if (this.g6(a, b)) { return true; } if (this.x3(a, b)) { return true; } return false; }; RadialPieSeries.prototype.g6 = function (a, b) { var c = this.zv(); var d = this.cw.ca; var e = this.cw.b9; var f = this.cw.getEffectiveViewport(); var g = this.w5(this.cw); var h = this.zr; var i = this.zr.pz(e, d, f, g); var j = this.zs.d(0, this.zr.tr, d, e, f); var k = this.zs.e(0, this.zr.tr, d, e, f); var l = { $type: Point_$type, x: j, y: k }; var m = new ScalerParams(0, d, e, h.dn, f); var n = NaN; var o = NaN; var p = this.zs.h(a.x, a.y, d, e, f, n, o); n = p.p5; o = p.p6; n = this.zl.getScaledAngle(n); o = h.f7(o, m); var q = Math.max(0, 0.5 * h.th); var r = q; r = Math.max(r, i.minLength); var s = this.zl.p1(d, e, f); var t = this.zl.ds; var u = { $type: Point_$type, x: 0.5, y: 0.5 }; var v = this.i2(b) + (this.im / 2); var w = this.am(this.a0(), c.k, this.aar(this.cw), this.aas(this.cw), this.w3(a), true); var x = this.an(this.a0(), c.k, this.aar(this.cw), this.aas(this.cw), this.w3(a), true); if (x == null) { return false; } var y = this.zl; var z = new ScalerParams(1, d, e, y.dn); z.c = this.getEffectiveViewport(); for (var aa = 0; aa < x.length; aa++) { var ab = x[aa][0]; var ac = Math.min(x[aa][2], i.maxLength); var ad = x[aa][1]; var ae = x[aa][2]; var af = x[aa][3]; var ag = w[aa]; if (t) { if (isNaN_(ab) || isNaN_(ad) || isNaN_(ae)) { continue; } var ah = (this.zt.da.c + ag) * this.zt.da.b; if ((this.zt.da.c + ag) * this.zt.da.b > this.zl.qd - 1) { if ((ah) * this.zt.da.b >= this.zl.qc) { ah = (ah) - (intDivide((this.zl.qc), this.zt.da.b)); } } s = af; if (isNaN_(s)) { continue; } } var ai = null; ai = this.ae2(d, e, f, ab - (s * 0.5), ab + (s * 0.5), r, ac, u); var aj = new Path(); aj.an = ai; if (CoreGeometryUtil.j(a, aj, v)) { return true; } var ak = SliceCoords.b(d, e, f, ab - (s * 0.5), ab + (s * 0.5), r, ac, u); if (CoreGeometryUtil.d(n, ab - (s * 0.5), s, ak.c, 1) && o >= r && o <= ac) { return true; } } return false; }; Object.defineProperty(RadialPieSeries.prototype, "aek", { get: function () { return this.aej; }, set: function (a) { if (this.aej != a) { var b = this.aek; this.aej = a; this.raisePropertyChanged("LegendLabelColumn", b, this.aek); } }, enumerable: false, configurable: true }); Object.defineProperty(RadialPieSeries.prototype, "aet", { get: function () { return this.aeq; }, set: function (a) { if (this.aeq != a) { var b = this.aeq; this.aeq = a; this.raisePropertyChanged("LegendLabelMemberPath", b, this.aeq); } }, enumerable: false, configurable: true }); Object.defineProperty(RadialPieSeries.prototype, "aeh", { get: function () { return this.aeg; }, set: function (a) { if (this.aeg != a) { var b = this.aeg; this.aeg = a; this.raisePropertyChanged("LegendEmptyValuesMode", enumGetBox(LegendEmptyValuesMode_$type, b), enumGetBox(LegendEmptyValuesMode_$type, this.aeg)); } }, enumerable: false, configurable: true }); Object.defineProperty(RadialPieSeries.prototype, "aen", { get: function () { return this.aem; }, set: function (a) { if (this.aem != a) { var b = this.aem; this.aem = a; this.raisePropertyChanged("UseInsetOutlines", b, this.aem); } }, enumerable: false, configurable: true }); RadialPieSeries.prototype.preferredCategoryMode = function (a) { return a != null && a == this.zl ? 2 : 0; }; RadialPieSeries.prototype.pj = function (a, b) { _super.prototype.pj.call(this, a, b); var c = b; if (a && c.dj != null) { c.dj.count = 0; } }; RadialPieSeries.prototype.i4 = function () { return this.zl.p1(this.cw.ca, this.cw.b9, this.getEffectiveViewport1(this.cw)); }; RadialPieSeries.prototype.ar = function (a, b) { var c = new List$1(Rect.$, 0); var d = this.cw.ca; var e = this.cw.b9; var f = this.getEffectiveViewport1(this.cw); var g = this.w5(this.cw); var h = this.zr.pz(e, d, f, g); var i = { $type: Point_$type, x: 0.5, y: 0.5 }; var j = this.zr; var k = Math.max(0, 0.5 * j.th); var l = k; l = Math.max(l, h.minLength); var m = this.zl.p1(d, e, f); var n = this.zl != null && this.zl.ds; var o = this.zu; if (this.d4()) { o = this.zx; } { if (n) { m = this.aal(a, d, e, f); } if (b < 0 || b > o.k.count - 1) { return null; } var p = o.k._inner[b][0]; var q = Math.min(o.k._inner[b][2], h.maxLength); return this.ael(d, e, f, p - (m * 0.5), p + (m * 0.5), l, q, i); } }; RadialPieSeries.prototype.get_ef = function () { return true; }; RadialPieSeries.prototype.get_ac7 = function () { return true; }; RadialPieSeries.prototype.get_ac1 = function () { return true; }; RadialPieSeries.prototype.iw = function () { var a = _super.prototype.iw.call(this); if (this.aen && !isNaN_(a)) { a = a * 2; } return a; }; RadialPieSeries.prototype.abz = function (a, b) { _super.prototype.abz.call(this, a, b); var c = b; var d = b.ca; var e = b.b9; var f = this.getEffectiveViewport1(b); var g = this.w5(b); var h = this.zr.pz(e, d, f, g); var i = a.k; var j = this.zr; var k = Math.max(0, 0.5 * j.th); var l = k; l = Math.max(l, h.minLength); var m = this.zl.p1(d, e, f); var n = this.zl.ds; var o = { $type: Point_$type, x: 0.5, y: 0.5 }; var p = this.aeo; var q = this.aep; var r = (p > 0 && q > 0); var s = this.acz.count; this.z0.a2(this, this.aah(), runOn(this, this.y9), this.aar(b), this.aas(b)); this.z0.r = this.aeo; this.z0.s = this.aep; this.z0.k = this.aeo; this.z0.l = this.aep; this.z0.t = this.aen ? this.jz * 2 : this.jz; var t = false; var u = this.z0.b; if (u != null) { t = true; } var v = this.zl; var w = new ScalerParams(1, b.ca, b.b9, v.dn); w.c = this.getEffectiveViewport(); var x = 0; var y = 0; for (var z = 0; z < i.count; ++z) { var aa = i._inner[z][0]; var ab = Math.min(i._inner[z][2], h.maxLength); var ac = i._inner[z][1]; var ad = i._inner[z][2]; var ae = i._inner[z][3]; if (t) { this.adw(i, z, s, v, w, b.t); } if (n) { if (isNaN_(aa) || isNaN_(ac) || isNaN_(ad)) { continue; } var af = (b.da.c + z) * b.da.b; if ((b.da.c + z) * b.da.b > this.zl.qd - 1) { if ((af) * b.da.b >= this.zl.qc) { af = (af) - (intDivide((this.zl.qc), b.da.b)); } } m = ae; if (isNaN_(m)) { continue; } } var ag = c.dj.item(x); x++; var ah = this.z0.k; var ai = this.z0.l; r = (ah > 0 && ai > 0); var aj = null; if (r) { aj = this.ae1(d, e, f, aa - (m * 0.5), aa + (m * 0.5), l, ab, o, ah, ai); } else { aj = this.ae2(d, e, f, aa - (m * 0.5), aa + (m * 0.5), l, ab, o); } ag.an = aj; this.z0.ad(ag, false, false, false, false); var ak = i._inner[z][2]; if (ak > y) { y = ak; } } c.dc = ViewportUtils.f(y, d, e); c.dd = { $type: Point_$type, x: ViewportUtils.e(o.x, d, e, f), y: ViewportUtils.i(o.y, d, e, f) }; c.dj.count = x; c.dp(); }; RadialPieSeries.prototype.aey = function (a, b, c, d, e, f, g) { if (g == 0) { return; } var h = a.l.width > 0 || a.l.height > 0; var i = a.m.width > 0; if (!h) { var j = a.d; var k = a.f; var l = GeometryUtil.h(j, k); var m = { $type: Point_$type, x: (j.x - k.x) / l, y: (j.y - k.y) / l }; var n = { $type: Point_$type, x: -m.y, y: m.x }; var o = a.j; var p = a.h; var q = GeometryUtil.h(o, p); var r = { $type: Point_$type, x: (p.x - o.x) / q, y: (p.y - o.y) / q }; var s = { $type: Point_$type, x: -r.y, y: r.x }; k = { $type: Point_$type, x: k.x + n.x * g, y: k.y + n.y * g }; j = { $type: Point_$type, x: j.x + n.x * g, y: j.y + n.y * g }; o = { $type: Point_$type, x: o.x + s.x * g, y: o.y + s.y * g }; p = { $type: Point_$type, x: p.x + s.x * g, y: p.y + s.y * g }; if (a.m.width > 0 && a.m.height > 0) { var t = { $type: Point_$type, x: j.x + m.x * g, y: j.y + m.y * g }; var u = { $type: Point_$type, x: k.x + m.x * -g, y: k.y + m.y * -g }; var v = { $type: Point_$type, x: p.x + r.x * g, y: p.y + r.y * g }; var w = { $type: Point_$type, x: o.x + r.x * -g, y: o.y + r.y * -g }; a.d = t; a.f = u; a.h = v; a.j = w; if (Math.abs((c - b) - Math.PI) <= 0.0001) { var x = this.zt.ca; var y = this.zt.b9; var z = this.getEffectiveViewport1(this.zt); var aa = ViewportUtils.e(d.x, x, y, z); var ab = ViewportUtils.i(d.y, x, y, z); var ac = { $type: Point_$type, x: aa, y: ab }; var ad = ViewportUtils.d(e, x, y, z); var ae = ViewportUtils.h(e, x, y, z); var af = Math.min(ad, ae); var ag = j; var ah = GeometryUtil.o(ag, k, ac, af - g); if (!isNaN_(ah.c.x) && !isNaN_(ah.c.y) && !isNaN_(ah.d.x) && !isNaN_(ah.d.y)) { if ((Math.pow(ag.x - ah.c.x, 2) + Math.pow(ag.y - ah.c.y, 2)) < (Math.pow(ag.x - ah.d.x, 2) + Math.pow(ag.y - ah.d.y, 2))) { ag = ah.c; } else { ag = ah.d; } a.d = ag; } var ai = o; ah = GeometryUtil.o(ai, p, ac, af - g); if (!isNaN_(ah.c.x) && !isNaN_(ah.c.y) && !isNaN_(ah.d.x) && !isNaN_(ah.d.y)) { if ((Math.pow(ai.x - ah.c.x, 2) + Math.pow(ai.y - ah.c.y, 2)) < (Math.pow(ai.x - ah.d.x, 2) + Math.pow(ai.y - ah.d.y, 2))) { ai = ah.c; } else { ai = ah.d; } a.j = ai; } a.m = new Size(1, a.m.width - g, a.m.height - g); var aj = ViewportUtils.d(f, x, y, z); var ak = ViewportUtils.h(f, x, y, z); var al = Math.min(aj, ak); ah = GeometryUtil.o(j, k, ac, al + g); if (!isNaN_(ah.c.x) && !isNaN_(ah.c.y) && !isNaN_(ah.d.x) && !isNaN_(ah.d.y)) { var am = void 0; if ((Math.pow(k.x - ah.c.x, 2) + Math.pow(k.y - ah.c.y, 2)) < (Math.pow(k.x - ah.d.x, 2) + Math.pow(k.y - ah.d.y, 2))) { am = ah.c; } else { am = ah.d; } a.f = am; } ah = GeometryUtil.o(p, o, ac, al + g); if (!isNaN_(ah.c.x) && !isNaN_(ah.c.y) && !isNaN_(ah.d.x) && !isNaN_(ah.d.y)) { var an = void 0; if ((Math.pow(p.x - ah.c.x, 2) + Math.pow(p.y - ah.c.y, 2)) < (Math.pow(p.x - ah.d.x, 2) + Math.pow(p.y - ah.d.y, 2))) { an = ah.c; } else { an = ah.d; } a.h = an; } a.n = new Size(1, a.n.width + g, a.n.height + g); } else { if (g < 0) { var ao = GeometryUtil.t(a.d, a.f, a.j, a.h); if (!isNaN_(ao.x)) { a.d = ao; a.j = ao; } } a.m = new Size(1, a.m.width - g, a.m.height - g); a.n = new Size(1, a.n.width + g, a.n.height + g); } } else { a.f = { $type: Point_$type, x: k.x + m.x * -g, y: k.y + m.y * -g }; a.h = { $type: Point_$type, x: p.x + r.x * g, y: p.y + r.y * g }; var ap = c - b; if (Math.abs((c - b) - Math.PI) <= 0.0001) { var aq = this.zt.ca; var ar = this.zt.b9; var as = this.getEffectiveViewport1(this.zt); var at = ViewportUtils.e(d.x, aq, ar, as); var au = ViewportUtils.i(d.y, aq, ar, as); var av = { $type: Point_$type, x: at, y: au }; var aw = ViewportUtils.d(f, aq, ar, as); var ax = ViewportUtils.h(f, aq, ar, as); var ay = Math.min(aw, ax); if (g > 0) { k = { $type: Point_$type, x: k.x + m.x * -g, y: k.y + m.y * -g }; p = { $type: Point_$type, x: p.x + r.x * g, y: p.y + r.y * g }; } var az = GeometryUtil.o(j, k, av, ay + g); if (!isNaN_(az.c.x) && !isNaN_(az.c.y) && !isNaN_(az.d.x) && !isNaN_(az.d.y)) { var a0 = void 0; if ((Math.pow(k.x - az.c.x, 2) + Math.pow(k.y - az.c.y, 2)) < (Math.pow(k.x - az.d.x, 2) + Math.pow(k.y - az.d.y, 2))) { a0 = az.c; } else { a0 = az.d; } a.f = a0; } az = GeometryUtil.o(p, o, av, ay + g); if (!isNaN_(az.c.x) && !isNaN_(az.c.y) && !isNaN_(az.d.x) && !isNaN_(az.d.y)) { var a1 = void 0; if ((Math.pow(p.x - az.c.x, 2) + Math.pow(p.y - az.c.y, 2)) < (Math.pow(p.x - az.d.x, 2) + Math.pow(p.y - az.d.y, 2))) { a1 = az.c; } else { a1 = az.d; } a.h = a1; } a.d = j; a.j = o; a.n = new Size(1, a.n.width + g, a.n.height + g); } else if (ap < Math.PI) { var a2 = GeometryUtil.t(k, j, o, p); if (!isNaN_(a2.x)) { a.d = a2; a.j = a2; } else { a.d = j; a.j = o; } a.n = new Size(1, a.n.width + g, a.n.height + g); } else { j = { $type: Point_$type, x: j.x + m.x * 1000, y: j.y + m.y * 1000 }; o = { $type: Point_$type, x: o.x + r.x * -1000, y: o.y + r.y * -1000 }; var a3 = GeometryUtil.t(k, j, o, p); if (!isNaN_(a3.x)) { a.d = a3; a.j = a3; } else { a.d = j; a.j = o; } a.n = new Size(1, a.n.width + g, a.n.height + g); } } } else { var a4 = a.e; var a5 = a.f; var a6 = GeometryUtil.h(a4, a5); var a7 = { $type: Point_$type, x: (a4.x - a5.x) / a6, y: (a4.y - a5.y) / a6 }; var a8 = { $type: Point_$type, x: -a7.y, y: a7.x }; var a9 = a.j; var ba = a.i; var bb = GeometryUtil.h(a9, ba); var bc = { $type: Point_$type, x: (ba.x - a9.x) / bb, y: (ba.y - a9.y) / bb }; var bd = { $type: Point_$type, x: -bc.y, y: bc.x }; a5 = { $type: Point_$type, x: a5.x + a8.x * g, y: a5.y + a8.y * g }; a4 = { $type: Point_$type, x: a4.x + a8.x * g, y: a4.y + a8.y * g }; a9 = { $type: Point_$type, x: a9.x + bd.x * g, y: a9.y + bd.y * g }; ba = { $type: Point_$type, x: ba.x + bd.x * g, y: ba.y + bd.y * g }; var be = { $type: Point_$type, x: a.d.x + a8.x * g, y: a.d.y + a8.y * g }; var bf = { $type: Point_$type, x: a.k.x + bd.x * g, y: a.k.y + bd.y * g }; var bg = { $type: Point_$type, x: a.g.x + a8.x * g, y: a.g.y + a8.y * g }; var bh = { $type: Point_$type, x: a.h.x + bd.x * g, y: a.h.y + bd.y * g }; if (!i) { a5 = { $type: Point_$type, x: a5.x + a7.x * -g, y: a5.y + a7.y * -g }; bg = { $type: Point_$type, x: bg.x + a7.x * -g, y: bg.y + a7.y * -g }; ba = { $type: Point_$type, x: ba.x + bc.x * g, y: ba.y + bc.y * g }; bh = { $type: Point_$type, x: bh.x + bc.x * g, y: bh.y + bc.y * g }; if (Math.abs((c - b) - Math.PI) <= 0.0001) { var bi = this.zt.ca; var bj = this.zt.b9; var bk = this.getEffectiveViewport1(this.zt); var bl = ViewportUtils.e(d.x, bi, bj, bk); var bm = ViewportUtils.i(d.y, bi, bj, bk); var bn = { $type: Point_$type, x: bl, y: bm }; var bo = ViewportUtils.d(f, bi, bj, bk); var bp = ViewportUtils.h(f, bi, bj, bk); var bq = Math.min(bo, bp); var br = this.ae3(bg, a.g, bn, bq + g); bg = !isNaN_(br.x) ? br : bg; br = this.ae3(bh, a.h, bn, bq + g); bh = !isNaN_(br.x) ? br : bh; } else { a4 = { $type: Point_$type, x: a4.x + a7.x * 1000, y: a4.y + a7.y * 1000 }; a9 = { $type: Point_$type, x: a9.x + bc.x * -1000, y: a9.y + bc.y * -1000 }; var bs = GeometryUtil.t(a5, a4, bf, ba); be = !isNaN_(bs.x) ? bs : be; a9 = !isNaN_(bs.x) ? bs : a9; } a.d = be; a.e = be; a.j = be; a.k = be; a.f = a5; a.g = bg; a.h = bh; a.i = ba; a.n = new Size(1, a.n.width + g, a.n.height + g); } else { a5 = { $type: Point_$type, x: a5.x + a7.x * -g, y: a5.y + a7.y * -g }; bg = { $type: Point_$type, x: bg.x + a7.x * -g, y: bg.y + a7.y * -g }; ba = { $type: Point_$type, x: ba.x + bc.x * g, y: ba.y + bc.y * g }; bh = { $type: Point_$type, x: bh.x + bc.x * g, y: bh.y + bc.y * g }; be = { $type: Point_$type, x: be.x + a7.x * g, y: be.y + a7.y * g }; a4 = { $type: Point_$type, x: a4.x + a7.x * g, y: a4.y + a7.y * g }; a9 = { $type: Point_$type, x: a9.x + bc.x * -g, y: a9.y + bc.y * -g }; bf = { $type: Point_$type, x: bf.x + bc.x * -g, y: bf.y + bc.y * -g }; if (Math.abs((c - b) - Math.PI) <= 0.0001) { var bt = this.zt.ca; var bu = this.zt.b9; var bv = this.getEffectiveViewport1(this.zt); var bw = ViewportUtils.e(d.x, bt, bu, bv); var bx = ViewportUtils.i(d.y, bt, bu, bv); var by = { $type: Point_$type, x: bw, y: bx }; var bz = ViewportUtils.d(e, bt, bu, bv); var b0 = ViewportUtils.h(e, bt, bu, bv); var b1 = Math.min(bz, b0); var b2 = this.ae3(be, a.d, by, b1 - g); be = !isNaN_(b2.x) ? b2 : be; b2 = this.ae3(bf, a.k, by, b1 - g); bf = !isNaN_(b2.x) ? b2 : bf; var b3 = ViewportUtils.d(f, bt, bu, bv); var b4 = ViewportUtils.h(f, bt, bu, bv); var b5 = Math.min(b3, b4); b2 = this.ae3(bg, a.g, by, b5 + g); bg = !isNaN_(b2.x) ? b2 : bg; b2 = this.ae3(bh, a.h, by, b5 + g); bh = !isNaN_(b2.x) ? b2 : bh; } else { if (g < 0) { var b6 = GeometryUtil.t(a4, a5, a9, ba); if (!isNaN_(b6.x)) { be = b6; a4 = b6; a9 = b6; bf = b6; } } } a.d = be; a.e = a4; a.j = a9; a.k = bf; a.f = a5; a.g = bg; a.h = bh; a.i = ba; a.m = new Size(1, a.m.width - g, a.m.height - g); a.n = new Size(1, a.n.width + g, a.n.height + g); } } }; RadialPieSeries.prototype.ae3 = function (a, b, c, d) { var e = GeometryUtil.o(a, b, c, d); if (!isNaN_(e.c.x) && !isNaN_(e.c.y) && !isNaN_(e.d.x) && !isNaN_(e.d.y)) { var f = void 0; if ((Math.pow(a.x - e.c.x, 2) + Math.pow(a.y - e.c.y, 2)) < (Math.pow(a.x - e.d.x, 2) + Math.pow(a.y - e.d.y, 2))) { return e.c; } else { return e.d; } } return { $type: Point_$type, x: NaN, y: NaN }; }; RadialPieSeries.prototype.ae2 = function (a, b, c, d, e, f, g, h) { var i = SliceCoords.b(a, b, c, d, e, f, g, h); var j = this.z0.m; var k = Math.abs((e - d) - (Math.PI * 2)) <= 0.0001; if (k) { var l_1 = ViewportUtils.e(h.x, a, b, c); var m_1 = ViewportUtils.i(h.y, a, b, c); var n_1 = i.n.width; var o_1 = i.m.width; if (i.m.width == 0 && i.m.height == 0) { return ((function () { var $ret = new EllipseGeometry(); $ret.e = { $type: Point_$type, x: l_1, y: m_1 }; $ret.c = n_1; $ret.d = n_1; return $ret; })()); } else { var p_1 = new Size(1, n_1, n_1); var q_1 = new Size(1, o_1, o_1); var r_1 = ((function () { var $ret = PointUtil.create(); $ret.x = l_1 - n_1; $ret.y = m_1; return $ret; })()); var s_1 = ((function () { var $ret = PointUtil.create(); $ret.x = l_1 + n_1; $ret.y = m_1; return $ret; })()); var t_1 = ((function () { var $ret = PointUtil.create(); $ret.x = l_1 - o_1; $ret.y = m_1; return $ret; })()); var u_1 = ((function () { var $ret = PointUtil.create(); $ret.x = l_1 + o_1; $ret.y = m_1; return $ret; })()); var v_1 = ((function () { var $ret = new PathFigure(); $ret.startPoint = r_1; return $ret; })()); var w = new PathSegmentCollection(); var x = ((function () { var $ret = new ArcSegment(); $ret.f = p_1; $ret.d = 1; $ret.e = s_1; return $ret; })()); w.add(x); v_1._segments = w; var y_1 = ((function () { var $ret = new PathFigure(); $ret.startPoint = u_1; return $ret; })()); var z = new PathSegmentCollection(); var aa = ((function () { var $ret = new ArcSegment(); $ret.f = q_1; $ret.d = 0; $ret.e = t_1; return $ret; })()); z.add(aa); y_1._segments = z; var ab_1 = ((function () { var $ret = new PathFigure(); $ret.startPoint = r_1; return $ret; })()); var ac = new PathSegmentCollection(); var ad = ((function () { var $ret = new ArcSegment(); $ret.f = p_1; $ret.d = 0; $ret.e = s_1; return $ret; })()); ac.add(ad); ab_1._segments = ac; var ae_1 = ((function () { var $ret = new PathFigure(); $ret.startPoint = u_1; return $ret; })()); var af = new PathSegmentCollection(); var ag = ((function () { var $ret = new ArcSegment(); $ret.f = q_1; $ret.d = 1; $ret.e = t_1; return $ret; })()); af.add(ag); ae_1._segments = af; var ah_1 = ((function () { var $ret = new PathFigureCollection(); $ret.add(v_1); $ret.add(y_1); $ret.add(ab_1); $ret.add(ae_1); return $ret; })()); return ((function () { var $ret = new PathGeometry(); $ret.c = ah_1; return $ret; })()); } } if (this.aen && !k) { this.aey(i, d, e, h, f, g, 0.5); } var ai = new PathFigure(); ai._startPoint = i.d; ai._isClosed = true; ai._segments.add(((function () { var $ret = new LineSegment(1); $ret.c = i.f; return $ret; })())); ai._segments.add(((function () { var $ret = new ArcSegment(); $ret.e = i.h; $ret.f = i.n; $ret.d = 1; $ret.b = i.c; return $ret; })())); ai._segments.add(((function () { var $ret = new LineSegment(1); $ret.c = i.j; return $ret; })())); if (!this.aen || (i.m.width > 0 && i.m.height > 0)) { ai._segments.add(((function () { var $ret = new ArcSegment(); $ret.e = i.d; $ret.f = i.m; $ret.d = 0; $ret.b = i.c; return $ret; })())); } var aj = new PathGeometry(); aj.c.add(ai); return aj; }; RadialPieSeries.prototype.ael = function (a, b, c, d, e, f, g, h) { var i = SliceCoords.b(a, b, c, d, e, f, g, h); if (isNaN_(i.n.width) || isNaN_(d) || isNaN_(e)) { return null; } var j = ViewportUtils.e(0.5, a, b, c); var k = ViewportUtils.i(0.5, a, b, c); return new PieSliceCollisionGeometry(j, k, i.n.width, i.m.width, d, e); }; RadialPieSeries.prototype.ae1 = function (a, b, c, d, e, f, g, h, i, j) { var k = this.z0.m; var l = Math.abs((e - d) - (Math.PI * 2)) <= 0.0001; var m = SliceCoords.a(a, b, c, d, e, f, g, h, i, j); if (m == null || l) { return this.ae2(a, b, c, d, e, f, g, h); } if (this.aen && !l) { this.aey(m, d, e, h, f, g, 0.5); } var n = new PathFigure(); n._startPoint = m.d; n._isClosed = true; var o = ((d + ((e - d) * 0.5)) * 180 / Math.PI) + 90; var p = new Size(1, m.l.width * (f / g), m.l.height * (f / g)); if (!this.aen || (m.m.width > 0 && m.m.height > 0)) { n._segments.add(((function () { var $ret = new ArcSegment(); $ret.e = m.e; $ret.f = p; $ret.c = o; $ret.d = 1; $ret.b = false; return $ret; })())); } n._segments.add(((function () { var $ret = new LineSegment(1); $ret.c = m.f; return $ret; })())); n._segments.add(((function () { var $ret = new ArcSegment(); $ret.e = m.g; $ret.f = m.l; $ret.c = o; $ret.d = 1; $ret.b = false; return $ret; })())); n._segments.add(((function () { var $ret = new ArcSegment(); $ret.e = m.h; $ret.f = m.n; $ret.d = 1; $ret.b = m.c; return $ret; })())); n._segments.add(((function () { var $ret = new ArcSegment(); $ret.e = m.i; $ret.f = m.l; $ret.c = o; $ret.d = 1; $ret.b = false; return $ret; })())); n._segments.add(((function () { var $ret = new LineSegment(1); $ret.c = m.j; return $ret; })())); if (!this.aen || (m.m.width > 0 && m.m.height > 0)) { n._segments.add(((function () { var $ret = new ArcSegment(); $ret.e = m.k; $ret.f = p; $ret.c = o; $ret.d = 1; $ret.b = false; return $ret; })())); n._segments.add(((function () { var $ret = new ArcSegment(); $ret.e = m.d; $ret.f = m.m; $ret.d = 0; $ret.b = m.c; return $ret; })())); } var q = new PathGeometry(); q.c.add(n); return q; }; RadialPieSeries.prototype.rr = function (a, b, c, d) { _super.prototype.rr.call(this, a, b, c, d); switch (b) { case RadialPieSeries.$$p[0]: case RadialPieSeries.$$p[1]: case "UseInsetOutlines": this.rk(); break; case "FastItemsSource": if (c != null) { if (this.aek != null) { c.deregisterColumn(this.aek); } } if (d != null) { if (this.aet != null) { this.aek = this.dn(this.aet); } } break; case "LegendLabelMemberPath": if (this.dp != null) { this.dp.deregisterColumn(this.aek); this.aek = this.dn(this.aet); this.ps(); this.p8(); } break; } }; RadialPieSeries.prototype.w9 = function (a) { var b = this.aei.ca; var c = this.aei.b9; var d = this.getEffectiveViewport1(this.aei); var e = this.w5(this.aei); var f = this.zr.pz(c, b, d, e); var g = { $type: Point_$type, x: 0.5, y: 0.5 }; var h = GeometryUtil.g(g, a); var i = this.zu.k; var j = 0; for (var k = 0; k < i.count; k++) { var l = i._inner[k][0]; var m = Math.min(i._inner[k][2], f.maxLength); var n = i._inner[k][3]; if (isNaN_(n)) { continue; } l = l % 6.28318531; if (l < 0) { l += 6.28318531; } if (h >= l - (n * 0.5) && h <= l + (n * 0.5)) { var o = Math.max(0, 0.5 * this.zr.th); var p = o; p = Math.max(p, f.minLength); var q = SliceCoords.b(b, c, d, l - (n * 0.5), l + (n * 0.5), p, m, g); var r = GeometryUtil.r({ $type: Point_$type, x: ViewportUtils.e(g.x, b, c, d), y: ViewportUtils.i(g.y, b, c, d) }, MathUtil.g(l), q.n.width); var s = 1.7976931348623157E+308; var t = 1.7976931348623157E+308; var u = -1.7976931348623157E+308; var v = -1.7976931348623157E+308; s = Math.min(s, q.d.x); s = Math.min(s, q.f.x); s = Math.min(s, q.h.x); s = Math.min(s, q.j.x); s = Math.min(s, r.x); t = Math.min(t, q.d.y); t = Math.min(t, q.f.y); t = Math.min(t, q.h.y); t = Math.min(t, q.j.y); t = Math.min(t, r.y); u = Math.max(u, q.d.x); u = Math.max(u, q.f.x); u = Math.max(u, q.h.x); u = Math.max(u, q.j.x); u = Math.max(u, r.x); v = Math.max(v, q.d.y); v = Math.max(v, q.f.y); v = Math.max(v, q.h.y); v = Math.max(v, q.j.y); v = Math.max(v, r.y); return new Rect(0, s, t, u - s, v - t); } j++; } return new Rect(0, 0, 0, 0, 0); }; RadialPieSeries.prototype.k4 = function (a) { if (this.zl != null && this.zl.ds && a == this.zl.othersIndex) { return null; } if (this.aek != null) { return this.aek.item(a); } return null; }; RadialPieSeries.prototype.v8 = function (a) { if (this.acp == null || this.zl == null) { return _super.prototype.v8.call(this, a); } if (!this.zl.ds) { return _super.prototype.v8.call(this, a); } var b = typeCast(ProportionalCategoryAngleAxis.$, this.zl); if (b.hasOthersCategory && b.othersIndex == a) { return this.acp; } return _super.prototype.v8.call(this, a); }; RadialPieSeries.prototype.wb = function (a) { if (this.acq == null || this.zl == null) { return _super.prototype.wb.call(this, a); } if (!this.zl.ds) { return _super.prototype.wb.call(this, a); } var b = typeCast(ProportionalCategoryAngleAxis.$, this.zl); if (b.hasOthersCategory && b.othersIndex == a) { return this.acq; } return _super.prototype.wb.call(this, a); }; RadialPieSeries.prototype.ed = function (a, b, c, d, e) { var _this = this; if (_super.prototype.ed.call(this, a, b, c, d, e)) { var f = typeCast(ProportionalCategoryAngleAxis.$, this.zl) !== null && this.zl.hasOthersCategory; if (e && (this.aeh == 1 || (this.aeh == 2 && !f))) { var g = this.zl; var h = new ScalerParams(1, this.dc.ys, this.xe, g.dn); h.c = this.getEffectiveViewport1(this.cw); var i = this.zr; var j = new ScalerParams(1, this.dc.ys, this.xe, i.dn); j.c = this.getEffectiveViewport1(this.cw); var k = this.aaq; var _loop_1 = function (l) { var m = this_1.dp.item(l); var n = NaN; if (m != null) { n = this_1.jl(m); } if (n == 0) { var o = new SeriesPointOfInterest(); o.f = this_1.abs(n, m, l, d, k, c, b, false); o.b = ((function () { var $ret = new DataContext(); $ret.item = m; $ret.series = _this; return $ret; })()); o.g = this_1.v1; o.c = l; if (this_1.hg) { o.g = this_1.v8(l); } var p = false; for (var q = 0; q < a.count; q++) { if (o.c < a._inner[q].c) { a.insert(q, o); p = true; break; } } if (!p) { a.add(o); } } }; var this_1 = this; for (var l = 0; l < this.dp.count; l++) { _loop_1(l); } } return true; } return false; }; RadialPieSeries.prototype.ak = function (a, b) { var c = new List$1(ChartSelection.$, 0); this.qj(a, c, b); return c.toArray(); }; RadialPieSeries.prototype.qj = function (a, b, c) { var _this = this; if (this.zm == 0) { _super.prototype.qj.call(this, a, b, c); return; } var d = this.cw.ca; var e = this.cw.b9; var f = this.getEffectiveViewport1(this.cw); var g = this.dc.y0(this.xe, this.getEffectiveViewport(), d); var h = this.zr.pz(e, d, f, g); var i = { $type: Point_$type, x: 0.5, y: 0.5 }; var j = this.zr; var k = Math.max(0, 0.5 * j.th); var l = k; l = Math.max(l, h.minLength); var m = this.zl.p1(d, e, f); var n = this.zl != null && this.zl.ds; var o = new CollisionRect(0, this.dc.yx(a)); var _loop_2 = function (p) { var q = typeCast(RadialBaseView.$, this_2.cw); var r = q.da.getBucket(p); var s = this_2.ada(this_2.zl, d, e, f); if (n) { m = this_2.aal(p, d, e, f); s = this_2.ac9(p, this_2.zl, d, e, f); if (isNaN_(s)) { s = 0; } } r[0] = this_2.zl.getScaledAngle(r[0]) + s; var t = r[0]; var u = Math.min(this_2.zs.b.to(r[2]), h.maxLength); var v = this_2.ael(d, e, f, t - (m * 0.5), t + (m * 0.5), l, u, i); if (v.collidesWithHeavy(o)) { if (c == 7 || c == 6) { b.add(((function () { var $ret = new ChartSelection(); $ret.series = _this; return $ret; })())); return { value: void 0 }; } if (c == 2 || c == 1) { b.add(((function () { var $ret = new ChartSelection(); $ret.item = _this.dp.item(p); return $ret; })())); } else { b.add(((function () { var $ret = new ChartSelection(); $ret.item = _this.dp.item(p); $ret.series = _this; return $ret; })())); } } }; var this_2 = this; for (var p = 0; p < this.zl.qd; p++) { var state_1 = _loop_2(p); if (typeof state_1 === "object") return state_1.value; } }; RadialPieSeries.$t = markType(RadialPieSeries, 'RadialPieSeries', AnchoredRadialSeries.$); RadialPieSeries.$$p = markDep(DependencyProperty, PropertyMetadata, RadialPieSeries, 'raisePropertyChanged', ['RadiusX:aeo:aez', [1, 2], 'RadiusY:aep:ae0', [1, 2]]); return RadialPieSeries; }(AnchoredRadialSeries)); export { RadialPieSeries }; /** * @hidden */ var RadialPieSeriesView = /** @class */ /*@__PURE__*/ (function (_super) { __extends(RadialPieSeriesView, _super); function RadialPieSeriesView(a) { var _this = _super.call(this, a) || this; _this.di = null; _this.dj = null; _this.dk = null; _this.dq = new Path(); _this.di = a; _this.dj = ((function () { var $ret = new Pool$1(Path.$); $ret.create = runOn(_this, _this.dr); $ret.activate = runOn(_this, _this.dl); $ret.disactivate = runOn(_this, _this.dn); $ret.destroy = runOn(_this, _this.dm); return $ret; })()); return _this; } RadialPieSeriesView.prototype.a4 = function () { _super.prototype.a4.call(this); this.dk = new List$1(Path.$, 0); if (!this.t) { this.c9.xw = Defaults.c; this.c9.jz = Defaults.i; } }; RadialPieSeriesView.prototype.dr = function () { var _this = this; var a = ((function () { var $ret = new Path(); $ret.dataContext = ((function () { var $ret = new DataContext(); $ret.series = _this.f; return $ret; })()); return $ret; })()); this.dk.add(a); a._visibility = 1; return a; }; RadialPieSeriesView.prototype.dl = function (a) { a._visibility = 0; }; RadialPieSeriesView.prototype.dn = function (a) { a._visibility = 1; }; RadialPieSeriesView.prototype.dm = function (a) { this.dk.remove(a); }; RadialPieSeriesView.prototype.bs = function (a, b) { _super.prototype.bs.call(this, a, b); var c = a; }; RadialPieSeriesView.prototype.ak = function (a) { return this.dk._inner[a]; }; RadialPieSeriesView.prototype.aj = function (a) { var b = this.dk._inner[a]; this.dq._visibility = b._visibility; this.dq.an = b.an; var c = this.b4(a); this.dq._fill = c; this.dq._stroke = c; this.dq.ad = this.f.im; return this.dq; }; RadialPieSeriesView.prototype.bj = function (a, b) { _super.prototype.bj.call(this, a, b); if (a.d) { for (var c = 0; c < this.dk.count; c++) { var d = this.ai(c, b); if (this.di.aen) { a.aa(); a.ac(d); } a.t(d); if (this.di.aen) { a.z(); } } } }; RadialPieSeriesView.prototype.dp = function () { this.a2(); }; RadialPieSeriesView.prototype.ax = function (a) { var e_1, _a; _super.prototype.ax.call(this, a); var b = 0; try { for (var _b = __values(fromEnum(this.dj.a)), _c = _b.next(); !_c.done; _c = _b.next()) { var c = _c.value; this.f.bc.exportPathData(a, c, "slice" + b, ["Main", "Fill"]); b++; } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_1) throw e_1.error; } } }; RadialPieSeriesView.$t = markType(RadialPieSeriesView, 'RadialPieSeriesView', AnchoredRadialSeriesView.$); return RadialPieSeriesView; }(AnchoredRadialSeriesView)); export { RadialPieSeriesView };