UNPKG

igniteui-react-charts

Version:

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

251 lines (250 loc) 8.53 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, __read, __spreadArray, __values } from "tslib"; 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 */ var RadialAxisLabelPanel = /** @class */ /*@__PURE__*/ (function (_super) { __extends(RadialAxisLabelPanel, _super); function RadialAxisLabelPanel() { var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this; _this.d6 = null; _this.d3 = 0; _this.d2 = new List$1(Number_$type, 0); return _this; } RadialAxisLabelPanel.prototype.af = function () { return new RadialAxisLabelPanelView(this); }; RadialAxisLabelPanel.prototype.cn = function (a) { _super.prototype.cn.call(this, a); this.d0 = a; }; Object.defineProperty(RadialAxisLabelPanel.prototype, "d1", { get: function () { return !this.ao; }, enumerable: false, configurable: true }); RadialAxisLabelPanel.prototype.dj = function () { return this.aq && (!this.a0 || this.bs() == -180); }; RadialAxisLabelPanel.prototype.dk = function () { return !this.a1; }; RadialAxisLabelPanel.prototype.b8 = function (a) { _super.prototype.b8.call(this, a); if (this.d3 % 360 == 0 || this.ao) { this.d0.a5(); } else { this.d0.a4(a); } }; RadialAxisLabelPanel.prototype.bs = function () { var a = _super.prototype.bs.call(this); if (this.d1) { a -= (this.d3 * 180) / Math.PI; } return a; }; RadialAxisLabelPanel.prototype.di = function () { return this.bs() % 360 != 0; }; RadialAxisLabelPanel.prototype.dh = function () { if (this.ae != null && this.ae.b7 != null && this.ae.b7.gp) { return false; } if (this.ao) { return true; } var a = this.d3 * 180 / Math.PI; if (a < 30 || a > 330 || (a > 150 && a < 210)) { return true; } return false; }; RadialAxisLabelPanel.prototype.cs = function (a, b) { var c = b * Math.PI / 180; var 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); }; RadialAxisLabelPanel.prototype.ct = function (a, b, c) { this.cs(a, c); }; RadialAxisLabelPanel.prototype.d5 = function () { var e_1, _a; var a = 1.7976931348623157E+308; try { for (var _b = __values(fromEnum(this.bh)), _c = _b.next(); !_c.done; _c = _b.next()) { var b = _c.value; a = Math.min(b.h, a); } } 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; } } return a; }; RadialAxisLabelPanel.prototype.d4 = function () { var e_2, _a; var a = -1.7976931348623157E+308; try { for (var _b = __values(fromEnum(this.bh)), _c = _b.next(); !_c.done; _c = _b.next()) { var b = _c.value; a = Math.max(b.h, a); } } catch (e_2_1) { e_2 = { error: e_2_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_2) throw e_2.error; } } return a; }; RadialAxisLabelPanel.prototype.dx = function (a, b) { var c; if (this.ae.dn) { c = this.d5(); } else { c = this.d4(); } var d = new List$1(Number_$type, 0); var e = new List$1(Boolean_$type, 0); for (var f = 0; f < this.bh.count; f++) { var g = this.bh._inner[f]; if (g.h == c && !g.b) { d.add(this.bh.indexOf(g)); } } this.d2 = d; var h = new List$1(Rect.$, 0); for (var i = 0; i < a.count; i++) { var j = a._inner[i]; var k = this.bh._inner[i].b; if (!this.d2.contains(i)) { h.add(j); e.add(k); } } this.aq = this.ap(h, e); }; RadialAxisLabelPanel.prototype.aw = function (a, b) { if (this.d2.contains(a)) { return false; } else { return _super.prototype.aw.call(this, a, b); } }; RadialAxisLabelPanel.prototype.dy = function () { this.d2 = new List$1(Number_$type, 0); _super.prototype.dy.call(this); }; RadialAxisLabelPanel.prototype.aj = function () { return 5; }; RadialAxisLabelPanel.prototype.a3 = function (a) { return a == 5 || a == 4 || a == 1 || a == 0; }; RadialAxisLabelPanel.prototype.cf = function () { }; RadialAxisLabelPanel.$t = markType(RadialAxisLabelPanel, 'RadialAxisLabelPanel', HorizontalAxisLabelPanelBase.$); return RadialAxisLabelPanel; }(HorizontalAxisLabelPanelBase)); export { RadialAxisLabelPanel }; /** * @hidden */ var RadialAxisLabelPanelView = /** @class */ /*@__PURE__*/ (function (_super) { __extends(RadialAxisLabelPanelView, _super); function RadialAxisLabelPanelView(a) { var _this = _super.call(this, a) || this; _this.a3 = null; _this.a3 = a; return _this; } RadialAxisLabelPanelView.prototype.a6 = function (a, b, c) { var d = this.n(a); var e = this.m(a); var f = new TransformGroup(); f.j.add(((function () { var $ret = new RotateTransform(); $ret.j = b; $ret.k = d / 2; $ret.l = e / 2; return $ret; })())); f.j.add(((function () { var $ret = new TranslateTransform(); $ret.j = d / -2; $ret.k = d / 2 * c; return $ret; })())); a.j = f; }; RadialAxisLabelPanelView.prototype.aq = function (a, b, c, d, e, f, g, h, i, j, k) { _super.prototype.aq.call(this, a, b, c, d, e, f, g, h, i, j, k); if (d._visibility == 0) { d.j = a.j; } }; RadialAxisLabelPanelView.prototype.a5 = function () { this.a.j = null; }; RadialAxisLabelPanelView.prototype.a4 = function (a) { var _this = this; var b = ViewportUtils.i(0.5, this.a.dc, this.a.db, this.a.ae != null ? this.a.ae.o3() : Rect.empty); this.a.j = ((function () { var $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; })()); }; RadialAxisLabelPanelView.prototype.al = function () { _super.prototype.al.call(this); this.a.dd(new Size(1, this.a.c8.width, this.a.c8.height)); }; RadialAxisLabelPanelView.$t = markType(RadialAxisLabelPanelView, 'RadialAxisLabelPanelView', HorizontalAxisLabelPanelBaseView.$); return RadialAxisLabelPanelView; }(HorizontalAxisLabelPanelBaseView)); export { RadialAxisLabelPanelView };