igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
110 lines (109 loc) • 4.06 kB
JavaScript
/*
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 { Base, Point_$type, markType } from "igniteui-react-core";
import { Size } from "igniteui-react-core";
import { ViewportUtils } from "./ViewportUtils";
/**
* @hidden
*/
export let SliceCoords = /*@__PURE__*/ (() => {
class SliceCoords extends Base {
constructor() {
super(...arguments);
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();
}
static b(a, b, c, d, e, f, g, h) {
let i = Math.min(d, e);
let j = Math.max(d, e);
let k = Math.cos(i);
let l = Math.sin(i);
let m = Math.max(0, f);
let n = g;
let o = h.x + k * m;
let p = h.y + l * m;
let q = h.x + k * n;
let r = h.y + l * n;
let s = Math.cos(j);
let t = Math.sin(j);
let u = h.x + s * m;
let v = h.y + t * m;
let w = h.x + s * n;
let 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);
let y = { $type: Point_$type, x: o, y: p };
let z = { $type: Point_$type, x: q, y: r };
let aa = { $type: Point_$type, x: w, y: x };
let ab = { $type: Point_$type, x: u, y: v };
let ac = ViewportUtils.d(n, a, b, c);
let ad = ViewportUtils.h(n, a, b, c);
let ae = ViewportUtils.d(m, a, b, c);
let af = ViewportUtils.h(m, a, b, c);
return ((() => {
let $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;
})());
}
static a(a, b, c, d, e, f, g, h, i, j) {
let k = ViewportUtils.a(j, a, b, c);
let 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);
}
let m = ViewportUtils.a(i, a, b, c);
let n = m / (g - k);
let 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);
}
let p = SliceCoords.b(a, b, c, d + o, e - o, f, g, h);
let 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 = /*@__PURE__*/ markType(SliceCoords, 'SliceCoords');
return SliceCoords;
})();