igniteui-angular-charts
Version:
Ignite UI Angular charting components for building rich data visualizations for modern web apps.
133 lines (132 loc) • 4.89 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 { __extends } from "tslib";
import { Base, Point_$type, markType } from "igniteui-angular-core";
import { IHorizontalAnchoredCategorySeriesInteractionManager_$type } from "./IHorizontalAnchoredCategorySeriesInteractionManager";
import { Rect } from "igniteui-angular-core";
import { ArrayExtension } from "igniteui-angular-core";
import { isNaN_ } from "igniteui-angular-core";
/**
* @hidden
*/
var HorizontalAnchoredCategorySeriesInteractionManager = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(HorizontalAnchoredCategorySeriesInteractionManager, _super);
function HorizontalAnchoredCategorySeriesInteractionManager() {
return _super !== null && _super.apply(this, arguments) || this;
}
HorizontalAnchoredCategorySeriesInteractionManager.prototype.d$a = function (a, b, c, d, e) {
var f = a.an(a.a0(), b, c, d, a.wg(e), true);
if (f == null) {
return null;
}
var g = f[0];
var h = f[1];
var i = new Array(1);
var j = new Array(2);
j[0] = { $type: Point_$type, x: g[0], y: g[2] };
j[1] = { $type: Point_$type, x: h[0], y: h[2] };
i[0] = j;
return i;
};
HorizontalAnchoredCategorySeriesInteractionManager.prototype.d$b = function (a, b, c, d, e) {
var f = a.an(a.a0(), b, c, d, a.wg(e), true);
if (f == null) {
return null;
}
var g = f[0];
var h = f[1];
var i = new Array(1);
var j = new Array(2);
j[0] = { $type: Point_$type, x: g[0], y: g[1] };
j[1] = { $type: Point_$type, x: h[0], y: h[1] };
i[0] = j;
return i;
};
HorizontalAnchoredCategorySeriesInteractionManager.prototype.d$d = function (a, b, c, d) {
if (b == null || b.count == 0) {
return Rect.empty;
}
var e = a.v6(c);
var f = -1;
var g = a.a0();
var h = g.ch;
var i = a.cv.bx.right * 2;
if (h) {
f = ArrayExtension.binarySearch$11(Point_$type, b, function (j) { return (i - e.x) < (i - j.x) ? -1 : ((i - e.x) > (i - j.x) ? 1 : 0); });
}
else {
f = ArrayExtension.binarySearch$11(Point_$type, b, function (j) { return e.x < j.x ? -1 : (e.x > j.x ? 1 : 0); });
}
if (f < 0) {
f = ~f;
}
if (f < 0) {
f = 0;
}
if (f > b.count - 1) {
f = b.count - 1;
}
var j = f;
var k = f;
if (j > 0) {
j--;
}
if (k < b.count - 1) {
k++;
}
var l = b._inner[j].x;
var m = b._inner[f].x;
var n = b._inner[k].x;
var o = Math.abs(l - e.x);
var p = Math.abs(m - e.x);
var q = Math.abs(n - e.x);
var r = d(j);
var s = d(f);
var t = d(k);
var u = r.containsPoint(e);
var v = s.containsPoint(e);
var w = t.containsPoint(e);
if (p <= o && p <= q) {
if (!h && w) {
return t;
}
if (h && u) {
return r;
}
return s;
}
if (o <= p && o <= q) {
if (!h && v) {
return s;
}
return d(j);
}
if (q <= p && q <= o) {
if (h && v) {
return s;
}
return d(k);
}
return Rect.empty;
};
HorizontalAnchoredCategorySeriesInteractionManager.prototype.d$c = function (a, b, c, d, e) {
if (isNaN_(d.x) || isNaN_(d.y)) {
return false;
}
var f = 0;
if (b != null) {
f = b.e6(b.me);
}
if ((c.y >= f && c.y <= d.y) || (c.y <= f && c.y >= d.y)) {
return true;
}
return false;
};
HorizontalAnchoredCategorySeriesInteractionManager.$t = markType(HorizontalAnchoredCategorySeriesInteractionManager, 'HorizontalAnchoredCategorySeriesInteractionManager', Base.$, [IHorizontalAnchoredCategorySeriesInteractionManager_$type]);
return HorizontalAnchoredCategorySeriesInteractionManager;
}(Base));
export { HorizontalAnchoredCategorySeriesInteractionManager };