UNPKG

igniteui-react-charts

Version:

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

1,251 lines (1,250 loc) 48.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.aec = null; _this.aej = null; _this.ad9 = 0; _this.aef = false; _this.ab = RadialPieSeries.$; return _this; } RadialPieSeries.prototype.bk = function () { return new RadialPieSeries(); }; RadialPieSeries.prototype.get_fq = function () { return true; }; RadialPieSeries.prototype.get_fo = function () { return true; }; RadialPieSeries.prototype.js = function () { if (!isNaN_(this.jr)) { return _super.prototype.js.call(this); } return Defaults.h; }; RadialPieSeries.prototype.ct = function () { return new RadialPieSeriesView(this); }; RadialPieSeries.prototype.rh = function (a) { _super.prototype.rh.call(this, a); this.aeb = a; }; RadialPieSeries.prototype.g2 = function (a, b) { if (this.g5(a, b)) { return true; } if (this.x2(a, b)) { return true; } return false; }; RadialPieSeries.prototype.g5 = function (a, b) { var c = this.zu(); var d = this.cw.ca; var e = this.cw.b9; var f = this.cw.getEffectiveViewport(); var g = this.w4(this.cw); var h = this.zq; var i = this.zq.px(e, d, f, g); var j = this.zr.d(0, this.zq.tp, d, e, f); var k = this.zr.e(0, this.zq.tp, 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.zr.h(a.x, a.y, d, e, f, n, o); n = p.p5; o = p.p6; n = this.zk.getScaledAngle(n); o = h.f6(o, m); var q = Math.max(0, 0.5 * h.tf); var r = q; r = Math.max(r, i.minLength); var s = this.zk.pz(d, e, f); var t = this.zk.ds; var u = { $type: Point_$type, x: 0.5, y: 0.5 }; var v = this.i1(b) + (this.il / 2); var w = this.am(this.a0(), c.k, this.aaq(this.cw), this.aar(this.cw), this.w2(a), true); var x = this.an(this.a0(), c.k, this.aaq(this.cw), this.aar(this.cw), this.w2(a), true); if (x == null) { return false; } var y = this.zk; 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.zs.da.c + ag) * this.zs.da.b; if ((this.zs.da.c + ag) * this.zs.da.b > this.zk.qb - 1) { if ((ah) * this.zs.da.b >= this.zk.qa) { ah = (ah) - (intDivide((this.zk.qa), this.zs.da.b)); } } s = af; if (isNaN_(s)) { continue; } } var ai = null; ai = this.aev(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, "aed", { get: function () { return this.aec; }, set: function (a) { if (this.aec != a) { var b = this.aed; this.aec = a; this.raisePropertyChanged("LegendLabelColumn", b, this.aed); } }, enumerable: false, configurable: true }); Object.defineProperty(RadialPieSeries.prototype, "aem", { get: function () { return this.aej; }, set: function (a) { if (this.aej != a) { var b = this.aej; this.aej = a; this.raisePropertyChanged("LegendLabelMemberPath", b, this.aej); } }, enumerable: false, configurable: true }); Object.defineProperty(RadialPieSeries.prototype, "aea", { get: function () { return this.ad9; }, set: function (a) { if (this.ad9 != a) { var b = this.ad9; this.ad9 = a; this.raisePropertyChanged("LegendEmptyValuesMode", enumGetBox(LegendEmptyValuesMode_$type, b), enumGetBox(LegendEmptyValuesMode_$type, this.ad9)); } }, enumerable: false, configurable: true }); Object.defineProperty(RadialPieSeries.prototype, "aeg", { get: function () { return this.aef; }, set: function (a) { if (this.aef != a) { var b = this.aef; this.aef = a; this.raisePropertyChanged("UseInsetOutlines", b, this.aef); } }, enumerable: false, configurable: true }); RadialPieSeries.prototype.preferredCategoryMode = function (a) { return a != null && a == this.zk ? 2 : 0; }; RadialPieSeries.prototype.pi = function (a, b) { _super.prototype.pi.call(this, a, b); var c = b; if (a && c.dj != null) { c.dj.count = 0; } }; RadialPieSeries.prototype.i3 = function () { return this.zk.pz(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.w4(this.cw); var h = this.zq.px(e, d, f, g); var i = { $type: Point_$type, x: 0.5, y: 0.5 }; var j = this.zq; var k = Math.max(0, 0.5 * j.tf); var l = k; l = Math.max(l, h.minLength); var m = this.zk.pz(d, e, f); var n = this.zk != null && this.zk.ds; var o = this.zt; if (this.d4()) { o = this.zw; } { if (n) { m = this.aak(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.aee(d, e, f, p - (m * 0.5), p + (m * 0.5), l, q, i); } }; RadialPieSeries.prototype.get_ef = function () { return true; }; RadialPieSeries.prototype.get_ac0 = function () { return true; }; RadialPieSeries.prototype.get_acu = function () { return true; }; RadialPieSeries.prototype.iv = function () { var a = _super.prototype.iv.call(this); if (this.aeg && !isNaN_(a)) { a = a * 2; } return a; }; RadialPieSeries.prototype.abw = function (a, b) { _super.prototype.abw.call(this, a, b); var c = b; var d = b.ca; var e = b.b9; var f = this.getEffectiveViewport1(b); var g = this.w4(b); var h = this.zq.px(e, d, f, g); var i = a.k; var j = this.zq; var k = Math.max(0, 0.5 * j.tf); var l = k; l = Math.max(l, h.minLength); var m = this.zk.pz(d, e, f); var n = this.zk.ds; var o = { $type: Point_$type, x: 0.5, y: 0.5 }; var p = this.aeh; var q = this.aei; var r = (p > 0 && q > 0); var s = this.acs.count; this.zz.a2(this, this.aag(), runOn(this, this.y8), this.aaq(b), this.aar(b)); this.zz.r = this.aeh; this.zz.s = this.aei; this.zz.k = this.aeh; this.zz.l = this.aei; this.zz.t = this.aeg ? this.jy * 2 : this.jy; var t = false; var u = this.zz.b; if (u != null) { t = true; } var v = this.zk; 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.adp(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.zk.qb - 1) { if ((af) * b.da.b >= this.zk.qa) { af = (af) - (intDivide((this.zk.qa), b.da.b)); } } m = ae; if (isNaN_(m)) { continue; } } var ag = c.dj.item(x); x++; var ah = this.zz.k; var ai = this.zz.l; r = (ah > 0 && ai > 0); var aj = null; if (r) { aj = this.aeu(d, e, f, aa - (m * 0.5), aa + (m * 0.5), l, ab, o, ah, ai); } else { aj = this.aev(d, e, f, aa - (m * 0.5), aa + (m * 0.5), l, ab, o); } ag.an = aj; this.zz.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.aer = 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.zs.ca; var y = this.zs.b9; var z = this.getEffectiveViewport1(this.zs); 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.zs.ca; var ar = this.zs.b9; var as = this.getEffectiveViewport1(this.zs); 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.zs.ca; var bj = this.zs.b9; var bk = this.getEffectiveViewport1(this.zs); 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.aew(bg, a.g, bn, bq + g); bg = !isNaN_(br.x) ? br : bg; br = this.aew(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.zs.ca; var bu = this.zs.b9; var bv = this.getEffectiveViewport1(this.zs); 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.aew(be, a.d, by, b1 - g); be = !isNaN_(b2.x) ? b2 : be; b2 = this.aew(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.aew(bg, a.g, by, b5 + g); bg = !isNaN_(b2.x) ? b2 : bg; b2 = this.aew(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.aew = 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.aev = function (a, b, c, d, e, f, g, h) { var i = SliceCoords.b(a, b, c, d, e, f, g, h); var j = this.zz.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.aeg && !k) { this.aer(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.aeg || (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.aee = 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.aeu = function (a, b, c, d, e, f, g, h, i, j) { var k = this.zz.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.aev(a, b, c, d, e, f, g, h); } if (this.aeg && !l) { this.aer(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.aeg || (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.aeg || (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.rq = function (a, b, c, d) { _super.prototype.rq.call(this, a, b, c, d); switch (b) { case RadialPieSeries.$$p[0]: case RadialPieSeries.$$p[1]: case "UseInsetOutlines": this.rj(); break; case "FastItemsSource": if (c != null) { if (this.aed != null) { c.deregisterColumn(this.aed); } } if (d != null) { if (this.aem != null) { this.aed = this.dn(this.aem); } } break; case "LegendLabelMemberPath": if (this.dp != null) { this.dp.deregisterColumn(this.aed); this.aed = this.dn(this.aem); this.pr(); this.p7(); } break; } }; RadialPieSeries.prototype.w8 = function (a) { var b = this.aeb.ca; var c = this.aeb.b9; var d = this.getEffectiveViewport1(this.aeb); var e = this.w4(this.aeb); var f = this.zq.px(c, b, d, e); var g = { $type: Point_$type, x: 0.5, y: 0.5 }; var h = GeometryUtil.g(g, a); var i = this.zt.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.zq.tf); 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.k3 = function (a) { if (this.zk != null && this.zk.ds && a == this.zk.othersIndex) { return null; } if (this.aed != null) { return this.aed.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.zk) !== null && this.zk.hasOthersCategory; if (e && (this.aea == 1 || (this.aea == 2 && !f))) { var g = this.zk; var h = new ScalerParams(1, this.dc.yr, this.xd, g.dn); h.c = this.getEffectiveViewport1(this.cw); var i = this.zq; var j = new ScalerParams(1, this.dc.yr, this.xd, i.dn); j.c = this.getEffectiveViewport1(this.cw); var k = this.aap; var _loop_1 = function (l) { var m = this_1.dp.item(l); var n = NaN; if (m != null) { n = this_1.jk(m); } if (n == 0) { var o = new SeriesPointOfInterest(); o.f = this_1.abp(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.v0; o.c = l; if (this_1.hf) { o.g = this_1.v7(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.qi(a, c, b); return c.toArray(); }; RadialPieSeries.prototype.qi = function (a, b, c) { var _this = this; if (this.zl == 0) { _super.prototype.qi.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.yz(this.xd, this.getEffectiveViewport(), d); var h = this.zq.px(e, d, f, g); var i = { $type: Point_$type, x: 0.5, y: 0.5 }; var j = this.zq; var k = Math.max(0, 0.5 * j.tf); var l = k; l = Math.max(l, h.minLength); var m = this.zk.pz(d, e, f); var n = this.zk != null && this.zk.ds; var o = new CollisionRect(0, this.dc.yw(a)); var _loop_2 = function (p) { var q = typeCast(RadialBaseView.$, this_2.cw); var r = q.da.getBucket(p); var s = this_2.ac3(this_2.zk, d, e, f); if (n) { m = this_2.aak(p, d, e, f); s = this_2.ac2(p, this_2.zk, d, e, f); if (isNaN_(s)) { s = 0; } } r[0] = this_2.zk.getScaledAngle(r[0]) + s; var t = r[0]; var u = Math.min(this_2.zr.b.tm(r[2]), h.maxLength); var v = this_2.aee(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.zk.qb; 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:aeh:aes', [1, 2], 'RadiusY:aei:aet', [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.xv = Defaults.c; this.c9.jy = 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.il; 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.aeg) { a.aa(); a.ac(d); } a.t(d); if (this.di.aeg) { 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 };