UNPKG

igniteui-angular-charts

Version:

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

1,202 lines 50.3 kB
/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { AnchoredRadialSeries } from "./AnchoredRadialSeries";
import { DependencyProperty } from "igniteui-angular-core";
import { Point_$type, enumGetBox, runOn, typeCast, markType, markDep, PointUtil, fromEnum } from "igniteui-angular-core";
import { LegendEmptyValuesMode_$type } from "igniteui-angular-core";
import { Defaults } from "./Defaults";
import { Rect } from "igniteui-angular-core";
import { ScalerParams } from "./ScalerParams";
import { Path } from "igniteui-angular-core";
import { SliceCoords } from "./SliceCoords";
import { List$1 } from "igniteui-angular-core";
import { RadialBaseView } from "./RadialBaseView";
import { CoreGeometryUtil } from "igniteui-angular-core";
import { Pool$1 } from "igniteui-angular-core";
import { ViewportUtils } from "./ViewportUtils";
import { Size } from "igniteui-angular-core";
import { GeometryUtil } from "igniteui-angular-core";
import { PathFigure } from "igniteui-angular-core";
import { PathGeometry } from "igniteui-angular-core";
import { PathSegmentCollection } from "igniteui-angular-core";
import { ArcSegment } from "igniteui-angular-core";
import { PathFigureCollection } from "igniteui-angular-core";
import { EllipseGeometry } from "igniteui-angular-core";
import { LineSegment } from "igniteui-angular-core";
import { PieSliceCollisionGeometry } from "igniteui-angular-core";
import { MathUtil } from "igniteui-angular-core";
import { ProportionalCategoryAngleAxis } from "./ProportionalCategoryAngleAxis";
import { SeriesPointOfInterest } from "./SeriesPointOfInterest";
import { DataContext } from "igniteui-angular-core";
import { ChartSelection } from "./ChartSelection";
import { CollisionRect } from "igniteui-angular-core";
import { PropertyMetadata } from "igniteui-angular-core";
import { intDivide, isNaN_ } from "igniteui-angular-core";
import { AnchoredRadialSeriesView } from "./AnchoredRadialSeriesView";
/**
 * @hidden
 */
export let RadialPieSeries = /*@__PURE__*/ (() => {
    class RadialPieSeries extends AnchoredRadialSeries {
        constructor() {
            super();
            this.aec = null;
            this.aej = null;
            this.ad9 = 0;
            this.aef = false;
            this.ab = RadialPieSeries.$;
        }
        bk() {
            return new RadialPieSeries();
        }
        get_fq() {
            return true;
        }
        get_fo() {
            return true;
        }
        js() {
            if (!isNaN_(this.jr)) {
                return super.js();
            }
            return Defaults.h;
        }
        ct() {
            return new RadialPieSeriesView(this);
        }
        rh(a) {
            super.rh(a);
            this.aeb = a;
        }
        g2(a, b) {
            if (this.g5(a, b)) {
                return true;
            }
            if (this.x2(a, b)) {
                return true;
            }
            return false;
        }
        g5(a, b) {
            let c = this.zu();
            let d = this.cw.ca;
            let e = this.cw.b9;
            let f = this.cw.getEffectiveViewport();
            let g = this.w4(this.cw);
            let h = this.zq;
            let i = this.zq.px(e, d, f, g);
            let j = this.zr.d(0, this.zq.tp, d, e, f);
            let k = this.zr.e(0, this.zq.tp, d, e, f);
            let l = { $type: Point_$type, x: j, y: k };
            let m = new ScalerParams(0, d, e, h.dn, f);
            let n = NaN;
            let o = NaN;
            let 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);
            let q = Math.max(0, 0.5 * h.tf);
            let r = q;
            r = Math.max(r, i.minLength);
            let s = this.zk.pz(d, e, f);
            let t = this.zk.ds;
            let u = { $type: Point_$type, x: 0.5, y: 0.5 };
            let v = this.i1(b) + (this.il / 2);
            let w = this.am(this.a0(), c.k, this.aaq(this.cw), this.aar(this.cw), this.w2(a), true);
            let x = this.an(this.a0(), c.k, this.aaq(this.cw), this.aar(this.cw), this.w2(a), true);
            if (x == null) {
                return false;
            }
            let y = this.zk;
            let z = new ScalerParams(1, d, e, y.dn);
            z.c = this.getEffectiveViewport();
            for (let aa = 0; aa < x.length; aa++) {
                let ab = x[aa][0];
                let ac = Math.min(x[aa][2], i.maxLength);
                let ad = x[aa][1];
                let ae = x[aa][2];
                let af = x[aa][3];
                let ag = w[aa];
                if (t) {
                    if (isNaN_(ab) || isNaN_(ad) || isNaN_(ae)) {
                        continue;
                    }
                    let 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;
                    }
                }
                let ai = null;
                ai = this.aev(d, e, f, ab - (s * 0.5), ab + (s * 0.5), r, ac, u);
                let aj = new Path();
                aj.an = ai;
                if (CoreGeometryUtil.j(a, aj, v)) {
                    return true;
                }
                let 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;
        }
        get aed() {
            return this.aec;
        }
        set aed(a) {
            if (this.aec != a) {
                let b = this.aed;
                this.aec = a;
                this.raisePropertyChanged("LegendLabelColumn", b, this.aed);
            }
        }
        get aem() {
            return this.aej;
        }
        set aem(a) {
            if (this.aej != a) {
                let b = this.aej;
                this.aej = a;
                this.raisePropertyChanged("LegendLabelMemberPath", b, this.aej);
            }
        }
        get aea() {
            return this.ad9;
        }
        set aea(a) {
            if (this.ad9 != a) {
                let b = this.ad9;
                this.ad9 = a;
                this.raisePropertyChanged("LegendEmptyValuesMode", enumGetBox(LegendEmptyValuesMode_$type, b), enumGetBox(LegendEmptyValuesMode_$type, this.ad9));
            }
        }
        get aeg() {
            return this.aef;
        }
        set aeg(a) {
            if (this.aef != a) {
                let b = this.aef;
                this.aef = a;
                this.raisePropertyChanged("UseInsetOutlines", b, this.aef);
            }
        }
        preferredCategoryMode(a) {
            return a != null && a == this.zk ? 2 : 0;
        }
        pi(a, b) {
            super.pi(a, b);
            let c = b;
            if (a && c.dj != null) {
                c.dj.count = 0;
            }
        }
        i3() {
            return this.zk.pz(this.cw.ca, this.cw.b9, this.getEffectiveViewport1(this.cw));
        }
        ar(a, b) {
            let c = new List$1(Rect.$, 0);
            let d = this.cw.ca;
            let e = this.cw.b9;
            let f = this.getEffectiveViewport1(this.cw);
            let g = this.w4(this.cw);
            let h = this.zq.px(e, d, f, g);
            let i = { $type: Point_$type, x: 0.5, y: 0.5 };
            let j = this.zq;
            let k = Math.max(0, 0.5 * j.tf);
            let l = k;
            l = Math.max(l, h.minLength);
            let m = this.zk.pz(d, e, f);
            let n = this.zk != null && this.zk.ds;
            let 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;
                }
                let p = o.k._inner[b][0];
                let 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);
            }
        }
        get_ef() {
            return true;
        }
        get_ac0() {
            return true;
        }
        get_acu() {
            return true;
        }
        iv() {
            let a = super.iv();
            if (this.aeg && !isNaN_(a)) {
                a = a * 2;
            }
            return a;
        }
        abw(a, b) {
            super.abw(a, b);
            let c = b;
            let d = b.ca;
            let e = b.b9;
            let f = this.getEffectiveViewport1(b);
            let g = this.w4(b);
            let h = this.zq.px(e, d, f, g);
            let i = a.k;
            let j = this.zq;
            let k = Math.max(0, 0.5 * j.tf);
            let l = k;
            l = Math.max(l, h.minLength);
            let m = this.zk.pz(d, e, f);
            let n = this.zk.ds;
            let o = { $type: Point_$type, x: 0.5, y: 0.5 };
            let p = this.aeh;
            let q = this.aei;
            let r = (p > 0 && q > 0);
            let 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;
            let t = false;
            let u = this.zz.b;
            if (u != null) {
                t = true;
            }
            let v = this.zk;
            let w = new ScalerParams(1, b.ca, b.b9, v.dn);
            w.c = this.getEffectiveViewport();
            let x = 0;
            let y = 0;
            for (let z = 0; z < i.count; ++z) {
                let aa = i._inner[z][0];
                let ab = Math.min(i._inner[z][2], h.maxLength);
                let ac = i._inner[z][1];
                let ad = i._inner[z][2];
                let 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;
                    }
                    let 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;
                    }
                }
                let ag = c.dj.item(x);
                x++;
                let ah = this.zz.k;
                let ai = this.zz.l;
                r = (ah > 0 && ai > 0);
                let 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);
                let 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();
        }
        aer(a, b, c, d, e, f, g) {
            if (g == 0) {
                return;
            }
            let h = a.l.width > 0 || a.l.height > 0;
            let i = a.m.width > 0;
            if (!h) {
                let j = a.d;
                let k = a.f;
                let l = GeometryUtil.h(j, k);
                let m = { $type: Point_$type, x: (j.x - k.x) / l, y: (j.y - k.y) / l };
                let n = { $type: Point_$type, x: -m.y, y: m.x };
                let o = a.j;
                let p = a.h;
                let q = GeometryUtil.h(o, p);
                let r = { $type: Point_$type, x: (p.x - o.x) / q, y: (p.y - o.y) / q };
                let 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) {
                    let t = { $type: Point_$type, x: j.x + m.x * g, y: j.y + m.y * g };
                    let u = { $type: Point_$type, x: k.x + m.x * -g, y: k.y + m.y * -g };
                    let v = { $type: Point_$type, x: p.x + r.x * g, y: p.y + r.y * g };
                    let 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) {
                        let x = this.zs.ca;
                        let y = this.zs.b9;
                        let z = this.getEffectiveViewport1(this.zs);
                        let aa = ViewportUtils.e(d.x, x, y, z);
                        let ab = ViewportUtils.i(d.y, x, y, z);
                        let ac = { $type: Point_$type, x: aa, y: ab };
                        let ad = ViewportUtils.d(e, x, y, z);
                        let ae = ViewportUtils.h(e, x, y, z);
                        let af = Math.min(ad, ae);
                        let ag = j;
                        let 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;
                        }
                        let 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);
                        let aj = ViewportUtils.d(f, x, y, z);
                        let ak = ViewportUtils.h(f, x, y, z);
                        let 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)) {
                            let am;
                            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)) {
                            let an;
                            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) {
                            let 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 };
                    let ap = c - b;
                    if (Math.abs((c - b) - Math.PI) <= 0.0001) {
                        let aq = this.zs.ca;
                        let ar = this.zs.b9;
                        let as = this.getEffectiveViewport1(this.zs);
                        let at = ViewportUtils.e(d.x, aq, ar, as);
                        let au = ViewportUtils.i(d.y, aq, ar, as);
                        let av = { $type: Point_$type, x: at, y: au };
                        let aw = ViewportUtils.d(f, aq, ar, as);
                        let ax = ViewportUtils.h(f, aq, ar, as);
                        let 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 };
                        }
                        let 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)) {
                            let a0;
                            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)) {
                            let a1;
                            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) {
                        let 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 };
                        let 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 {
                let a4 = a.e;
                let a5 = a.f;
                let a6 = GeometryUtil.h(a4, a5);
                let a7 = { $type: Point_$type, x: (a4.x - a5.x) / a6, y: (a4.y - a5.y) / a6 };
                let a8 = { $type: Point_$type, x: -a7.y, y: a7.x };
                let a9 = a.j;
                let ba = a.i;
                let bb = GeometryUtil.h(a9, ba);
                let bc = { $type: Point_$type, x: (ba.x - a9.x) / bb, y: (ba.y - a9.y) / bb };
                let 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 };
                let be = { $type: Point_$type, x: a.d.x + a8.x * g, y: a.d.y + a8.y * g };
                let bf = { $type: Point_$type, x: a.k.x + bd.x * g, y: a.k.y + bd.y * g };
                let bg = { $type: Point_$type, x: a.g.x + a8.x * g, y: a.g.y + a8.y * g };
                let 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) {
                        let bi = this.zs.ca;
                        let bj = this.zs.b9;
                        let bk = this.getEffectiveViewport1(this.zs);
                        let bl = ViewportUtils.e(d.x, bi, bj, bk);
                        let bm = ViewportUtils.i(d.y, bi, bj, bk);
                        let bn = { $type: Point_$type, x: bl, y: bm };
                        let bo = ViewportUtils.d(f, bi, bj, bk);
                        let bp = ViewportUtils.h(f, bi, bj, bk);
                        let bq = Math.min(bo, bp);
                        let 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 };
                        let 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) {
                        let bt = this.zs.ca;
                        let bu = this.zs.b9;
                        let bv = this.getEffectiveViewport1(this.zs);
                        let bw = ViewportUtils.e(d.x, bt, bu, bv);
                        let bx = ViewportUtils.i(d.y, bt, bu, bv);
                        let by = { $type: Point_$type, x: bw, y: bx };
                        let bz = ViewportUtils.d(e, bt, bu, bv);
                        let b0 = ViewportUtils.h(e, bt, bu, bv);
                        let b1 = Math.min(bz, b0);
                        let 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;
                        let b3 = ViewportUtils.d(f, bt, bu, bv);
                        let b4 = ViewportUtils.h(f, bt, bu, bv);
                        let 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) {
                            let 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);
                }
            }
        }
        aew(a, b, c, d) {
            let e = GeometryUtil.o(a, b, c, d);
            if (!isNaN_(e.c.x) && !isNaN_(e.c.y) && !isNaN_(e.d.x) && !isNaN_(e.d.y)) {
                let f;
                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 };
        }
        aev(a, b, c, d, e, f, g, h) {
            let i = SliceCoords.b(a, b, c, d, e, f, g, h);
            let j = this.zz.m;
            let k = Math.abs((e - d) - (Math.PI * 2)) <= 0.0001;
            if (k) {
                let l = ViewportUtils.e(h.x, a, b, c);
                let m = ViewportUtils.i(h.y, a, b, c);
                let n = i.n.width;
                let o = i.m.width;
                if (i.m.width == 0 && i.m.height == 0) {
                    return ((() => {
                        let $ret = new EllipseGeometry();
                        $ret.e = { $type: Point_$type, x: l, y: m };
                        $ret.c = n;
                        $ret.d = n;
                        return $ret;
                    })());
                }
                else {
                    let p = new Size(1, n, n);
                    let q = new Size(1, o, o);
                    let r = ((() => {
                        let $ret = PointUtil.create();
                        $ret.x = l - n;
                        $ret.y = m;
                        return $ret;
                    })());
                    let s = ((() => {
                        let $ret = PointUtil.create();
                        $ret.x = l + n;
                        $ret.y = m;
                        return $ret;
                    })());
                    let t = ((() => {
                        let $ret = PointUtil.create();
                        $ret.x = l - o;
                        $ret.y = m;
                        return $ret;
                    })());
                    let u = ((() => {
                        let $ret = PointUtil.create();
                        $ret.x = l + o;
                        $ret.y = m;
                        return $ret;
                    })());
                    let v = ((() => {
                        let $ret = new PathFigure();
                        $ret.startPoint = r;
                        return $ret;
                    })());
                    let w = new PathSegmentCollection();
                    let x = ((() => {
                        let $ret = new ArcSegment();
                        $ret.f = p;
                        $ret.d = 1;
                        $ret.e = s;
                        return $ret;
                    })());
                    w.add(x);
                    v._segments = w;
                    let y = ((() => {
                        let $ret = new PathFigure();
                        $ret.startPoint = u;
                        return $ret;
                    })());
                    let z = new PathSegmentCollection();
                    let aa = ((() => {
                        let $ret = new ArcSegment();
                        $ret.f = q;
                        $ret.d = 0;
                        $ret.e = t;
                        return $ret;
                    })());
                    z.add(aa);
                    y._segments = z;
                    let ab = ((() => {
                        let $ret = new PathFigure();
                        $ret.startPoint = r;
                        return $ret;
                    })());
                    let ac = new PathSegmentCollection();
                    let ad = ((() => {
                        let $ret = new ArcSegment();
                        $ret.f = p;
                        $ret.d = 0;
                        $ret.e = s;
                        return $ret;
                    })());
                    ac.add(ad);
                    ab._segments = ac;
                    let ae = ((() => {
                        let $ret = new PathFigure();
                        $ret.startPoint = u;
                        return $ret;
                    })());
                    let af = new PathSegmentCollection();
                    let ag = ((() => {
                        let $ret = new ArcSegment();
                        $ret.f = q;
                        $ret.d = 1;
                        $ret.e = t;
                        return $ret;
                    })());
                    af.add(ag);
                    ae._segments = af;
                    let ah = ((() => {
                        let $ret = new PathFigureCollection();
                        $ret.add(v);
                        $ret.add(y);
                        $ret.add(ab);
                        $ret.add(ae);
                        return $ret;
                    })());
                    return ((() => {
                        let $ret = new PathGeometry();
                        $ret.c = ah;
                        return $ret;
                    })());
                }
            }
            if (this.aeg && !k) {
                this.aer(i, d, e, h, f, g, 0.5);
            }
            let ai = new PathFigure();
            ai._startPoint = i.d;
            ai._isClosed = true;
            ai._segments.add(((() => {
                let $ret = new LineSegment(1);
                $ret.c = i.f;
                return $ret;
            })()));
            ai._segments.add(((() => {
                let $ret = new ArcSegment();
                $ret.e = i.h;
                $ret.f = i.n;
                $ret.d = 1;
                $ret.b = i.c;
                return $ret;
            })()));
            ai._segments.add(((() => {
                let $ret = new LineSegment(1);
                $ret.c = i.j;
                return $ret;
            })()));
            if (!this.aeg || (i.m.width > 0 && i.m.height > 0)) {
                ai._segments.add(((() => {
                    let $ret = new ArcSegment();
                    $ret.e = i.d;
                    $ret.f = i.m;
                    $ret.d = 0;
                    $ret.b = i.c;
                    return $ret;
                })()));
            }
            let aj = new PathGeometry();
            aj.c.add(ai);
            return aj;
        }
        aee(a, b, c, d, e, f, g, h) {
            let i = SliceCoords.b(a, b, c, d, e, f, g, h);
            if (isNaN_(i.n.width) || isNaN_(d) || isNaN_(e)) {
                return null;
            }
            let j = ViewportUtils.e(0.5, a, b, c);
            let k = ViewportUtils.i(0.5, a, b, c);
            return new PieSliceCollisionGeometry(j, k, i.n.width, i.m.width, d, e);
        }
        aeu(a, b, c, d, e, f, g, h, i, j) {
            let k = this.zz.m;
            let l = Math.abs((e - d) - (Math.PI * 2)) <= 0.0001;
            let 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);
            }
            let n = new PathFigure();
            n._startPoint = m.d;
            n._isClosed = true;
            let o = ((d + ((e - d) * 0.5)) * 180 / Math.PI) + 90;
            let 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(((() => {
                    let $ret = new ArcSegment();
                    $ret.e = m.e;
                    $ret.f = p;
                    $ret.c = o;
                    $ret.d = 1;
                    $ret.b = false;
                    return $ret;
                })()));
            }
            n._segments.add(((() => {
                let $ret = new LineSegment(1);
                $ret.c = m.f;
                return $ret;
            })()));
            n._segments.add(((() => {
                let $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(((() => {
                let $ret = new ArcSegment();
                $ret.e = m.h;
                $ret.f = m.n;
                $ret.d = 1;
                $ret.b = m.c;
                return $ret;
            })()));
            n._segments.add(((() => {
                let $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(((() => {
                let $ret = new LineSegment(1);
                $ret.c = m.j;
                return $ret;
            })()));
            if (!this.aeg || (m.m.width > 0 && m.m.height > 0)) {
                n._segments.add(((() => {
                    let $ret = new ArcSegment();
                    $ret.e = m.k;
                    $ret.f = p;
                    $ret.c = o;
                    $ret.d = 1;
                    $ret.b = false;
                    return $ret;
                })()));
                n._segments.add(((() => {
                    let $ret = new ArcSegment();
                    $ret.e = m.d;
                    $ret.f = m.m;
                    $ret.d = 0;
                    $ret.b = m.c;
                    return $ret;
                })()));
            }
            let q = new PathGeometry();
            q.c.add(n);
            return q;
        }
        rq(a, b, c, d) {
            super.rq(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;
            }
        }
        w8(a) {
            let b = this.aeb.ca;
            let c = this.aeb.b9;
            let d = this.getEffectiveViewport1(this.aeb);
            let e = this.w4(this.aeb);
            let f = this.zq.px(c, b, d, e);
            let g = { $type: Point_$type, x: 0.5, y: 0.5 };
            let h = GeometryUtil.g(g, a);
            let i = this.zt.k;
            let j = 0;
            for (let k = 0; k < i.count; k++) {
                let l = i._inner[k][0];
                let m = Math.min(i._inner[k][2], f.maxLength);
                let 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)) {
                    let o = Math.max(0, 0.5 * this.zq.tf);
                    let p = o;
                    p = Math.max(p, f.minLength);
                    let q = SliceCoords.b(b, c, d, l - (n * 0.5), l + (n * 0.5), p, m, g);
                    let 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);
                    let s = 1.7976931348623157E+308;
                    let t = 1.7976931348623157E+308;
                    let u = -1.7976931348623157E+308;
                    let 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);
        }
        k3(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;
        }
        ed(a, b, c, d, e) {
            if (super.ed(a, b, c, d, e)) {
                let f = typeCast(ProportionalCategoryAngleAxis.$, this.zk) !== null && this.zk.hasOthersCategory;
                if (e && (this.aea == 1 || (this.aea == 2 && !f))) {
                    let g = this.zk;
                    let h = new ScalerParams(1, this.dc.yr, this.xd, g.dn);
                    h.c = this.getEffectiveViewport1(this.cw);
                    let i = this.zq;
                    let j = new ScalerParams(1, this.dc.yr, this.xd, i.dn);
                    j.c = this.getEffectiveViewport1(this.cw);
                    let k = this.aap;
                    for (let l = 0; l < this.dp.count; l++) {
                        let m = this.dp.item(l);
                        let n = NaN;
                        if (m != null) {
                            n = this.jk(m);
                        }
                        if (n == 0) {
                            let o = new SeriesPointOfInterest();
                            o.f = this.abp(n, m, l, d, k, c, b, false);
                            o.b = ((() => {
                                let $ret = new DataContext();
                                $ret.item = m;
                                $ret.series = this;
                                return $ret;
                            })());
                            o.g = this.v0;
                            o.c = l;
                            if (this.hf) {
                                o.g = this.v7(l);
                            }
                            let p = false;
                            for (let 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);
                            }
                        }
                    }
                }
                return true;
            }
            return false;
        }
        ak(a, b) {
            let c = new List$1(ChartSelection.$, 0);
            this.qi(a, c, b);
            return c.toArray();
        }
        qi(a, b, c) {
            if (this.zl == 0) {
                super.qi(a, b, c);
                return;
            }
            let d = this.cw.ca;
            let e = this.cw.b9;
            let f = this.getEffectiveViewport1(this.cw);
            let g = this.dc.yz(this.xd, this.getEffectiveViewport(), d);
            let h = this.zq.px(e, d, f, g);
            let i = { $type: Point_$type, x: 0.5, y: 0.5 };
            let j = this.zq;
            let k = Math.max(0, 0.5 * j.tf);
            let l = k;
            l = Math.max(l, h.minLength);
            let m = this.zk.pz(d, e, f);
            let n = this.zk != null && this.zk.ds;
            let o = new CollisionRect(0, this.dc.yw(a));
            for (let p = 0; p < this.zk.qb; p++) {
                let q = typeCast(RadialBaseView.$, this.cw);
                let r = q.da.getBucket(p);
                let s = this.ac3(this.zk, d, e, f);
                if (n) {
                    m = this.aak(p, d, e, f);
                    s = this.ac2(p, this.zk, d, e, f);
                    if (isNaN_(s)) {
                        s = 0;
                    }
                }
                r[0] = this.zk.getScaledAngle(r[0]) + s;
                let t = r[0];
                let u = Math.min(this.zr.b.tm(r[2]), h.maxLength);
                let v = this.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(((() => {
                            let $ret = new ChartSelection();
                            $ret.series = this;
                            return $ret;
                        })()));
                        return;
                    }
                    if (c == 2 || c == 1) {
                        b.add(((() => {
                            let $ret = new ChartSelection();
                            $ret.item = this.dp.item(p);
                            return $ret;
                        })()));
                    }
                    else {
                        b.add(((() => {
                            let $ret = new ChartSelection();
                            $ret.item = this.dp.item(p);
                            $ret.series = this;
                            return $ret;
                        })()));
                    }
                }
            }
        }
    }
    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;
})();
/**
 * @hidden
 */
export let RadialPieSeriesView = /*@__PURE__*/ (() => {
    class RadialPieSeriesView extends AnchoredRadialSeriesView {
        constructor(a) {
            super(a);
            this.di = null;
            this.dj = null;
            this.dk = null;
            this.dq = new Path();
            this.di = a;
            this.dj = ((() => {
                let $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;
            })());
        }
        a4() {
            super.a4();
            this.dk = new List$1(Path.$, 0);
            if (!this.t) {
                this.c9.xv = Defaults.c;
                this.c9.jy = Defaults.i;
            }
        }
        dr() {
            let a = ((() => {
                let $ret = new Path();
                $ret.dataContext = ((() => {
                    let $ret = new DataContext();
                    $ret.series = this.f;
                    return $ret;
                })());
                return $ret;
            })());
            this.dk.add(a);
            a._visibility = 1;
            return a;
        }
        dl(a) {
            a._visibility = 0;
        }
        dn(a) {
            a._visibility = 1;
        }
        dm(a) {
            this.dk.remove(a);
        }
        bs(a, b) {
            super.bs(a, b);
            let c = a;
        }
        ak(a) {
            return this.dk._inner[a];
        }
        aj(a) {
            let b = this.dk._inner[a];
            this.dq._visibility = b._visibility;
            this.dq.an = b.an;
            let c = this.b4(a);
            this.dq._fill = c;
            this.dq._stroke = c;
            this.dq.ad = this.f.il;
            return this.dq;
        }
        bj(a, b) {
            super.bj(a, b);
            if (a.d) {
                for (let c = 0; c < this.dk.count; c++) {
                    let d = this.ai(c, b);
                    if (this.di.aeg) {
                        a.aa();
                        a.ac(d);
                    }
                    a.t(d);
                    if (this.di.aeg) {
                        a.z();
                    }
                }
            }
        }
        dp() {
            this.a2();
        }
        ax(a) {
            super.ax(a);
            let b = 0;
            for (let c of fromEnum(this.dj.a)) {
                this.f.bc.exportPathData(a, c, "slice" + b, ["Main", "Fill"]);
                b++;
            }
        }
    }
    RadialPieSeriesView.$t = markType(RadialPieSeriesView, 'RadialPieSeriesView', AnchoredRadialSeriesView.$);
    return RadialPieSeriesView;
})();