UNPKG

igniteui-angular-charts

Version:

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

1,588 lines 94 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, INotifyPropertyChanged_$type, PropertyChangedEventArgs, Array_$type, enumGetBox, EnumUtil, typeGetValue, Number_$type, String_$type, fromEnum, typeCast, Date_$type, markDep, runOn, TypeRegistrar } from "igniteui-angular-core"; import { List$1 } from "igniteui-angular-core"; import { DataAbbreviationMode_$type } from "igniteui-angular-core"; import { Brush } from "igniteui-angular-core"; import { FontInfo } from "igniteui-angular-core"; import { Thickness } from "igniteui-angular-core"; import { Size } from "igniteui-angular-core"; import { Rect } from "igniteui-angular-core"; import { stringIsNullOrEmpty, stringEmpty, stringContains } from "igniteui-angular-core"; import { DataLegendSeriesContext } from "igniteui-angular-core"; import { LegendItemBadgeShape_$type } from "igniteui-angular-core"; import { Control } from "igniteui-angular-core"; import { IDataLegend_$type } from "igniteui-angular-core"; import { IOnDemandRender_$type } from "igniteui-angular-core"; import { DependencyProperty } from "igniteui-angular-core"; import { DataLegendValueMode_$type } from "igniteui-angular-core"; import { FontUtil } from "igniteui-angular-core"; import { DataLegendHeaderDateMode_$type } from "igniteui-angular-core"; import { DataLegendHeaderTimeMode_$type } from "igniteui-angular-core"; import { DataLegendSummaryType_$type } from "igniteui-angular-core"; import { DataLegendUnitsMode_$type } from "igniteui-angular-core"; import { DataLegendLabelMode_$type } from "igniteui-angular-core"; import { DataLegendLayoutMode_$type } from "igniteui-angular-core"; import { BindingFormatter } from "igniteui-angular-core"; import { DataLegendVisualData } from "./DataLegendVisualData"; import { Extensions } from "igniteui-angular-core"; import { TextBlock } from "igniteui-angular-core"; import { DataLegendVisualDataRow } from "./DataLegendVisualDataRow"; import { DataLegendVisualDataColumn } from "./DataLegendVisualDataColumn"; import { ILegendContext_$type } from "igniteui-angular-core"; import { AppearanceHelper } from "igniteui-angular-core"; import { RectData } from "igniteui-angular-core"; import { PrimitiveAppearanceData } from "igniteui-angular-core"; import { FrameworkElement } from "igniteui-angular-core"; import { DataLegendSummaryEventArgs } from "./DataLegendSummaryEventArgs"; import { DataLegendSummaryCalculationTotal } from "./DataLegendSummaryCalculationTotal"; import { DataLegendSummaryCalculationAverage } from "./DataLegendSummaryCalculationAverage"; import { DataLegendSummaryCalculationMin } from "./DataLegendSummaryCalculationMin"; import { DataLegendSummaryCalculationMax } from "./DataLegendSummaryCalculationMax"; import { DataLegendSummaryCalculationEmpty } from "./DataLegendSummaryCalculationEmpty"; import { DataLegendStylingRowEventArgs } from "./DataLegendStylingRowEventArgs"; import { DataLegendStylingColumnEventArgs } from "./DataLegendStylingColumnEventArgs"; import { Dictionary$2 } from "igniteui-angular-core"; import { IDataLegendSeries_$type } from "igniteui-angular-core"; import { BrushUtil } from "igniteui-angular-core"; import { DataLegendSeriesGroupInfo } from "./DataLegendSeriesGroupInfo"; import { RenderingContext } from "igniteui-angular-core"; import { DataLegendRenderContext } from "./DataLegendRenderContext"; import { Pool$1 } from "igniteui-angular-core"; import { ContentControl } from "igniteui-angular-core"; import { DataLegendSeriesValueInfo } from "igniteui-angular-core"; import { DataLegendColumn } from "./DataLegendColumn"; import { DataLegendSummaryColumn } from "igniteui-angular-core"; import { DataAbbreviator } from "./DataAbbreviator"; import { NumberFormatSpecifier } from "igniteui-angular-core"; import { LegendBadgeDefaults } from "igniteui-angular-core"; import { DateTimeFormatSpecifier } from "igniteui-angular-core"; import { PropertyMetadata } from "igniteui-angular-core"; import { isNaN_, isInfinity, truncate } from "igniteui-angular-core"; import { EventProxy } from "igniteui-angular-core"; import { Tuple$2 } from "igniteui-angular-core"; import { CanvasScalingHelpers } from "igniteui-angular-core"; import { CanvasViewRenderer } from "igniteui-angular-core"; import { DataTemplatePassInfo } from "igniteui-angular-core"; import { Rectangle } from "igniteui-angular-core"; import { DataTemplateMeasureInfo } from "igniteui-angular-core"; import { DataTemplateRenderInfo } from "igniteui-angular-core"; import { FontDefaults } from "igniteui-angular-core"; /** * @hidden */ export class DataLegendContent extends Base { constructor() { super(...arguments); this.a = new List$1(DataLegendRowInfo.$, 0); this.d = 0; this.c = 0; } static { this.$t = markType(DataLegendContent, 'DataLegendContent'); } get b() { return this.a; } f() { this.b.clear(); } e(a) { this.b.add(a); } } /** * @hidden */ export class DataLegendRowBase extends Base { static { this.$t = markType(DataLegendRowBase, 'DataLegendRowBase'); } constructor(a, b, c, d, e) { super(); this.g = 0; this.c = false; this.e = false; this.a = false; this.b = false; this.d = false; this.f = false; this.g = e; this.e = b; this.b = c; this.a = d; this.d = !c && !b && !d; this.c = true; this.f = false; } } /** * @hidden */ export class DataLegendRowCell extends DataLegendRowBase { static { this.$t = markType(DataLegendRowCell, 'DataLegendRowCell', DataLegendRowBase.$); } constructor(a, b, c, d, e) { super(a, b, c, d, e); this.u = 0; this.h = 0; this.t = 0; this.y = null; this.x = null; this.v = null; this.z = null; this.w = null; this.ab = null; this.ac = null; this.ad = null; this.i = null; this.k = null; this.j = null; this.an = null; this.ap = null; this.ao = null; this.ai = new Size(); this.am = new Size(); this.ak = new Size(); this.o = false; this.l = false; this.ae = null; this.ag = null; this.af = null; this.ah = new Size(); this.al = new Size(); this.aj = new Size(); this.t = NaN; this.an = new Thickness(0, 0); this.ap = new Thickness(0, 0); this.ao = new Thickness(0, 0); this.ai = new Size(1, 0, 0); this.am = new Size(1, 0, 0); this.ak = new Size(1, 0, 0); this.o = true; this.l = true; if (this.d) { this.ab = a.bw(); this.ad = a.by(); this.ac = a.bx(); this.i = a.l(); this.k = a.p(); this.j = a.o(); } else if (this.e) { let f = a.bv(); let g = a.m(); this.ab = f; this.ad = f; this.ac = f; this.i = g; this.k = g; this.j = g; } else if (this.a) { let h = a.bs(); let i = a.j(); this.ab = h; this.ad = h; this.ac = h; this.i = i; this.k = i; this.j = i; } else { let j = a.bt(); let k = a.k(); this.ab = j; this.ad = j; this.ac = j; this.i = k; this.k = k; this.j = k; } this.ae = Rect.empty; this.ag = Rect.empty; this.af = Rect.empty; } m() { return this.ai.width > 0 && this.ai.height > 0; } p() { return this.ak.width > 0 && this.ak.height > 0; } r() { return this.am.width > 0 && this.am.height > 0; } n() { return this.v != null; } q() { return this.w != null; } s() { return !stringIsNullOrEmpty(this.z) && this.am.width > 0 && this.am.height > 0; } aa() { this.ah = new Size(1, 0, 0); this.al = new Size(1, 0, 0); this.aj = new Size(1, 0, 0); } } /** * @hidden */ export class DataLegendRowInfo extends DataLegendRowBase { static { this.$t = markType(DataLegendRowInfo, 'DataLegendRowInfo', DataLegendRowBase.$); } u(a) { if (this.m == null) { return; } for (let b = 0; b < this.m.count; b++) { a(this.m._inner[b]); } } constructor(a, b, c, d, e) { super(a, b, c, d, e); this.m = null; this.o = 0; this.n = 0; this.l = false; this.s = null; this.h = null; this.i = null; this.t = null; this.w = null; this.k = null; this.aa = new Size(); this.ad = null; this.r = null; this.v = null; this.z = new Size(); this.p = null; this.j = 0; this.q = null; this.ac = null; this.ab = null; this.x = null; this.y = null; this.h = new Array(0); this.m = new List$1(DataLegendRowCell.$, 0); this.l = this.d; this.ac = new Thickness(0, 0); this.ab = new Thickness(0, 0); this.ad = new Thickness(0, 0); this.z = new Size(1, 0, 0); this.aa = new Size(1, 0, 0); if (this.d) { this.w = a.bw(); this.k = a.n(); } else if (this.e) { let f = a.bv(); let g = a.m(); this.w = f; this.k = g; } else if (this.a) { let h = a.bs(); let i = a.j(); this.w = h; this.k = i; } else { let j = a.bt(); let k = a.k(); this.w = j; this.k = k; } this.y = Rect.empty; this.x = Rect.empty; this.j = 7; this.q = "None"; } } /** * @hidden */ export class XamDataLegend extends Control { static { this.$t = markType(XamDataLegend, 'XamDataLegend', Control.$, [INotifyPropertyChanged_$type, IDataLegend_$type, IOnDemandRender_$type]); } get cr() { return this.cn; } set cr(a) { let b = this.cn; this.cn = a; if (b != this.cn) { this.gj("ActualCursorPositionX", b, this.cn); } } get cs() { return this.co; } set cs(a) { let b = this.co; this.co = a; if (b != this.co) { this.gj("ActualCursorPositionY", b, this.co); } } get ct() { return this.cp; } set ct(a) { let b = this.cp; this.cp = a; this.gj("ActualPixelScalingRatio", b, this.cp); } gw() { if (isNaN_(this.cw)) { this.js = this.ju; } else { if (this.cw > 0) { this.js = new Thickness(0, this.cw); } else { this.js = this.ju; } } } gv() { if (this.i8 == null) { this.i6 = this.ja; } else { this.i6 = this.i8; } } gu() { if (this.i7 == null) { this.i5 = this.i9; } else { this.i5 = this.i7; } } get bx() { return this.bm; } set bx(a) { let b = this.bm; if (typeof a === 'string') { a = FontUtil.getFontInfoFromString(this.a7.al, a); } else if (a == null || a.c()) { a = this.a7.p(); } this.bm = a; if (b != this.bm) { this.gj("ValueTextStyle", b, this.bm); } } get bp() { return this.be; } set bp(a) { let b = this.be; if (typeof a === 'string') { a = FontUtil.getFontInfoFromString(this.a7.al, a); } else if (a == null || a.c()) { a = this.a7.k(); } this.be = a; if (b != this.be) { this.gj("HeaderTextStyle", b, this.be); } } get bo() { return this.bd; } set bo(a) { let b = this.bd; if (typeof a === 'string') { a = FontUtil.getFontInfoFromString(this.a7.al, a); } else if (a == null || a.c()) { a = this.a7.j(); } this.bd = a; if (b != this.bd) { this.gj("GroupTextStyle", b, this.bd); } } get bs() { return this.bh; } set bs(a) { let b = this.bh; if (typeof a === 'string') { a = FontUtil.getFontInfoFromString(this.a7.al, a); } else if (a == null || a.c()) { a = this.a7.m(); } this.bh = a; if (b != this.bh) { this.gj("SummaryTitleTextStyle", b, this.bh); } } get bu() { return this.bj; } set bu(a) { let b = this.bj; if (typeof a === 'string') { a = FontUtil.getFontInfoFromString(this.a7.al, a); } else if (a == null || a.c()) { a = this.a7.p(); } this.bj = a; if (b != this.bj) { this.gj("SummaryValueTextStyle", b, this.bj); } } get br() { return this.bg; } set br(a) { let b = this.bg; if (typeof a === 'string') { a = FontUtil.getFontInfoFromString(this.a7.al, a); } else if (a == null || a.c()) { a = this.a7.l(); } this.bg = a; if (b != this.bg) { this.gj("SummaryLabelTextStyle", b, this.bg); } } get bt() { return this.bi; } set bt(a) { let b = this.bi; if (typeof a === 'string') { a = FontUtil.getFontInfoFromString(this.a7.al, a); } else if (a == null || a.c()) { a = this.a7.o(); } this.bi = a; if (b != this.bi) { this.gj("SummaryUnitsTextStyle", b, this.bi); } } get bw() { return this.bl; } set bw(a) { let b = this.bl; if (typeof a === 'string') { a = FontUtil.getFontInfoFromString(this.a7.al, a); } else if (a == null || a.c()) { a = this.a7.o(); } this.bl = a; if (b != this.bl) { this.gj("UnitsTextStyle", b, this.bl); } } get bv() { return this.bk; } set bv(a) { let b = this.bk; if (typeof a === 'string') { a = FontUtil.getFontInfoFromString(this.a7.al, a); } else if (a == null || a.c()) { a = this.a7.n(); } this.bk = a; if (b != this.bk) { this.gj("TitleTextStyle", b, this.bk); } } get bq() { return this.bf; } set bq(a) { let b = this.bf; if (typeof a === 'string') { a = FontUtil.getFontInfoFromString(this.a7.al, a); } else if (a == null || a.c()) { a = this.a7.l(); } this.bf = a; if (b != this.bf) { this.gj("LabelTextStyle", b, this.bf); } } get pixelScalingRatio() { return this.cq; } set pixelScalingRatio(a) { let b = this.cq; this.cq = a; this.gj("PixelScalingRatio", b, this.cq); } exportSerializedVisualData() { let a = this.exportVisualData(); return a.serialize(); } cv(a, b) { let c = Math.max(b.left, a); let d = Math.max(b.right, a); let e = Math.max(b.right, a); return Math.min(b.top, a); } cu(a, b) { return Math.min(b.left, a); } jm(a, b) { let c = Rect.l_op_Equality(a, null) || a.isEmpty || !Extensions.b(a); let d = Rect.l_op_Equality(b, null) || b.isEmpty || !Extensions.b(b); if (c) { return b; } if (d) { return a; } if (c && c) { return Rect.empty; } let e = Math.min(a.top, b.top); let f = Math.min(a.left, b.left); let g = Math.max(a.right, b.right); let h = Math.max(a.bottom, b.bottom); return new Rect(0, f, e, g - f, h - e); } exportVisualData() { let a = new DataLegendVisualData(); a.width = this.ao.d; a.height = this.ao.c; a.background = AppearanceHelper.b(this.i5); a.borderBrush = AppearanceHelper.b(this.i6); if (this.js != null) { a.borderThicknessTop = this.js.top; a.borderThicknessLeft = this.js.left; a.borderThicknessRight = this.js.right; a.borderThicknessBottom = this.js.bottom; } if (this.a7 == null) { return a; } let b = -1; let c = -1; let d = -1; let e = -1; let f = this.a7.af; let g = this.a7.ad; let h = this.a7.ah; let i = this.a7.ag; if (Rect.l_op_Equality(this.jn, null) || this.jn.isEmpty) { a.viewport = null; } else { a.viewport = new RectData(0, 0, this.jn.width, this.jn.height); } for (let j = 0; j < this.ao.b.count; j++) { let k = this.ao.b._inner[j]; let l = new DataLegendVisualDataRow(); l.seriesIndex = k.g; l.rowMarginTop = k.ac.top; l.rowMarginBottom = k.ac.bottom; l.rowMarginRight = k.ac.right; l.rowMarginLeft = k.ac.left; let m = Rect.empty; if (k.c) { if (Extensions.b(k.y) && f.count > (b + 1)) { b++; let n = f._inner[b]; let o = this.bn(n, k.k); let p = new DataLegendVisualDataColumn(); p.bounds = RectData.b(k.y); p.text = n.al; p.textColor = AppearanceHelper.b(k.w); p.marginTop = k.ad.top; p.marginLeft = k.ad.left; p.marginRight = k.ad.right; p.marginBottom = k.ad.bottom; this.gx(p, o); l.columns.add(p); m = this.jm(m, k.y); } for (let q of fromEnum(k.m)) { if (Extensions.b(q.ae) && g.count > (c + 1)) { c++; let r = g._inner[c]; let s = this.bn(r, q.i); let t = new DataLegendVisualDataColumn(); t.bounds = RectData.b(q.ae); t.text = r.al; t.textColor = AppearanceHelper.b(q.ab); t.marginTop = q.an.top; t.marginLeft = q.an.left; t.marginRight = q.an.right; t.marginBottom = q.an.bottom; this.gx(t, s); l.columns.add(t); m = this.jm(m, q.ae); } if (Extensions.b(q.ag) && h.count > (d + 1)) { d++; let u = h._inner[d]; let v = this.bn(u, q.k); let w = new DataLegendVisualDataColumn(); w.bounds = RectData.b(q.ag); w.text = u.al; w.textColor = AppearanceHelper.b(q.ad); w.marginTop = q.ap.top; w.marginLeft = q.ap.left; w.marginRight = q.ap.right; w.marginBottom = q.ap.bottom; this.gx(w, v); l.columns.add(w); m = this.jm(m, q.ag); } if (Extensions.b(q.af) && i.count > (e + 1)) { e++; let x = i._inner[e]; let y = this.bn(x, q.j); let z = new DataLegendVisualDataColumn(); z.bounds = RectData.b(q.af); z.text = q.o ? q.w : null; z.textColor = AppearanceHelper.b(q.ac); z.marginTop = q.ao.top; z.marginLeft = q.ao.left; z.marginRight = q.ao.right; z.marginBottom = q.ao.bottom; this.gx(z, y); l.columns.add(z); m = this.jm(m, q.af); } } if (k.l) { m = this.jm(m, k.x); l.badgeBounds = RectData.b(k.x); l.badgeMarkerWidth = k.o; l.badgeMarkerHeight = k.n; l.badgeMarginTop = k.ab.top; l.badgeMarginBottom = k.ab.bottom; l.badgeMarginRight = k.ab.right; l.badgeMarginLeft = k.ab.left; l.badgeAppearance = new PrimitiveAppearanceData(); let aa = typeCast(ILegendContext_$type, k.p); let ab = typeCast(ILegendContext_$type, k.i); l.badgeAppearance.fill = AppearanceHelper.b(aa.actualItemBrush != null ? aa.actualItemBrush : aa.itemBrush); l.badgeAppearance.stroke = AppearanceHelper.b(aa.outline); l.badgeShape = k.q; } l.rowBounds = RectData.b(m); } a.rows.add(l); } return a; } gx(a, b) { if (b != null) { if (b.q != null) { a.fontFamily = b.q; } if (!isNaN_(b.f)) { a.fontSize = b.f; } a.fontWeight = stringIsNullOrEmpty(b.v) ? "Normal" : b.v; a.fontStyle = stringIsNullOrEmpty(b.t) ? "Normal" : b.t; if (b.r != null) { a.fontStretch = b.t; } } } bn(a, b) { let c = a.dataContext; if (c != null) { b = a.dataContext; } if (b == null || stringIsNullOrEmpty(b.fontString)) { return b; } else { return FontUtil.toFontInfo(this.a7.al, b.fontString); } } a2(a) { if (this.calculateColumnSummary != null) { let b = new DataLegendSummaryEventArgs(a.a, a.d); b.summaryValue = a.c; this.calculateColumnSummary(this, b); a.c = b.summaryValue; a.f = b.summaryUnits; a.e = b.summaryLabel; } return a; } a8() { switch (this.a3) { case 0: case 1: return new DataLegendSummaryCalculationTotal(); case 2: return new DataLegendSummaryCalculationAverage(); case 3: return new DataLegendSummaryCalculationMin(); case 4: return new DataLegendSummaryCalculationMax(); case 5: return new DataLegendSummaryCalculationEmpty(); default: return new DataLegendSummaryCalculationEmpty(); } } g2(a) { if (this.styleSummaryRow != null) { let b = this.a0(a); this.styleSummaryRow(this, b); this.gy(a, b); } if (a.c && a.m != null && this.styleSummaryColumn != null) { for (let c = 0; c < a.m.count; c++) { let d = this.az(a.m._inner[c]); d.d = a.g; d.g = a.s; d.c = c; d.e = a.r; this.styleSummaryColumn(this, d); this.g3(a.m._inner[c], d); } } } g1(a) { if (this.styleSeriesRow != null) { let b = this.a0(a); this.styleSeriesRow(this, b); this.gy(a, b); } if (a.c && a.m != null && this.styleSeriesColumn != null) { for (let c = 0; c < a.m.count; c++) { let d = this.az(a.m._inner[c]); d.d = a.g; d.g = a.s; d.c = c; d.e = a.r; this.styleSeriesColumn(this, d); this.g3(a.m._inner[c], d); } } } g0(a) { if (this.styleHeaderRow != null) { let b = this.a0(a); this.styleHeaderRow(this, b); this.gy(a, b); } } gz(a) { if (this.styleGroupRow != null) { let b = this.a0(a); this.styleGroupRow(this, b); this.gy(a, b); } } a0(a) { let b = new DataLegendStylingRowEventArgs(); b.g = a.t; b.h = a.w; b.e = a.r; b.a = a.j; b.b = a.l; b.c = a.c; b.d = a.g; b.f = a.s; return b; } gy(a, b) { a.t = b.g; a.w = b.h; a.j = b.a; a.l = b.b; a.c = b.c; } az(a) { let b = new DataLegendStylingColumnEventArgs(); b.f = a.v; b.l = a.ab; b.h = a.w; b.m = a.ac; b.k = a.z; b.n = a.ad; b.b = a.t; b.j = a.y; b.i = a.x; b.a = a.h; return b; } g3(a, b) { a.ab = b.l; a.v = b.f; a.l = !stringIsNullOrEmpty(a.v); a.w = b.h; a.ac = b.m; a.o = !stringIsNullOrEmpty(a.w); a.z = b.k; a.ad = b.n; } gn(a, b, c) { switch (a) { case XamDataLegend.$$p[5]: this.gu(); break; case XamDataLegend.$$p[6]: this.gw(); this.gv(); break; case XamDataLegend.$$p[7]: this.gw(); break; case XamDataLegend.$$p[31]: this.b1 = c; break; case XamDataLegend.$$p[25]: case XamDataLegend.$$p[9]: this.g7(); break; case XamDataLegend.$$p[24]: case XamDataLegend.$$p[8]: this.g6(); break; case XamDataLegend.$$p[44]: let d = c; let e = b; this.gk(e, d); break; case XamDataLegend.$$p[42]: if (this.b6(this.targetCursorPositionX)) { this.cr = this.targetCursorPositionX; } break; case XamDataLegend.$$p[43]: if (this.b6(this.targetCursorPositionY)) { this.cs = this.targetCursorPositionY; } break; case XamDataLegend.$$p[58]: case XamDataLegend.$$p[57]: if (!stringIsNullOrEmpty(this.fo)) { this.ak = ((() => { let $ret = new BindingFormatter(); $ret.j = this.fo; $ret.d = this.ah; return $ret; })()); } else { this.ak = null; } break; case XamDataLegend.$$p[17]: case XamDataLegend.$$p[16]: if (!stringIsNullOrEmpty(this.dv)) { this.ai = ((() => { let $ret = new BindingFormatter(); $ret.j = this.dv; $ret.d = this.ag; return $ret; })()); } else { this.ai = null; } break; case "PixelScalingRatio": if (isNaN_(this.ct)) { this.a7.ay(); } else { this.ct = this.pixelScalingRatio; } break; case "ActualPixelScalingRatio": this.a7.a9(c); break; } this.gp(); } gj(a, b, c) { this.gn(a, b, c); if (this.propertyChanged != null) { this.propertyChanged(this, new PropertyChangedEventArgs(a)); } } gk(a, b) { this.a9 = b; if (a != null) { a.detachDataLegend(this); } if (b != null) { b.attachDataLegend(this); if (isNaN_(this.targetCursorPositionX)) { this.cr = -1; } if (isNaN_(this.targetCursorPositionY)) { this.cs = -1; } } } g7() { this.ch = this.ci(this.includedSeries); this.cg = this.ci(this.excludedSeries); } g6() { this.ce = this.ci(this.includedColumns); this.cd = this.ci(this.excludedColumns); if (this.ce != null) { let a = new List$1(String_$type, 1, this.ce.keys); for (let b of fromEnum(a)) { let c = b + ":"; let d = this.ce.item(b); if (!this.ce.containsKey(c)) { this.ce.addItem(c, d); } } this.f0(this.ce); } if (this.cd != null) { let e = new List$1(String_$type, 1, this.cd.keys); for (let f of fromEnum(e)) { let g = f + ":"; let h = this.cd.item(f); if (!this.cd.containsKey(g)) { this.cd.addItem(g, h); } } this.f0(this.cd); } } f0(a) { let b = new List$1(String_$type, 1, a.keys); for (let c of fromEnum(b)) { let d = a.item(c); let e = c.toLowerCase(); if (!a.containsKey(e)) { a.addItem(e, d); } let f = c.toUpperCase(); if (!a.containsKey(f)) { a.addItem(f, d); } if (c.length > 0) { let g = f.substr(0, 1) + e.substr(1); if (!a.containsKey(g)) { a.addItem(g, d); } } } } ci(a) { if (a == null) { return null; } let b = new Dictionary$2(String_$type, Number_$type, 0); for (let c = 0; c < a.length; c++) { let d = a[c]; if (!stringIsNullOrEmpty(d) && !b.containsKey(d.trim())) { b.addItem(d.trim(), b.count); } } return b; } b6(a) { return a >= 0 && a <= 1; } notifyCursorPositionChanged(a) { let b = !isNaN_(this.targetCursorPositionX) || !isNaN_(this.targetCursorPositionY); let c = !isNaN_(a.x) && this.b6(a.x); let d = !isNaN_(a.y) && this.b6(a.y); if (!b && c && d) { this.cr = a.x; this.cs = a.y; } } notifySizeChanged() { this.a7.a7(); } notifyVisualPropertiesChanged(a) { } notifySeriesCollectionChanged() { this.gp(); } notifySeriesDataChanged() { if (this.b1) { this.gp(); } } constructor() { super(); this.b0 = false; this.cn = NaN; this.co = NaN; this.cp = 1; this.ju = new Thickness(0, 0); this.ja = BrushUtil.l(0, 255, 255, 255); this.i9 = BrushUtil.l(0, 255, 255, 255); this.b1 = false; this.bm = null; this.be = null; this.bd = null; this.bh = null; this.bj = null; this.bg = null; this.bi = null; this.a9 = null; this.bl = null; this.bk = null; this.b7 = false; this.bf = null; this.cq = NaN; this.calculateColumnSummary = null; this.styleHeaderRow = null; this.styleGroupRow = null; this.styleSeriesRow = null; this.styleSummaryRow = null; this.styleSeriesColumn = null; this.styleSummaryColumn = null; this.propertyChanged = null; this.ce = null; this.cd = null; this.ch = null; this.cg = null; this.a7 = null; this.jn = null; this._externalObject = null; this.by = false; this.bz = false; this.cm = null; this.cf = new Dictionary$2(String_$type, DataLegendSeriesGroupInfo.$, 0); this.cj = new List$1(String_$type, 0); this.ao = new DataLegendContent(); this.cy = 0; this.ak = null; this.al = null; this.c4 = ""; this.ai = null; this.aj = null; this.jn = Rect.empty; this.b1 = true; this.ab = XamDataLegend.$; this.gu(); this.gv(); this.gw(); this.a7 = this.a6(); } updatePropertyByName(a, b) { switch (a) { case XamDataLegend.$$p[26]: this.isEmbeddedInDataTooltip = b; break; case XamDataLegend.$$p[25]: this.includedSeries = b; break; case XamDataLegend.$$p[9]: this.excludedSeries = b; break; case XamDataLegend.$$p[24]: this.includedColumns = b; break; case XamDataLegend.$$p[8]: this.excludedColumns = b; break; case XamDataLegend.$$p[51]: this.an = EnumUtil.getEnumValue(DataAbbreviationMode_$type, b); break; case XamDataLegend.$$p[54]: this.c0 = typeGetValue(b); break; case XamDataLegend.$$p[55]: this.c1 = typeGetValue(b); break; case XamDataLegend.$$p[56]: this.a5 = EnumUtil.getEnumValue(DataLegendValueMode_$type, b); break; case XamDataLegend.$$p[52]: this.fg = b; break; case XamDataLegend.$$p[59]: this.ca = b; break; case XamDataLegend.$$p[58]: this.fo = b; break; case XamDataLegend.$$p[57]: this.ah = b; break; case XamDataLegend.$$p[60]: this.j5 = b; break; case XamDataLegend.$$p[61]: this.cb = b; break; case XamDataLegend.$$p[65]: this.fx = b; break; case XamDataLegend.$$p[64]: this.cc = b; break; case XamDataLegend.$$p[63]: this.j6 = b; break; case XamDataLegend.$$p[62]: this.jl = b; break; case "ValueTextStyle": this.bx = b; break; case XamDataLegend.$$p[17]: this.dv = b; break; case XamDataLegend.$$p[16]: this.ag = b; break; case XamDataLegend.$$p[14]: this.dr = b; break; case XamDataLegend.$$p[15]: this.ap = EnumUtil.getEnumValue(DataLegendHeaderDateMode_$type, b); break; case XamDataLegend.$$p[18]: this.aq = EnumUtil.getEnumValue(DataLegendHeaderTimeMode_$type, b); break; case XamDataLegend.$$p[23]: this.d0 = b; break; case XamDataLegend.$$p[21]: this.jc = b; break; case XamDataLegend.$$p[22]: this.jy = b; break; case XamDataLegend.$$p[19]: this.jx = b; break; case XamDataLegend.$$p[20]: this.b5 = b; break; case "HeaderTextStyle": this.bp = b; break; case XamDataLegend.$$p[12]: this.jb = b; break; case XamDataLegend.$$p[13]: this.jw = b; break; case XamDataLegend.$$p[10]: this.jv = b; break; case XamDataLegend.$$p[11]: this.b3 = b; break; case "GroupTextStyle": this.bo = b; break; case XamDataLegend.$$p[35]: this.jg = b; break; case "SummaryTitleTextStyle": this.bs = b; break; case XamDataLegend.$$p[38]: this.a3 = EnumUtil.getEnumValue(DataLegendSummaryType_$type, b); break; case XamDataLegend.$$p[37]: this.er = b; break; case XamDataLegend.$$p[36]: this.j1 = b; break; case XamDataLegend.$$p[34]: this.j0 = b; break; case XamDataLegend.$$p[41]: this.ji = b; break; case "SummaryValueTextStyle": this.bu = b; break; case XamDataLegend.$$p[33]: this.em = b; break; case XamDataLegend.$$p[32]: this.jf = b; break; case "SummaryLabelTextStyle": this.br = b; break; case XamDataLegend.$$p[40]: this.ex = b; break; case XamDataLegend.$$p[39]: this.jh = b; break; case "SummaryUnitsTextStyle": this.bt = b; break; case XamDataLegend.$$p[3]: this.jt = b; break; case XamDataLegend.$$p[4]: this.ba = EnumUtil.getEnumValue(LegendItemBadgeShape_$type, b); break; case XamDataLegend.$$p[47]: this.a4 = EnumUtil.getEnumValue(DataLegendUnitsMode_$type, b); break; case XamDataLegend.$$p[50]: this.fa = b; break; case XamDataLegend.$$p[48]: this.jk = b; break; case XamDataLegend.$$p[49]: this.j3 = b; break; case "UnitsTextStyle": this.bw = b; break; case XamDataLegend.$$p[46]: this.j2 = b; break; case XamDataLegend.$$p[45]: this.jj = b; break; case "TitleTextStyle": this.bv = b; break; case XamDataLegend.$$p[27]: this.ar = EnumUtil.getEnumValue(DataLegendLabelMode_$type, b); break; case XamDataLegend.$$p[28]: this.jd = b; break; case XamDataLegend.$$p[29]: this.b7 = true; this.jz = b; break; case XamDataLegend.$$p[30]: this.as = EnumUtil.getEnumValue(DataLegendLayoutMode_$type, b); break; case "LabelTextStyle": this.bq = b; break; } } a6() { return new DataLegendView(this); } destroy() { this.provideContainer(null); } get externalObject() { return this._externalObject; } set externalObject(a) { this._externalObject = a; } flush() { this.a7.av(); } onAttachedToUI() { this.a7.a5(); } onDetachedFromUI() { this.a7.a8(); } ensureIndirectContainer(a, b) { if (this.a7.al == null) { this.a7.a6(a, true); } } provideContainer(a) { this.a7.a6(a, false); } gp() { if (this.by) { return; } if (this.a7 != null) { this.by = this.a7.aa(); } } get shouldOnDemandRender() { return this.bz; } set shouldOnDemandRender(a) { this.bz = a; } doRender(a, b) { if (this.jn.isEmpty) { let c = this.getDesiredSize(); this.jn = new Rect(0, 0, 0, c.width, c.height); } this.gq(true); this.a7.bb(a, b); } ensureUpdated() { let a = this.getDesiredSize(); } f9() { if (!this.by) { if (this.ao == null) { this.gp(); } else { return; } } this.g5(); } getDesiredSize() { this.f9(); if (this.ao == null) { return new Size(1, 0, 0); } return new Size(1, this.ao.d, this.ao.c); } g5() { this.f6(); if (this.a9 == null || this.a9.isDetached || !this.b4()) { return; } let a = this.a9; let b = a.getDataLegendSeries(); this.ga(b); this.fz(b, ""); this.cm = new List$1(String_$type, 0); for (let c of fromEnum(this.cj)) { let d = this.cf.item(c); this.gd(d); for (let e of fromEnum(d.b)) { if (!this.cm.contains(e.h) && !stringContains(e.h, "Highlight") && !stringContains(e.h, "Overlay") && !stringContains(e.h, "Value Layer")) { this.cm.add(e.h); } } } for (let f of fromEnum(this.cj)) { let g = this.cf.item(f); if (g.c.count > 0) { this.gc(g); } } this.b0 = this.b8(); this.f5(this.ao); } ga(a) { let b = new Dictionary$2(Number_$type, List$1.$.specialize(IDataLegendSeries_$type), 0); for (let c = 0; c < a.length; c++) { if (!this.isEmbeddedInDataTooltip) { if (a[c].legendItemVisibility != 0) { continue; } } let d = a[c].title == null ? null : a[c].title.toString(); let e = this.ch == null || this.ch.containsKey(a[c].dataLegendKey) || this.ch.containsKey(a[c].parentKey) || this.ch.containsKey(a[c].parentTitle) || this.ch.containsKey(a[c].index.toString()) || this.ch.containsKey(a[c].group) || this.ch.containsKey(d); let f = this.cg != null && (this.cg.containsKey(a[c].dataLegendKey) || this.cg.containsKey(a[c].parentKey) || this.cg.containsKey(a[c].parentTitle) || this.cg.containsKey(a[c].index.toString()) || this.cg.containsKey(a[c].group) || this.cg.containsKey(d)); if (e && !f) { let g = this.cz(a[c]); if (!b.containsKey(g)) { b.addItem(g, new List$1(IDataLegendSeries_$type, 0)); } b.item(g).add(a[c]); } } let h = new List$1(Number_$type, 1, b.keys); h.y(); let i = new List$1(IDataLegendSeries_$type, 0); for (let j of fromEnum(h)) { for (let k of fromEnum(b.item(j))) { i.add(k); } } this.cf = new Dictionary$2(String_$type, DataLegendSeriesGroupInfo.$, 0); this.cj = new List$1(String_$type, 0); for (let l of fromEnum(i)) { let m = l.group; if (!this.cf.containsKey(m)) { this.cj.add(m); this.cf.addItem(m, ((() => { let $ret = new DataLegendSeriesGroupInfo(); $ret.f = m; return $ret; })())); } this.cf.item(m).c.add(l); } } cz(a) { if (this.ch == null) { return a.index; } let b = a.dataLegendKey; if (this.ch.containsKey(b)) { return this.ch.item(b); } let c = a.index.toString(); if (this.ch.containsKey(c)) { return this.ch.item(c); } let d = a.title == null ? null : a.title.toString(); if (this.ch.containsKey(d)) { return this.ch.item(d); } return a.index; } f8() { this.by = false; if (!this.a7.z) { return; } let a = new Size(1, 0, 0); if (this.ao != null) { a = new Size(1, this.ao.d, this.ao.c); } this.g5(); let b = new Size(1, 0, 0); if (this.ao != null) { b = new Size(1, this.ao.d, this.ao.c); } if (!a.equals(b)) { this.a7.aq(b.width, b.height); } this.gq(this.bz); } ge(message_) { } gq(a) { let b = new DataLegendRenderContext(); for (let c = 0; c < this.ao.b.count; c++) { let d = this.ao.b._inner[c]; this.gs(d, b); } this.a7.r.count = b.b; this.a7.s.count = b.c; this.a7.u.count = b.e; this.a7.t.count = b.d; this.a7.q.count = b.a; if (!a) { this.a7.au(this.ao); } } gs(a, b) { this.a7.bd(); if (a.z.width > 0 && a.z.height > 0 && !a.b && !a.e && !a.a && a.l) { let c = this.a7.r.item(b.b); b.b += 1; this.gr(c, a, b); } let d = !stringIsNullOrEmpty(a.t); if (!a.y.isEmpty && a.y.width > 0 && d && a.y.height > 0) { let e = this.a7.s.item(b.c); b.c += 1; this.gt(e, a.t, a.w, a.k, a.y); } for (let f of fromEnum(a.m)) { if (!f.ag.isEmpty && f.s()) { let g = this.a7.u.item(b.e); b.e += 1; this.gt(g, f.z, f.ad, f.k, f.ag); } if (!f.af.isEmpty && f.q() && f.o) { let h = this.a7.t.item(b.d); b.d += 1; this.gt(h, f.w, f.ac, f.j, f.af); } if (!f.ae.isEmpty && f.n() && f.l) { let i = this.a7.q.item(b.a); b.a += 1; this.gt(i, f.v, f.ab, f.i, f.ae); } } this.a7.ar(); } gt(a, b, c, d, e) { a.al = b; this.a7.bc(a, e.left, e.top); this.a7.as(a, d); this.a7.at(a, d); a.ao = c; } gr(a, b, c) { a.ah = b.v; a.content = b.p; a.width = b.z.width; a.height = b.z.height; if (!b.x.isEmpty && !isInfinity(b.x.top) && !isInfinity(b.x.left)) { this.a7.bc(a, b.x.left, b.x.top); } } b2(a, b) { if (b == null) { return false; } return a.containsKey(b); } gd(a) { a.a.clear(); a.b.clear(); a.d = 0; for (let b = 0; b < a.c.count; b++) { let c = a.c._inner[b]; let d = b; let e = c.getDataLegendResolvedWorldPositionX(this.cr); let f = c.getDataLegendResolvedWorldPositionY(this.cs); let g = typeCast(DataLegendSeriesContext.$, c.getDataLegendSeriesContextAt(e, f)); if (g != null) { let h = new List$1(DataLegendSeriesValueInfo.$, 0); for (let i = 0; i < g.e.count; i++) { let j = g.e._inner[i]; let k = this.ce == null || this.b2(this.ce, j.r) || this.b2(this.ce, j.q) || this.b2(this.ce, j.s) || this.b2(this.ce, "ALL"); let l = this.cd != null && (this.b2(this.cd, j.r) || this.b2(this.cd, j.q) || this.b2(this.cd, j.s) || this.b2(this.cd, "ALL")); let m = this.ce == null && this.cd == null && j.k; if (k && (!l && !m)) { j.o = h.count; h.add(j); if (!a.a.containsKey(j.o)) { a.a.addItem(j.o, new DataLegendColumn()); } a.a.item(j.o).i = j.o; a.a.item(j.o).d.q(d, j.t); a.a.item(j.o).b.q(d, j.s); a.a.item(j.o).e.q(d, j.l); a.a.item(j.o).c.q(d, j); a.a.item(j.o).h.add(d); } } g.e = h; a.b.add(g); a.d = Math.max(a.d, g.e.count); } } for (let n of fromEnum(a.a.values)) { n.f.clear(); n.a.clear(); let o = n.e.p(n.h); let p = this.ck(o); for (let q = 0; q < p.count; q++) { let r = p._inner[q]; let s = n.h._inner[q]; n.a.q(s, r); let t = n.c.item(s); let u = this.ek(r, t); n.f.q(s, u); let v = !stringIsNullOrEmpty(r.l); if (v) { n.g = true; } } } } gc(a) { if (this.cf.count >= 1 && this.b3) { this.f1(a.f); } for (let