UNPKG

igniteui-angular-charts

Version:

Ignite UI Angular charting components for building rich data visualizations for modern web apps.

278 lines (277 loc) 9.77 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 { AnnotationLayer } from "./AnnotationLayer"; import { CategoryAxisBase } from "./CategoryAxisBase"; import { DependencyProperty } from "igniteui-angular-core"; import { CategoryHighlightLayerFrame } from "./CategoryHighlightLayerFrame"; import { Base, Number_$type, typeCast, fromEnum, Point_$type, markType, markDep, runOn } from "igniteui-angular-core"; import { XamDataChart } from "./XamDataChart"; import { CategoryHighlightFrameRect } from "./CategoryHighlightFrameRect"; import { List$1 } from "igniteui-angular-core"; import { Pool$1 } from "igniteui-angular-core"; import { Rectangle } from "igniteui-angular-core"; import { PropertyMetadata } from "igniteui-angular-core"; import { isNaN_, truncate } from "igniteui-angular-core"; import { AnnotationLayerView } from "./AnnotationLayerView"; import { BrushUtil } from "igniteui-angular-core"; import { Color } from "igniteui-angular-core"; /** * @hidden */ export let CategoryHighlightLayer = /*@__PURE__*/ (() => { class CategoryHighlightLayer extends AnnotationLayer { constructor() { super(); let a = new CategoryHighlightLayerFrame(); let b = new CategoryHighlightLayerFrame(); let c = new CategoryHighlightLayerFrame(); let d = this.kd / 1000; this.xc = a; this.xb = b; this.xd = c; this.ab = CategoryHighlightLayer.$; } bj() { return new CategoryHighlightLayer(); } get_er() { return true; } cs() { return new CategoryHighlightLayerView(this); } q1(a) { super.q1(a); this.zy = a; } get z1() { return this.c(CategoryHighlightLayer.z8); } set z1(a) { this.h(CategoryHighlightLayer.z8, a); } yo(a, b) { if (this.zx == null || this.zx == a) { if (!this.a1.c) { this.rr(b); } } } zz(a) { return a != null && a.co(); } yr(a, b) { super.yr(a, b); let c = a; c.g.clear(); let d = this.z0; if (isNaN_(this.zu.x) && isNaN_(this.zu.y)) { return; } if (this.zx != null) { if (this.zz(this.zx)) { this.z6(this.zx, c, d); } } else { if (typeCast(XamDataChart.$, this.db) !== null) { let e = this.db; for (let f of fromEnum(e.axes)) { if (typeCast(CategoryAxisBase.$, f) !== null && this.zz(f)) { this.z6(f, c, d); } } } } } z6(a, b, c) { if (this.cv == null || this.cv.by.isEmpty || this.cv.bx.isEmpty) { return; } let d = this.zu.x; if (a.cp && isNaN_(d)) { d = 0; } let e = this.wj(this.cv); d = e.left + e.width * (d - this.cv.by.left) / this.cv.by.width; let f = this.zu.y; if (!a.cp && isNaN_(f)) { f = 0; } f = e.top + e.height * (f - this.cv.by.top) / this.cv.by.height; let g = a.mj({ $type: Point_$type, x: d, y: f }, c, this.z1); this.z5(g, b, a); } z5(a, b, c) { let d = new CategoryHighlightFrameRect(); d.b = a.left; d.e = a.top; d.c = a.right; d.a = a.bottom; d.g = this.zk(); d.h = this.zl(); if (d.g == null) { d.g = this.zy.cf(c.jy); } if (d.h == null) { d.h = this.zy.cf(c.jy); } d.d = this.ie; d.f = Base.getHashCodeStatic(c); if (!a.isEmpty) { b.g.addItem(d.f, d); } } yu(a, b) { super.yu(a, b); let c = this.zy.b8; let d = a; let e = 0; for (let f of fromEnum(d.g.values)) { let g = c.item(e); this.z7(f, g); e++; } c.count = e; } ga() { return true; } z7(a, b) { if (isNaN_(a.b) || isNaN_(a.e) || isNaN_(a.a) || isNaN_(a.c) || isNaN_(a.d)) { b._visibility = 1; return; } this.zy.ca(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.v2 != null) { b.ai = this.v2; } else { b.ai = null; } b.aj = this.v3; b.am = this.v5; b.al = this.v4; b.ak = this.v4; b.ac = this.jh; } q9(a, b, c, d) { super.q9(a, b, c, d); switch (b) { case CategoryHighlightLayer.$$p[0]: this.rr(true); break; case CategoryHighlightLayer.$$p[1]: this.rr(true); break; } } } CategoryHighlightLayer.$t = markType(CategoryHighlightLayer, 'CategoryHighlightLayer', AnnotationLayer.$); CategoryHighlightLayer.z8 = DependencyProperty.i("BAndHighlightWidth", Number_$type, CategoryHighlightLayer.$, new PropertyMetadata(2, 10, (a, b) => a.raisePropertyChanged("BAndHighlightWidth", b.oldValue, b.newValue))); CategoryHighlightLayer.$$p = markDep(DependencyProperty, PropertyMetadata, CategoryHighlightLayer, 'raisePropertyChanged', ['TargetAxis:zx:z9', [CategoryAxisBase.$, null], 'UseInterpolation:z0:aaa', [0, false]]); return CategoryHighlightLayer; })(); /** * @hidden */ export let CategoryHighlightLayerView = /*@__PURE__*/ (() => { class CategoryHighlightLayerView extends AnnotationLayerView { constructor(a) { super(a); this.b7 = null; this.b8 = null; this.b9 = null; this.b7 = a; this.b9 = new List$1(Rectangle.$, 0); } au() { super.au(); this.b8 = ((() => { let $ret = new Pool$1(Rectangle.$); $ret.create = runOn(this, this.cg); $ret.activate = runOn(this, this.cb); $ret.disactivate = runOn(this, this.cd); $ret.destroy = runOn(this, this.cc); return $ret; })()); } cg() { let a = new Rectangle(); a.ab = false; this.b9.add(a); return a; } cb(a) { a._visibility = 0; } cd(a) { a._visibility = 1; } cc(a) { this.b9.remove(a); } ce(a) { if (a == null) { return a; } return BrushUtil.m(a, 0.1); } cf(a) { if (a != null) { let b = BrushUtil.m(a, 0.3); if (b.isGradient) { let c = b; if (c.gradientStops != null) { for (let d = 0; d < c.gradientStops.length; d++) { let 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; } } ca(a, b, c, d, e) { a._visibility = 0; a.n = b; a.o = c; a.width = d; a.height = e; } a8(a, b) { super.a8(a, b); if (a.d && !b) { for (let c = 0; c < this.b9.count; c++) { let d = this.b9._inner[c]; if (d._visibility == 0) { a.w(d); } } } } an(a) { super.an(a); for (let b = 0; b < this.b9.count; b++) { this.e.bc.exportRectangleData(a, this.b9._inner[b], "cihRect", ["Main", "CategoryItem"]); } } } CategoryHighlightLayerView.$t = markType(CategoryHighlightLayerView, 'CategoryHighlightLayerView', AnnotationLayerView.$); return CategoryHighlightLayerView; })();