UNPKG

igniteui-react-charts

Version:

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

112 lines (111 loc) 3.89 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 } from "tslib"; import { Base, Point_$type, markType } from "igniteui-react-core"; import { Size } from "igniteui-react-core"; import { ViewportUtils } from "./ViewportUtils"; /** * @hidden */ var SliceCoords = /** @class */ /*@__PURE__*/ (function (_super) { __extends(SliceCoords, _super); function SliceCoords() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.d = null; _this.f = null; _this.h = null; _this.j = null; _this.e = null; _this.g = null; _this.i = null; _this.k = null; _this.c = false; _this.n = new Size(); _this.m = new Size(); _this.l = new Size(); return _this; } SliceCoords.b = function (a, b, c, d, e, f, g, h) { var i = Math.min(d, e); var j = Math.max(d, e); var k = Math.cos(i); var l = Math.sin(i); var m = Math.max(0, f); var n = g; var o = h.x + k * m; var p = h.y + l * m; var q = h.x + k * n; var r = h.y + l * n; var s = Math.cos(j); var t = Math.sin(j); var u = h.x + s * m; var v = h.y + t * m; var w = h.x + s * n; var x = h.y + t * n; o = ViewportUtils.e(o, a, b, c); p = ViewportUtils.i(p, a, b, c); q = ViewportUtils.e(q, a, b, c); r = ViewportUtils.i(r, a, b, c); u = ViewportUtils.e(u, a, b, c); v = ViewportUtils.i(v, a, b, c); w = ViewportUtils.e(w, a, b, c); x = ViewportUtils.i(x, a, b, c); var y = { $type: Point_$type, x: o, y: p }; var z = { $type: Point_$type, x: q, y: r }; var aa = { $type: Point_$type, x: w, y: x }; var ab = { $type: Point_$type, x: u, y: v }; var ac = ViewportUtils.d(n, a, b, c); var ad = ViewportUtils.h(n, a, b, c); var ae = ViewportUtils.d(m, a, b, c); var af = ViewportUtils.h(m, a, b, c); return ((function () { var $ret = new SliceCoords(); $ret.d = y; $ret.f = z; $ret.h = aa; $ret.j = ab; $ret.c = ((j - i) > Math.PI); $ret.n = new Size(1, ac, ad); $ret.m = new Size(1, ae, af); return $ret; })()); }; SliceCoords.a = function (a, b, c, d, e, f, g, h, i, j) { var k = ViewportUtils.a(j, a, b, c); var l = g - f; if (l < 0) { return null; } if (ViewportUtils.d(l, a, b, c) < 2) { return null; } if (k * 2 > l) { k = l / 2; j = ViewportUtils.d(k, a, b, c); } var m = ViewportUtils.a(i, a, b, c); var n = m / (g - k); var o = Math.atan(n); if (o * 2 > Math.abs(e - d)) { o = Math.abs(e - d) / 2; i = ViewportUtils.d(Math.tan(o) * (g - k), a, b, c); } var p = SliceCoords.b(a, b, c, d + o, e - o, f, g, h); var q = SliceCoords.b(a, b, c, d, e, f + (k * (f / g)), g - k, h); p.g = p.f; p.k = p.j; p.e = q.d; p.f = q.f; p.i = q.h; p.j = q.j; p.l = new Size(1, i, j); return p; }; SliceCoords.$t = markType(SliceCoords, 'SliceCoords'); return SliceCoords; }(Base)); export { SliceCoords };