UNPKG

igniteui-react-charts

Version:

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

209 lines (208 loc) 6.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 { HorizontalAxisLabelPanelBase } from "./HorizontalAxisLabelPanelBase"; import { Number_$type, fromEnum, Boolean_$type, markType } from "igniteui-react-core"; import { Size } from "igniteui-react-core"; import { List$1 } from "igniteui-react-core"; import { Rect } from "igniteui-react-core"; import { HorizontalAxisLabelPanelBaseView } from "./HorizontalAxisLabelPanelBaseView"; import { TransformGroup } from "igniteui-react-core"; import { RotateTransform } from "igniteui-react-core"; import { TranslateTransform } from "igniteui-react-core"; import { ViewportUtils } from "./ViewportUtils"; /** * @hidden */ export let RadialAxisLabelPanel = /*@__PURE__*/ (() => { class RadialAxisLabelPanel extends HorizontalAxisLabelPanelBase { constructor() { super(...arguments); this.d6 = null; this.d3 = 0; this.d2 = new List$1(Number_$type, 0); } af() { return new RadialAxisLabelPanelView(this); } cn(a) { super.cn(a); this.d0 = a; } get d1() { return !this.ao; } dj() { return this.aq && (!this.a0 || this.bs() == -180); } dk() { return !this.a1; } b8(a) { super.b8(a); if (this.d3 % 360 == 0 || this.ao) { this.d0.a5(); } else { this.d0.a4(a); } } bs() { let a = super.bs(); if (this.d1) { a -= (this.d3 * 180) / Math.PI; } return a; } di() { return this.bs() % 360 != 0; } dh() { if (this.ae != null && this.ae.b7 != null && this.ae.b7.gp) { return false; } if (this.ao) { return true; } let a = this.d3 * 180 / Math.PI; if (a < 30 || a > 330 || (a > 150 && a < 210)) { return true; } return false; } cs(a, b) { let c = b * Math.PI / 180; let d = Math.abs(Math.sin(c)); if (this.ae.a4 != null && this.ae.a4.c == 4) { d = d * -1; } this.d0.a6(a, b, d); } ct(a, b, c) { this.cs(a, c); } d5() { let a = 1.7976931348623157E+308; for (let b of fromEnum(this.bh)) { a = Math.min(b.h, a); } return a; } d4() { let a = -1.7976931348623157E+308; for (let b of fromEnum(this.bh)) { a = Math.max(b.h, a); } return a; } dx(a, b) { let c; if (this.ae.dn) { c = this.d5(); } else { c = this.d4(); } let d = new List$1(Number_$type, 0); let e = new List$1(Boolean_$type, 0); for (let f = 0; f < this.bh.count; f++) { let g = this.bh._inner[f]; if (g.h == c && !g.b) { d.add(this.bh.indexOf(g)); } } this.d2 = d; let h = new List$1(Rect.$, 0); for (let i = 0; i < a.count; i++) { let j = a._inner[i]; let k = this.bh._inner[i].b; if (!this.d2.contains(i)) { h.add(j); e.add(k); } } this.aq = this.ap(h, e); } aw(a, b) { if (this.d2.contains(a)) { return false; } else { return super.aw(a, b); } } dy() { this.d2 = new List$1(Number_$type, 0); super.dy(); } aj() { return 5; } a3(a) { return a == 5 || a == 4 || a == 1 || a == 0; } cf() { } } RadialAxisLabelPanel.$t = /*@__PURE__*/ markType(RadialAxisLabelPanel, 'RadialAxisLabelPanel', HorizontalAxisLabelPanelBase.$); return RadialAxisLabelPanel; })(); /** * @hidden */ export let RadialAxisLabelPanelView = /*@__PURE__*/ (() => { class RadialAxisLabelPanelView extends HorizontalAxisLabelPanelBaseView { constructor(a) { super(a); this.a3 = null; this.a3 = a; } a6(a, b, c) { let d = this.n(a); let e = this.m(a); let f = new TransformGroup(); f.j.add(((() => { let $ret = new RotateTransform(); $ret.j = b; $ret.k = d / 2; $ret.l = e / 2; return $ret; })())); f.j.add(((() => { let $ret = new TranslateTransform(); $ret.j = d / -2; $ret.k = d / 2 * c; return $ret; })())); a.j = f; } aq(a, b, c, d, e, f, g, h, i, j, k) { super.aq(a, b, c, d, e, f, g, h, i, j, k); if (d._visibility == 0) { d.j = a.j; } } a5() { this.a.j = null; } a4(a) { let b = ViewportUtils.i(0.5, this.a.dc, this.a.db, this.a.ae != null ? this.a.ae.o3() : Rect.empty); this.a.j = ((() => { let $ret = new RotateTransform(); $ret.j = (this.a3.d3 * 180) / Math.PI; $ret.k = this.a3.d6.x; $ret.l = (this.a3.d6.y * a.height) + b; return $ret; })()); } al() { super.al(); this.a.dd(new Size(1, this.a.c8.width, this.a.c8.height)); } } RadialAxisLabelPanelView.$t = /*@__PURE__*/ markType(RadialAxisLabelPanelView, 'RadialAxisLabelPanelView', HorizontalAxisLabelPanelBaseView.$); return RadialAxisLabelPanelView; })();