UNPKG

igniteui-webcomponents-charts

Version:

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

318 lines (317 loc) 11.4 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, __values } from "tslib"; import { AnnotationLayer } from "./AnnotationLayer"; import { CategoryAxisBase } from "./CategoryAxisBase"; import { DependencyProperty } from "igniteui-webcomponents-core"; import { CategoryHighlightLayerFrame } from "./CategoryHighlightLayerFrame"; import { Base, Number_$type, typeCast, fromEnum, Point_$type, markType, markDep, runOn } from "igniteui-webcomponents-core"; import { XamDataChart } from "./XamDataChart"; import { CategoryHighlightFrameRect } from "./CategoryHighlightFrameRect"; import { List$1 } from "igniteui-webcomponents-core"; import { Pool$1 } from "igniteui-webcomponents-core"; import { Rectangle } from "igniteui-webcomponents-core"; import { PropertyMetadata } from "igniteui-webcomponents-core"; import { isNaN_, truncate } from "igniteui-webcomponents-core"; import { AnnotationLayerView } from "./AnnotationLayerView"; import { BrushUtil } from "igniteui-webcomponents-core"; import { Color } from "igniteui-webcomponents-core"; /** * @hidden */ export var CategoryHighlightLayer = /** @class */ /*@__PURE__*/ (function (_super) { __extends(CategoryHighlightLayer, _super); function CategoryHighlightLayer() { var _this = _super.call(this) || this; var a = new CategoryHighlightLayerFrame(); var b = new CategoryHighlightLayerFrame(); var c = new CategoryHighlightLayerFrame(); var d = _this.km / 1000; _this.xx = a; _this.xw = b; _this.xy = c; _this.ab = CategoryHighlightLayer.$; return _this; } CategoryHighlightLayer.prototype.bk = function () { return new CategoryHighlightLayer(); }; CategoryHighlightLayer.prototype.get_eu = function () { return true; }; CategoryHighlightLayer.prototype.ct = function () { return new CategoryHighlightLayerView(this); }; CategoryHighlightLayer.prototype.rh = function (a) { _super.prototype.rh.call(this, a); this.aat = a; }; Object.defineProperty(CategoryHighlightLayer.prototype, "aaw", { get: function () { return this.c(CategoryHighlightLayer.aa3); }, set: function (a) { this.h(CategoryHighlightLayer.aa3, a); }, enumerable: false, configurable: true }); CategoryHighlightLayer.prototype.zc = function (a, b) { if (this.aas == null || this.aas == a) { if (!this.a1.c) { this.r8(b); } } }; CategoryHighlightLayer.prototype.aau = function (a) { return a != null && a.dx(); }; CategoryHighlightLayer.prototype.zf = function (a, b) { var e_1, _a; _super.prototype.zf.call(this, a, b); var c = a; c.j.clear(); var d = this.aav; if (isNaN_(this.aap.x) && isNaN_(this.aap.y)) { return; } if (this.aas != null) { if (this.aau(this.aas)) { this.aa1(this.aas, c, d); } } else { if (typeCast(XamDataChart.$, this.dc) !== null) { var e = this.dc; try { for (var _b = __values(fromEnum(e.zq)), _c = _b.next(); !_c.done; _c = _b.next()) { var f = _c.value; if (typeCast(CategoryAxisBase.$, f) !== null && this.aau(f)) { this.aa1(f, c, d); } } } 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; } } } } }; CategoryHighlightLayer.prototype.aa1 = function (a, b, c) { if (this.cw == null || this.cw.ca.isEmpty || this.cw.b9.isEmpty) { return; } var d = this.aap.x; if (a.dy && isNaN_(d)) { d = 0; } var e = this.w4(this.cw); d = e.left + e.width * (d - this.cw.ca.left) / this.cw.ca.width; var f = this.aap.y; if (!a.dy && isNaN_(f)) { f = 0; } f = e.top + e.height * (f - this.cw.ca.top) / this.cw.ca.height; var g = a.ra({ $type: Point_$type, x: d, y: f }, c, this.aaw); this.aa0(g, b, a); }; CategoryHighlightLayer.prototype.aa0 = function (a, b, c) { var d = new CategoryHighlightFrameRect(); d.b = a.left; d.e = a.top; d.c = a.right; d.a = a.bottom; d.g = this.aab(); d.h = this.aac(); if (d.g == null) { d.g = this.aat.cv(c.oe); } if (d.h == null) { d.h = this.aat.cv(c.oe); } d.d = this.il; d.f = Base.getHashCodeStatic(c); if (!a.isEmpty) { b.j.addItem(d.f, d); } }; CategoryHighlightLayer.prototype.zi = function (a, b) { var e_2, _a; _super.prototype.zi.call(this, a, b); var c = this.aat.co; var d = a; var e = 0; try { for (var _b = __values(fromEnum(d.j.values)), _c = _b.next(); !_c.done; _c = _b.next()) { var f = _c.value; var g = c.item(e); this.aa2(f, g); e++; } } 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; } } c.count = e; }; CategoryHighlightLayer.prototype.gg = function () { return true; }; CategoryHighlightLayer.prototype.aa2 = function (a, b) { if (isNaN_(a.b) || isNaN_(a.e) || isNaN_(a.a) || isNaN_(a.c) || isNaN_(a.d)) { b._visibility = 1; return; } this.aat.cq(b, a.b, a.e, a.c - a.b, a.a - a.e); b._fill = a.g; b._stroke = a.h; b.ad = a.d; if (this.wm != null) { b.ai = this.wm; } else { b.ai = null; } b.aj = this.wn; b.am = this.wp; b.al = this.wo; b.ak = this.wo; b.ac = this.jp; }; CategoryHighlightLayer.prototype.rq = function (a, b, c, d) { _super.prototype.rq.call(this, a, b, c, d); switch (b) { case CategoryHighlightLayer.$$p[0]: this.r8(true); break; case CategoryHighlightLayer.$$p[1]: this.r8(true); break; } }; CategoryHighlightLayer.$t = markType(CategoryHighlightLayer, 'CategoryHighlightLayer', AnnotationLayer.$); CategoryHighlightLayer.aa3 = DependencyProperty.i("BAndHighlightWidth", Number_$type, CategoryHighlightLayer.$, new PropertyMetadata(2, 10, function (a, b) { return a.raisePropertyChanged("BAndHighlightWidth", b.oldValue, b.newValue); })); CategoryHighlightLayer.$$p = markDep(DependencyProperty, PropertyMetadata, CategoryHighlightLayer, 'raisePropertyChanged', ['TargetAxis:aas:aa4', [CategoryAxisBase.$, null], 'UseInterpolation:aav:aa5', [0, false]]); return CategoryHighlightLayer; }(AnnotationLayer)); /** * @hidden */ export var CategoryHighlightLayerView = /** @class */ /*@__PURE__*/ (function (_super) { __extends(CategoryHighlightLayerView, _super); function CategoryHighlightLayerView(a) { var _this = _super.call(this, a) || this; _this.cn = null; _this.co = null; _this.cp = null; _this.cn = a; _this.cp = new List$1(Rectangle.$, 0); return _this; } CategoryHighlightLayerView.prototype.a4 = function () { var _this = this; _super.prototype.a4.call(this); this.co = ((function () { var $ret = new Pool$1(Rectangle.$); $ret.create = runOn(_this, _this.cw); $ret.activate = runOn(_this, _this.cr); $ret.disactivate = runOn(_this, _this.ct); $ret.destroy = runOn(_this, _this.cs); return $ret; })()); }; CategoryHighlightLayerView.prototype.cw = function () { var a = new Rectangle(); a.ab = false; this.cp.add(a); return a; }; CategoryHighlightLayerView.prototype.cr = function (a) { a._visibility = 0; }; CategoryHighlightLayerView.prototype.ct = function (a) { a._visibility = 1; }; CategoryHighlightLayerView.prototype.cs = function (a) { this.cp.remove(a); }; CategoryHighlightLayerView.prototype.cu = function (a) { if (a == null) { return a; } return BrushUtil.o(a, 0.1); }; CategoryHighlightLayerView.prototype.cv = function (a) { if (a != null) { var b = BrushUtil.o(a, 0.3); if (b.isGradient) { var c = b; if (c.gradientStops != null) { for (var d = 0; d < c.gradientStops.length; d++) { var e = c.gradientStops[d]; e.color = Color.u(truncate(Math.round((e.color.l) * 0.2)), e.color.o, e.color.n, e.color.m); e.color = e.color; } } } else { b.color = Color.u(truncate(Math.round((b.color.l) * 0.2)), b.color.o, b.color.n, b.color.m); b.color = b.color; } return b; } else { return null; } }; CategoryHighlightLayerView.prototype.cq = function (a, b, c, d, e) { a._visibility = 0; a.n = b; a.o = c; a.width = d; a.height = e; }; CategoryHighlightLayerView.prototype.bj = function (a, b) { _super.prototype.bj.call(this, a, b); if (a.d && !b) { for (var c = 0; c < this.cp.count; c++) { var d = this.cp._inner[c]; if (d._visibility == 0) { a.w(d); } } } }; CategoryHighlightLayerView.prototype.ax = function (a) { _super.prototype.ax.call(this, a); for (var b = 0; b < this.cp.count; b++) { this.f.bc.exportRectangleData(a, this.cp._inner[b], "cihRect", ["Main", "CategoryItem"]); } }; CategoryHighlightLayerView.$t = markType(CategoryHighlightLayerView, 'CategoryHighlightLayerView', AnnotationLayerView.$); return CategoryHighlightLayerView; }(AnnotationLayerView));