UNPKG

igniteui-react-charts

Version:

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

242 lines (241 loc) 8.2 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.d4 = null; _this.d1 = 0; _this.d0 = new List$1(Number_$type, 0); return _this; } RadialAxisLabelPanel.prototype.af = function () { return new RadialAxisLabelPanelView(this); }; RadialAxisLabelPanel.prototype.cl = function (a) { _super.prototype.cl.call(this, a); this.dy = a; }; Object.defineProperty(RadialAxisLabelPanel.prototype, "dz", { get: function () { return !this.ao; }, enumerable: false, configurable: true }); RadialAxisLabelPanel.prototype.dh = function () { return this.aq && (!this.a0 || this.bq() == -180); }; RadialAxisLabelPanel.prototype.di = function () { return !this.a1; }; RadialAxisLabelPanel.prototype.b6 = function (a) { _super.prototype.b6.call(this, a); if (this.d1 % 360 == 0 || this.ao) { this.dy.a5(); } else { this.dy.a4(a); } }; RadialAxisLabelPanel.prototype.bq = function () { var a = _super.prototype.bq.call(this); if (this.dz) { a -= (this.d1 * 180) / Math.PI; } return a; }; RadialAxisLabelPanel.prototype.dg = function () { return this.bq() % 360 != 0; }; RadialAxisLabelPanel.prototype.df = function () { if (this.ae != null && this.ae.b7 != null && this.ae.b7.go) { return false; } if (this.ao) { return true; } var a = this.d1 * 180 / Math.PI; if (a < 30 || a > 330 || (a > 150 && a < 210)) { return true; } return false; }; RadialAxisLabelPanel.prototype.cq = 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.dy.a6(a, b, d); }; RadialAxisLabelPanel.prototype.d3 = function () { var e_1, _a; var a = 1.7976931348623157E+308; try { for (var _b = __values(fromEnum(this.bf)), _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.d2 = function () { var e_2, _a; var a = -1.7976931348623157E+308; try { for (var _b = __values(fromEnum(this.bf)), _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.dv = function (a, b) { var c; if (this.ae.dn) { c = this.d3(); } else { c = this.d2(); } var d = new List$1(Number_$type, 0); var e = new List$1(Boolean_$type, 0); for (var f = 0; f < this.bf.count; f++) { var g = this.bf._inner[f]; if (g.h == c && !g.b) { d.add(this.bf.indexOf(g)); } } this.d0 = d; var h = new List$1(Rect.$, 0); for (var i = 0; i < a.count; i++) { var j = a._inner[i]; var k = this.bf._inner[i].b; if (!this.d0.contains(i)) { h.add(j); e.add(k); } } this.aq = this.ap(h, e); }; RadialAxisLabelPanel.prototype.aw = function (a, b) { if (this.d0.contains(a)) { return false; } else { return _super.prototype.aw.call(this, a, b); } }; RadialAxisLabelPanel.prototype.dw = function () { this.d0 = new List$1(Number_$type, 0); _super.prototype.dw.call(this); }; RadialAxisLabelPanel.prototype.aj = function () { return 5; }; RadialAxisLabelPanel.prototype.a3 = function (a) { return a == 5 || a == 4 || a == 1 || a == 0; }; RadialAxisLabelPanel.prototype.cd = 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.a5 = function () { this.a.j = null; }; RadialAxisLabelPanelView.prototype.a4 = function (a) { var _this = this; var b = ViewportUtils.i(0.5, this.a.da, this.a.c9, this.a.ae != null ? this.a.ae.o1() : Rect.empty); this.a.j = ((function () { var $ret = new RotateTransform(); $ret.j = (_this.a3.d1 * 180) / Math.PI; $ret.k = _this.a3.d4.x; $ret.l = (_this.a3.d4.y * a.height) + b; return $ret; })()); }; RadialAxisLabelPanelView.prototype.al = function () { _super.prototype.al.call(this); this.a.db(new Size(1, this.a.c6.width, this.a.c6.height)); }; RadialAxisLabelPanelView.$t = markType(RadialAxisLabelPanelView, 'RadialAxisLabelPanelView', HorizontalAxisLabelPanelBaseView.$); return RadialAxisLabelPanelView; }(HorizontalAxisLabelPanelBaseView)); export { RadialAxisLabelPanelView };