UNPKG

igniteui-react-charts

Version:

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

1,052 lines (1,051 loc) 41.2 kB
/* THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE AGREEMENT ("AGREEMENT") LOCATED HERE: https://www.infragistics.com/legal/license/igultimate-la https://www.infragistics.com/legal/license/igultimate-eula GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company. */ import { __extends, __values } from "tslib"; import { AnchoredRadialSeries } from "./AnchoredRadialSeries"; import { DependencyProperty } from "igniteui-react-core"; import { enumGetBox, Point_$type, runOn, typeCast, markType, markDep, fromEnum } from "igniteui-react-core"; import { LegendEmptyValuesMode_$type } from "igniteui-react-core"; import { Defaults } from "./Defaults"; import { Pool$1 } from "igniteui-react-core"; import { Path } from "igniteui-react-core"; import { List$1 } from "igniteui-react-core"; import { Rect } from "igniteui-react-core"; import { RadialBaseView } from "./RadialBaseView"; import { ScalerParams } from "./ScalerParams"; import { ViewportUtils } from "./ViewportUtils"; import { SliceCoords } from "./SliceCoords"; 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 { LineSegment } from "igniteui-react-core"; import { ArcSegment } 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.ad1 = null; _this.ad8 = null; _this.ady = 0; _this.ad4 = false; _this.ab = RadialPieSeries.$; return _this; } RadialPieSeries.prototype.bk = function () { return new RadialPieSeries(); }; RadialPieSeries.prototype.get_fo = function () { return true; }; RadialPieSeries.prototype.get_fm = function () { return true; }; RadialPieSeries.prototype.jn = function () { if (!isNaN_(this.jm)) { return _super.prototype.jn.call(this); } return Defaults.h; }; RadialPieSeries.prototype.ct = function () { return new RadialPieSeriesView(this); }; RadialPieSeries.prototype.q8 = function (a) { _super.prototype.q8.call(this, a); this.ad0 = a; }; Object.defineProperty(RadialPieSeries.prototype, "ad2", { get: function () { return this.ad1; }, set: function (a) { if (this.ad1 != a) { var b = this.ad2; this.ad1 = a; this.raisePropertyChanged("LegendLabelColumn", b, this.ad2); } }, enumerable: false, configurable: true }); Object.defineProperty(RadialPieSeries.prototype, "aeb", { get: function () { return this.ad8; }, set: function (a) { if (this.ad8 != a) { var b = this.ad8; this.ad8 = a; this.raisePropertyChanged("LegendLabelMemberPath", b, this.ad8); } }, enumerable: false, configurable: true }); Object.defineProperty(RadialPieSeries.prototype, "adz", { get: function () { return this.ady; }, set: function (a) { if (this.ady != a) { var b = this.ady; this.ady = a; this.raisePropertyChanged("LegendEmptyValuesMode", enumGetBox(LegendEmptyValuesMode_$type, b), enumGetBox(LegendEmptyValuesMode_$type, this.ady)); } }, enumerable: false, configurable: true }); Object.defineProperty(RadialPieSeries.prototype, "ad5", { get: function () { return this.ad4; }, set: function (a) { if (this.ad4 != a) { var b = this.ad4; this.ad4 = a; this.raisePropertyChanged("UseInsetOutlines", b, this.ad4); } }, enumerable: false, configurable: true }); RadialPieSeries.prototype.preferredCategoryMode = function (a) { return a != null && a == this.za ? 2 : 0; }; RadialPieSeries.prototype.pb = function (a, b) { _super.prototype.pb.call(this, a, b); var c = b; if (a && c.dj != null) { c.dj.count = 0; } }; RadialPieSeries.prototype.iy = function () { return this.za.ou(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.wu(this.cw); var h = this.zg.or(e, d, f, g); var i = { $type: Point_$type, x: 0.5, y: 0.5 }; var j = this.zg; var k = Math.max(0, 0.5 * j.sa); var l = k; l = Math.max(l, h.minLength); var m = this.za.ou(d, e, f); var n = this.za != null && this.za.dj; var o = this.zj; if (this.d4()) { o = this.zm; } { if (n) { m = this.z9(a, d, e, f); } if (b < 0 || b > o.h.count - 1) { return null; } var p = o.h._inner[b][0]; var q = Math.min(o.h._inner[b][2], h.maxLength); return this.ad3(d, e, f, p - (m * 0.5), p + (m * 0.5), l, q, i); } }; RadialPieSeries.prototype.get_ef = function () { return true; }; RadialPieSeries.prototype.get_acp = function () { return true; }; RadialPieSeries.prototype.get_acj = function () { return true; }; RadialPieSeries.prototype.iq = function () { var a = _super.prototype.iq.call(this); if (this.ad5 && !isNaN_(a)) { a = a * 2; } return a; }; RadialPieSeries.prototype.abl = function (a, b) { _super.prototype.abl.call(this, a, b); var c = b; var d = b.ca; var e = b.b9; var f = this.getEffectiveViewport1(b); var g = this.wu(b); var h = this.zg.or(e, d, f, g); var i = a.h; var j = this.zg; var k = Math.max(0, 0.5 * j.sa); var l = k; l = Math.max(l, h.minLength); var m = this.za.ou(d, e, f); var n = this.za.dj; var o = { $type: Point_$type, x: 0.5, y: 0.5 }; var p = this.ad6; var q = this.ad7; var r = (p > 0 && q > 0); var s = this.ach.count; this.zp.a2(this, this.z6(), runOn(this, this.yy), this.aaf(b), this.aag(b)); this.zp.r = this.ad6; this.zp.s = this.ad7; this.zp.k = this.ad6; this.zp.l = this.ad7; this.zp.t = this.ad5 ? this.jt * 2 : this.jt; var t = false; var u = this.zp.b; if (u != null) { t = true; } var v = this.za; var w = new ScalerParams(1, b.ca, b.b9, v.df); 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.ade(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.za.o6 - 1) { if ((af) * b.da.b >= this.za.o5) { af = (af) - (intDivide((this.za.o5), b.da.b)); } } m = ae; if (isNaN_(m)) { continue; } } var ag = c.dj.item(x); x++; var ah = this.zp.k; var ai = this.zp.l; r = (ah > 0 && ai > 0); var aj = null; if (r) { aj = this.aej(d, e, f, aa - (m * 0.5), aa + (m * 0.5), l, ab, o, ah, ai); } else { aj = this.aek(d, e, f, aa - (m * 0.5), aa + (m * 0.5), l, ab, o); } ag.an = aj; this.zp.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.aeg = 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.k(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.k(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.zi.ca; var y = this.zi.b9; var z = this.getEffectiveViewport1(this.zi); 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.r(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.r(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.r(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.r(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.w(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.zi.ca; var ar = this.zi.b9; var as = this.getEffectiveViewport1(this.zi); 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.r(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.r(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.w(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.w(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.k(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.k(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.zi.ca; var bj = this.zi.b9; var bk = this.getEffectiveViewport1(this.zi); 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.ael(bg, a.g, bn, bq + g); bg = !isNaN_(br.x) ? br : bg; br = this.ael(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.w(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.zi.ca; var bu = this.zi.b9; var bv = this.getEffectiveViewport1(this.zi); 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.ael(be, a.d, by, b1 - g); be = !isNaN_(b2.x) ? b2 : be; b2 = this.ael(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.ael(bg, a.g, by, b5 + g); bg = !isNaN_(b2.x) ? b2 : bg; b2 = this.ael(bh, a.h, by, b5 + g); bh = !isNaN_(b2.x) ? b2 : bh; } else { if (g < 0) { var b6 = GeometryUtil.w(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.ael = function (a, b, c, d) { var e = GeometryUtil.r(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.aek = function (a, b, c, d, e, f, g, h) { var i = SliceCoords.b(a, b, c, d, e, f, g, h); var j = this.zp.m; var k = Math.abs((e - d) - (Math.PI * 2)) <= 0.0001; if (this.ad5 && !k) { this.aeg(i, d, e, h, f, g, 0.5); } var l = new PathFigure(); l._startPoint = i.d; l._isClosed = true; l._segments.add(((function () { var $ret = new LineSegment(1); $ret.c = i.f; return $ret; })())); l._segments.add(((function () { var $ret = new ArcSegment(); $ret.e = i.h; $ret.f = i.n; $ret.d = 1; $ret.b = i.c; return $ret; })())); l._segments.add(((function () { var $ret = new LineSegment(1); $ret.c = i.j; return $ret; })())); if (!this.ad5 || (i.m.width > 0 && i.m.height > 0)) { l._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 m = new PathGeometry(); m.c.add(l); return m; }; RadialPieSeries.prototype.ad3 = 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.aej = function (a, b, c, d, e, f, g, h, i, j) { var k = SliceCoords.a(a, b, c, d, e, f, g, h, i, j); if (k == null) { return this.aek(a, b, c, d, e, f, g, h); } var l = this.zp.m; var m = Math.abs((e - d) - (Math.PI * 2)) <= 0.0001; if (this.ad5 && !m) { this.aeg(k, d, e, h, f, g, 0.5); } var n = new PathFigure(); n._startPoint = k.d; n._isClosed = true; var o = ((d + ((e - d) * 0.5)) * 180 / Math.PI) + 90; var p = new Size(1, k.l.width * (f / g), k.l.height * (f / g)); if (!this.ad5 || (k.m.width > 0 && k.m.height > 0)) { n._segments.add(((function () { var $ret = new ArcSegment(); $ret.e = k.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 = k.f; return $ret; })())); n._segments.add(((function () { var $ret = new ArcSegment(); $ret.e = k.g; $ret.f = k.l; $ret.c = o; $ret.d = 1; $ret.b = false; return $ret; })())); n._segments.add(((function () { var $ret = new ArcSegment(); $ret.e = k.h; $ret.f = k.n; $ret.d = 1; $ret.b = k.c; return $ret; })())); n._segments.add(((function () { var $ret = new ArcSegment(); $ret.e = k.i; $ret.f = k.l; $ret.c = o; $ret.d = 1; $ret.b = false; return $ret; })())); n._segments.add(((function () { var $ret = new LineSegment(1); $ret.c = k.j; return $ret; })())); if (!this.ad5 || (k.m.width > 0 && k.m.height > 0)) { n._segments.add(((function () { var $ret = new ArcSegment(); $ret.e = k.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 = k.d; $ret.f = k.m; $ret.d = 0; $ret.b = k.c; return $ret; })())); } var q = new PathGeometry(); q.c.add(n); return q; }; RadialPieSeries.prototype.rh = function (a, b, c, d) { _super.prototype.rh.call(this, a, b, c, d); switch (b) { case RadialPieSeries.$$p[0]: case RadialPieSeries.$$p[1]: case "UseInsetOutlines": this.ra(); break; case "FastItemsSource": if (c != null) { if (this.ad2 != null) { c.deregisterColumn(this.ad2); } } if (d != null) { if (this.aeb != null) { this.ad2 = this.dn(this.aeb); } } break; case "LegendLabelMemberPath": if (this.dp != null) { this.dp.deregisterColumn(this.ad2); this.ad2 = this.dn(this.aeb); this.pk(); this.pz(); } break; } }; RadialPieSeries.prototype.wy = function (a) { var b = this.ad0.ca; var c = this.ad0.b9; var d = this.getEffectiveViewport1(this.ad0); var e = this.wu(this.ad0); var f = this.zg.or(c, b, d, e); var g = { $type: Point_$type, x: 0.5, y: 0.5 }; var h = GeometryUtil.j(g, a); var i = this.zj.h; 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.zg.sa); 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.u({ $type: Point_$type, x: ViewportUtils.e(g.x, b, c, d), y: ViewportUtils.i(g.y, b, c, d) }, MathUtil.f(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.ky = function (a) { if (this.za != null && this.za.dj && a == this.za.othersIndex) { return null; } if (this.ad2 != null) { return this.ad2.item(a); } return null; }; 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.za) !== null && this.za.hasOthersCategory; if (e && (this.adz == 1 || (this.adz == 2 && !f))) { var g = this.za; var h = new ScalerParams(1, this.dc.xn, this.w3, g.df); h.c = this.getEffectiveViewport1(this.cw); var i = this.zg; var j = new ScalerParams(1, this.dc.xn, this.w3, i.df); j.c = this.getEffectiveViewport1(this.cw); var k = this.aae; var _loop_1 = function (l) { var m = this_1.dp.item(l); var n = NaN; if (m != null) { n = this_1.jf(m); } if (n == 0) { var o = new SeriesPointOfInterest(); o.f = this_1.abe(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.vr; o.c = l; if (this_1.ha) { o.g = this_1.vy(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.qa(a, c, b); return c.toArray(); }; RadialPieSeries.prototype.qa = function (a, b, c) { var _this = this; if (this.zb == 0) { _super.prototype.qa.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.xv(this.w3, this.getEffectiveViewport(), d); var h = this.zg.or(e, d, f, g); var i = { $type: Point_$type, x: 0.5, y: 0.5 }; var j = this.zg; var k = Math.max(0, 0.5 * j.sa); var l = k; l = Math.max(l, h.minLength); var m = this.za.ou(d, e, f); var n = this.za != null && this.za.dj; var o = new CollisionRect(0, this.dc.xs(a)); var _loop_2 = function (p) { var q = typeCast(RadialBaseView.$, this_2.cw); var r = q.da.getBucket(p); var s = this_2.acs(this_2.za, d, e, f); if (n) { m = this_2.z9(p, d, e, f); s = this_2.acr(p, this_2.za, d, e, f); if (isNaN_(s)) { s = 0; } } r[0] = this_2.za.getScaledAngle(r[0]) + s; var t = r[0]; var u = Math.min(this_2.zh.b.sh(r[2]), h.maxLength); var v = this_2.ad3(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.za.o6; 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:ad6:aeh', [1, 2], 'RadiusY:ad7:aei', [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.xl = Defaults.c; this.c9.jt = 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.ig; 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.ad5) { a.aa(); a.ac(d); } a.t(d); if (this.di.ad5) { 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 };