UNPKG

igniteui-angular-charts

Version:

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

350 lines (349 loc) 13.4 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 { Defaults } from "./Defaults"; import { Point_$type, runOn, typeCast, markType, markDep, fromEnum } from "igniteui-angular-core"; import { Pool$1 } from "igniteui-angular-core"; import { Path } from "igniteui-angular-core"; import { RadialBaseView } from "./RadialBaseView"; import { List$1 } from "igniteui-angular-core"; import { ScalerParams } from "./ScalerParams"; import { PathGeometry } from "igniteui-angular-core"; import { PathFigure } from "igniteui-angular-core"; import { PolyLineSegment } from "igniteui-angular-core"; import { ViewportUtils } from "./ViewportUtils"; import { ChartSelection } from "./ChartSelection"; import { Clipper } from "igniteui-angular-core"; import { PropertyMetadata } from "igniteui-angular-core"; import { isNaN_ } from "igniteui-angular-core"; import { AnchoredRadialSeriesView } from "./AnchoredRadialSeriesView"; /** * @hidden */ export let RadialColumnSeries = /*@__PURE__*/ (() => { class RadialColumnSeries extends AnchoredRadialSeries { constructor() { super(); this.ab = RadialColumnSeries.$; } bj() { return new RadialColumnSeries(); } get_ez() { return true; } get_fk() { return true; } jj() { if (!isNaN_(this.ji)) { return super.jj(); } return Defaults.h; } cs() { return new RadialColumnSeriesView(this); } q0(a) { super.q0(a); this.ado = a; } ac() { super.ac(); this.rq(false); } q8(a, b, c, d) { super.q8(a, b, c, d); switch (b) { case RadialColumnSeries.$$p[0]: case RadialColumnSeries.$$p[1]: this.q2(); break; } } preferredCategoryMode(a) { return a != null && a == this.yy ? 2 : 0; } o4(a, b) { super.o4(a, b); let c = b; if (a) { c.c6.count = 0; } } get_ed() { return true; } iv() { return this.yy.k8(this.cv.by, this.cv.bx, this.getEffectiveViewport1(this.cv)); } abb(a, b) { super.abb(a, b); let c = a.f; let d = b.by; let e = b.bx; let f = this.getEffectiveViewport1(b); let g = this.wi(b); let h = this.y4.k5(e, d, f, g); let i = b; let j = this.y4; let k = Math.max(0, 0.5 * j.n6); k = Math.max(k, h.minLength * 0.9); let l = ViewportUtils.d(k, d, e, f); let m = this.yy.k8(d, e, f); let n = Math.max(0.1 * this.y4.n7, k); let o = this.y7.d(0, n, d, e, f); let p = this.y7.e(0, n, d, e, f); let q = this.y7.d(m, n, d, e, f); let r = this.y7.e(m, n, d, e, f); let s = Math.sqrt((o - q) * (o - q) + (p - r) * (p - r)); let t = { $type: Point_$type, x: ViewportUtils.e(0.5, d, e, f), y: ViewportUtils.i(0.5, d, e, f) }; let u = this.ab7.count; this.zf.a2(this, this.zw(), runOn(this, this.ym), this.z5(b), this.z6(b)); this.zf.r = this.adp; this.zf.s = this.adq; this.zf.k = this.adp; this.zf.l = this.adq; let v = false; let w = this.zf.b; if (w != null) { v = true; } let x = this.yy; let y = new ScalerParams(1, b.by, b.bx, x.ch); y.c = this.getEffectiveViewport(); for (let z = 0; z < c.count; ++z) { let aa = Math.min(a.f._inner[z][2], h.maxLength * 1.1); let ab = this.y7.d(a.f._inner[z][0], aa, d, e, f); let ac = this.y7.e(a.f._inner[z][0], aa, d, e, f); let ad = Math.sqrt((ab - t.x) * (ab - t.x) + (ac - t.y) * (ac - t.y)); let ae = ad; let af = l; if (v) { this.ac4(c, z, u, x, y, b.q); } let ag = this.zf.k; let ah = this.zf.l; let ai = a.f._inner[z][0] - (Math.PI / 2); let aj = i.c6.item(z); let ak = 0 - (s / 2); let al = (s / 2); let am = Math.max(af, ae); let an = Math.min(af, ae); let ao = Math.cos(ai); let ap = Math.sin(ai); let aq = { $type: Point_$type, x: t.x + (ak * ao - am * ap), y: t.y + (ak * ap + am * ao) }; let ar = { $type: Point_$type, x: t.x + (al * ao - am * ap), y: t.y + (al * ap + am * ao) }; let as = { $type: Point_$type, x: t.x + (al * ao - an * ap), y: t.y + (al * ap + an * ao) }; let at = { $type: Point_$type, x: t.x + (ak * ao - an * ap), y: t.y + (ak * ap + an * ao) }; let au = new PathGeometry(); let av = new PathFigure(); av._startPoint = aq; av._isClosed = true; let aw = new PolyLineSegment(); aw._points.add(ar); aw._points.add(as); aw._points.add(at); av._segments.add(aw); au.c.add(av); aj.an = au; this.zf.ad(aj, false, false, false, false); } i.c6.count = c.count; this.ado.db(); } ak(a, b) { let c = new List$1(ChartSelection.$, 0); this.p3(a, c, b); return c.toArray(); } p3(a, b, c) { if (this.yz == 0) { super.p3(a, b, c); return; } let d = this.cv.by; let e = this.cv.bx; let f = this.getEffectiveViewport1(this.cv); let g = this.wi(this.cv); let h = this.y4.k5(e, d, f, g); let i = { $type: Point_$type, x: ViewportUtils.e(0.5, d, e, f), y: ViewportUtils.i(0.5, d, e, f) }; let j = new Clipper(1, a.left, a.bottom, a.right, a.top, true); let k = this.y4; let l = Math.max(0, 0.5 * k.n6); l = Math.max(l, h.minLength * 0.9); let m = ViewportUtils.d(l, d, e, f); let n = this.yy.k8(d, e, f); let o = Math.max(0.1 * this.y4.n7, l); let p = this.y7.d(0, o, d, e, f); let q = this.y7.e(0, o, d, e, f); let r = this.y7.d(n, o, d, e, f); let s = this.y7.e(n, o, d, e, f); let t = Math.sqrt((p - r) * (p - r) + (q - s) * (q - s)); let u = this.yy != null && this.yy.cl; for (let v = 0; v < this.yy.lk; v++) { let w = typeCast(RadialBaseView.$, this.cv); let x = w.cx.getBucket(v); let y = Math.min(this.y7.b.od(x[2]), h.maxLength * 1.1); let z = this.aci(this.yy, d, e, f); if (u) { z = this.ach(v, this.yy, d, e, f); if (isNaN_(z)) { z = 0; } } x[0] = this.yy.getScaledAngle(x[0]) + z; let aa = this.y7.d(x[0], y, d, e, f); let ab = this.y7.e(x[0], y, d, e, f); let ac = Math.sqrt((aa - i.x) * (aa - i.x) + (ab - i.y) * (ab - i.y)); let ad = ac; let ae = m; let af = x[0] - (Math.PI / 2); let ag = 0 - (t / 2); let ah = (t / 2); let ai = Math.max(ae, ad); let aj = Math.min(ae, ad); let ak = Math.cos(af); let al = Math.sin(af); let am = { $type: Point_$type, x: i.x + (ag * ak - ai * al), y: i.y + (ag * al + ai * ak) }; let an = { $type: Point_$type, x: i.x + (ah * ak - ai * al), y: i.y + (ah * al + ai * ak) }; let ao = { $type: Point_$type, x: i.x + (ah * ak - aj * al), y: i.y + (ah * al + aj * ak) }; let ap = { $type: Point_$type, x: i.x + (ag * ak - aj * al), y: i.y + (ag * al + aj * ak) }; let aq = new List$1(Point_$type, 0); j.i = aq; j.j(am); j.j(an); j.j(ao); j.j(ap); j.i = null; if (aq == null || aq.count == 0) { continue; } if (c == 7 || c == 6) { b.add(((() => { let $ret = new ChartSelection(); $ret.series = this; return $ret; })())); return; } else if (c == 2 || c == 1) { b.add(((() => { let $ret = new ChartSelection(); $ret.item = this.dn.item(v); return $ret; })())); } else { b.add(((() => { let $ret = new ChartSelection(); $ret.item = this.dn.item(v); $ret.series = this; return $ret; })())); } } } } RadialColumnSeries.$t = markType(RadialColumnSeries, 'RadialColumnSeries', AnchoredRadialSeries.$); RadialColumnSeries.$$p = markDep(DependencyProperty, PropertyMetadata, RadialColumnSeries, 'raisePropertyChanged', ['RadiusX:adp:adt', [1, 0], 'RadiusY:adq:adu', [1, 0]]); return RadialColumnSeries; })(); /** * @hidden */ export let RadialColumnSeriesView = /*@__PURE__*/ (() => { class RadialColumnSeriesView extends AnchoredRadialSeriesView { constructor(a) { super(a); this.c5 = null; this.c6 = null; this.c7 = null; this.dd = new Path(); this.c5 = a; this.c6 = ((() => { let $ret = new Pool$1(Path.$); $ret.create = runOn(this, this.de); $ret.activate = runOn(this, this.c8); $ret.disactivate = runOn(this, this.da); $ret.destroy = runOn(this, this.c9); return $ret; })()); } au() { super.au(); this.c7 = new List$1(Path.$, 0); if (!this.q) { this.cw.w9 = Defaults.c; this.cw.jo = Defaults.i; } } de() { let a = new Path(); this.c7.add(a); a._visibility = 1; return a; } c8(a) { a._visibility = 0; } da(a) { a._visibility = 1; } c9(a) { this.c7.remove(a); } dc(a, b, c, d, e, f) { this.as(); } bg(a, b) { super.bg(a, b); let c = a; } bh(a, b) { super.bh(a, b); let c = a; } ac(a) { return this.c7._inner[a]; } ab(a) { let b = this.c7._inner[a]; this.dd._visibility = b._visibility; this.dd.an = b.an; let c = this.bs(a); this.dd._fill = c; this.dd._stroke = c; this.dd.ad = this.e.id + 3; return this.dd; } a8(a, b) { super.a8(a, b); if (a.d) { for (let c = 0; c < this.c7.count; c++) { let d = this.aa(c, b); this.bf(d, c, b); a.t(d); } } } an(a) { super.an(a); let b = 0; for (let c of fromEnum(this.c6.a)) { this.e.bc.exportPathData(a, c, "column" + b, ["Main", "Fill"]); b++; } } db() { this.as(); } } RadialColumnSeriesView.$t = markType(RadialColumnSeriesView, 'RadialColumnSeriesView', AnchoredRadialSeriesView.$); return RadialColumnSeriesView; })();