UNPKG

igniteui-react-charts

Version:

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

147 lines (146 loc) 4.8 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 { Base, markType } from "igniteui-react-core"; import { Thickness } from "igniteui-react-core"; import { Size } from "igniteui-react-core"; import { CalloutLayout } from "./CalloutLayout"; import { isInfinity, isNaN_ } from "igniteui-react-core"; /** * @hidden */ export let CalloutViewHelper = /*@__PURE__*/ (() => { class CalloutViewHelper extends Base { static c(a, b, c, d, e, f, g, h) { let i = Math.sqrt((c - a) * (c - a) + (d - b) * (d - b)); let j = (c - a) / i; let k = (d - b) / i; let l = a - e; let m = b - f; let n = g - e; let o = h - f; let p = -k; let q = j; let r = n * p + o * q; let s = n * m - o * l; let t = l * p + m * q; let u = s / r; let v = t / r; if (u >= 0 && v >= 0 && v <= 1) { return u; } return Number.POSITIVE_INFINITY; } static e(a, b, c, d) { let e = a.x; let f = a.y; let g = 0; let h = 0; let i = 0; let j = 0; let k = 0; let l = 0; if (e < 0) { g = -e; k = g; e = 0; } if (f < 0) { h = -f; l = h; f = 0; } if (e > b) { i = e - b; } if (f > c) { j = f - c; } let m = new Thickness(1, g, h, i, j); let n = CalloutViewHelper.c(e, f, k + b / 2, l + c / 2, k, l, k, l + c); let o = CalloutViewHelper.c(e, f, k + b / 2, l + c / 2, k, l, k + b, l); let p = CalloutViewHelper.c(e, f, k + b / 2, l + c / 2, k, l + c, k + b, l + c); let q = CalloutViewHelper.c(e, f, k + b / 2, l + c / 2, k + b, l, k + b, l + c); let r = Math.min(n, Math.min(o, Math.min(p, q))); let s = 0; let t = 0; if (isInfinity(r)) { s = e; t = f; } else { let u = k + b / 2; let v = l + c / 2; let w = e; let x = f; let y = Math.sqrt((u - w) * (u - w) + (v - x) * (v - x)); let z = (u - w) / y; let aa = (v - x) / y; s = w + z * r; t = x + aa * r; } d.an = e; d.ap = f; d.ao = s; d.aq = t; return m; } static b(a, b, c, d) { return a && b > 0 && c > 0; } static d(a, b, c, d, e, f, g) { let h = 0; let i = 0; let j = d; let k = e; if (a != null) { h = a.top + a.bottom; i = a.left + a.right; } if (g && d > 0 && e > 0) { if (!isNaN_(f)) { j = d + f; } } else { j = 0; k = 0; } let l = i + b + j; let m = h + Math.max(c, k); return new Size(1, l, m); } static a(a, b, c, d, e, f, g) { let h = new CalloutLayout(); h.f = CalloutViewHelper.d(a, b, c, d, e, f, g); if (g && d > 0 && e > 0) { h.a = true; if (c > e) { h.d = a.left + d + f; h.e = a.top; h.b = a.left; h.c = (h.f.height / 2) - (e / 2); } else { h.d = a.left + d + f; h.e = (h.f.height / 2) - (c / 2); h.b = a.left; h.c = a.top; } } else { h.d = a.left; h.e = a.top; h.b = 0; h.c = 0; h.a = false; } return h; } } CalloutViewHelper.$t = /*@__PURE__*/ markType(CalloutViewHelper, 'CalloutViewHelper'); return CalloutViewHelper; })();