UNPKG

igniteui-angular-charts

Version:

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

1,390 lines (1,389 loc) 105 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 { RectData } from "igniteui-angular-core"; import { AppearanceHelper } 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 { 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 { 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 { CanvasViewRenderer } from "igniteui-angular-core"; import { DataTemplatePassInfo } from "igniteui-angular-core"; import { DataTemplateMeasureInfo } from "igniteui-angular-core"; import { DataTemplateRenderInfo } from "igniteui-angular-core"; import { FontDefaults } from "igniteui-angular-core"; /** * @hidden */ export let DataLegendContent = /*@__PURE__*/ (() => { class DataLegendContent extends Base { constructor() { super(...arguments); this.a = new List$1(DataLegendRowInfo.$, 0); this.d = 0; this.c = 0; } get b() { return this.a; } f() { this.b.clear(); } e(a) { this.b.add(a); } } DataLegendContent.$t = markType(DataLegendContent, 'DataLegendContent'); return DataLegendContent; })(); /** * @hidden */ export let DataLegendRowBase = /*@__PURE__*/ (() => { class DataLegendRowBase extends Base { 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; } } DataLegendRowBase.$t = markType(DataLegendRowBase, 'DataLegendRowBase'); return DataLegendRowBase; })(); /** * @hidden */ export let DataLegendRowCell = /*@__PURE__*/ (() => { class DataLegendRowCell extends 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); } } DataLegendRowCell.$t = markType(DataLegendRowCell, 'DataLegendRowCell', DataLegendRowBase.$); return DataLegendRowCell; })(); /** * @hidden */ export let DataLegendRowInfo = /*@__PURE__*/ (() => { class DataLegendRowInfo extends DataLegendRowBase { constructor(a, b, c, d, e) { super(a, b, c, d, e); this.m = null; this.l = false; this.q = null; this.h = null; this.i = null; this.r = null; this.u = null; this.k = null; this.y = new Size(); this.ab = null; this.p = null; this.t = null; this.x = new Size(); this.n = null; this.j = 0; this.o = null; this.aa = null; this.z = null; this.v = null; this.w = null; this.h = new Array(0); this.m = new List$1(DataLegendRowCell.$, 0); this.l = this.d; this.aa = new Thickness(0, 0); this.z = new Thickness(0, 0); this.ab = new Thickness(0, 0); this.x = new Size(1, 0, 0); this.y = new Size(1, 0, 0); if (this.d) { this.u = a.bw(); this.k = a.n(); } else if (this.e) { let f = a.bv(); let g = a.m(); this.u = f; this.k = g; } else if (this.a) { let h = a.bs(); let i = a.j(); this.u = h; this.k = i; } else { let j = a.bt(); let k = a.k(); this.u = j; this.k = k; } this.w = Rect.empty; this.v = Rect.empty; this.j = 7; this.o = "None"; } s(a) { if (this.m == null) { return; } for (let b = 0; b < this.m.count; b++) { a(this.m._inner[b]); } } } DataLegendRowInfo.$t = markType(DataLegendRowInfo, 'DataLegendRowInfo', DataLegendRowBase.$); return DataLegendRowInfo; })(); /** * @hidden */ export let XamDataLegend = /*@__PURE__*/ (() => { class XamDataLegend extends Control { constructor() { super(); this.b0 = false; this.cm = NaN; this.cn = NaN; this.co = 1; 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.cp = 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.iz = null; this._externalObject = null; this.by = false; this.bz = false; this.cl = null; this.cf = new Dictionary$2(String_$type, DataLegendSeriesGroupInfo.$, 0); this.ao = new DataLegendContent(); this.cw = 0; this.ak = null; this.al = null; this.c2 = ""; this.ai = null; this.aj = null; this.iz = Rect.empty; this.b1 = true; this.ab = XamDataLegend.$; this.a7 = this.a6(); } get cq() { return this.cm; } set cq(a) { let b = this.cm; this.cm = a; if (b != this.cm) { this.gb("ActualCursorPositionX", b, this.cm); } } get cr() { return this.cn; } set cr(a) { let b = this.cn; this.cn = a; if (b != this.cn) { this.gb("ActualCursorPositionY", b, this.cn); } } get cs() { return this.co; } set cs(a) { let b = this.co; this.co = a; this.gb("ActualPixelScalingRatio", b, this.co); } 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.gb("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.gb("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.gb("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.gb("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.gb("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.gb("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.gb("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.gb("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.gb("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.gb("LabelTextStyle", b, this.bf); } } get pixelScalingRatio() { return this.cp; } set pixelScalingRatio(a) { let b = this.cp; this.cp = a; this.gb("PixelScalingRatio", b, this.cp); } exportSerializedVisualData() { let a = this.exportVisualData(); return a.serialize(); } cu(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); } ct(a, b) { return Math.min(b.left, a); } iy(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; 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 (f.count < this.ao.b.count) { return a; } if (Rect.l_op_Equality(this.iz, null) || this.iz.isEmpty) { a.viewport = null; } else { a.viewport = new RectData(0, 0, this.iz.width, this.iz.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.aa.top; l.rowMarginBottom = k.aa.bottom; l.rowMarginRight = k.aa.right; l.rowMarginLeft = k.aa.left; let m = Rect.empty; if (k.c) { if (Extensions.b(k.w) && 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.w); p.text = n.al; p.textColor = AppearanceHelper.b(k.u); p.marginTop = k.ab.top; p.marginLeft = k.ab.left; p.marginRight = k.ab.right; p.marginBottom = k.ab.bottom; this.gl(p, o); l.columns.add(p); m = this.iy(m, k.w); } 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.gl(t, s); l.columns.add(t); m = this.iy(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.gl(w, v); l.columns.add(w); m = this.iy(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.gl(z, y); l.columns.add(z); m = this.iy(m, q.af); } } if (k.l) { m = this.iy(m, k.v); l.badgeBounds = RectData.b(k.v); l.badgeMarginTop = k.z.top; l.badgeMarginBottom = k.z.bottom; l.badgeMarginRight = k.z.right; l.badgeMarginLeft = k.z.left; l.badgeAppearance = new PrimitiveAppearanceData(); let aa = typeCast(ILegendContext_$type, k.n); let ab = typeCast(ILegendContext_$type, k.i); l.badgeAppearance.fill = AppearanceHelper.b(aa.actualItemBrush); l.badgeAppearance.stroke = AppearanceHelper.b(aa.outline); l.badgeShape = k.o; } l.rowBounds = RectData.b(m); } a.rows.add(l); } return a; } gl(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(); } } gq(a) { if (this.styleSummaryRow != null) { let b = this.a0(a); this.styleSummaryRow(this, b); this.gm(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.q; d.c = c; d.e = a.p; this.styleSummaryColumn(this, d); this.gr(a.m._inner[c], d); } } } gp(a) { if (this.styleSeriesRow != null) { let b = this.a0(a); this.styleSeriesRow(this, b); this.gm(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.q; d.c = c; d.e = a.p; this.styleSeriesColumn(this, d); this.gr(a.m._inner[c], d); } } } go(a) { if (this.styleHeaderRow != null) { let b = this.a0(a); this.styleHeaderRow(this, b); this.gm(a, b); } } gn(a) { if (this.styleGroupRow != null) { let b = this.a0(a); this.styleGroupRow(this, b); this.gm(a, b); } } a0(a) { let b = new DataLegendStylingRowEventArgs(); b.g = a.r; b.h = a.u; b.e = a.p; b.a = a.j; b.b = a.l; b.c = a.c; b.d = a.g; b.f = a.q; return b; } gm(a, b) { a.r = b.g; a.u = 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; } gr(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; } ge(a, b, c) { switch (a) { case XamDataLegend.$$p[25]: this.b1 = c; break; case XamDataLegend.$$p[19]: case XamDataLegend.$$p[3]: this.gv(); break; case XamDataLegend.$$p[18]: case XamDataLegend.$$p[2]: this.gu(); break; case XamDataLegend.$$p[38]: let d = c; let e = b; this.gc(e, d); break; case XamDataLegend.$$p[36]: if (this.b6(this.targetCursorPositionX)) { this.cq = this.targetCursorPositionX; } break; case XamDataLegend.$$p[37]: if (this.b6(this.targetCursorPositionY)) { this.cr = this.targetCursorPositionY; } break; case XamDataLegend.$$p[52]: case XamDataLegend.$$p[51]: if (!stringIsNullOrEmpty(this.fg)) { this.ak = ((() => { let $ret = new BindingFormatter(); $ret.j = this.fg; $ret.d = this.ah; return $ret; })()); } else { this.ak = null; } break; case XamDataLegend.$$p[11]: case XamDataLegend.$$p[10]: if (!stringIsNullOrEmpty(this.dm)) { this.ai = ((() => { let $ret = new BindingFormatter(); $ret.j = this.dm; $ret.d = this.ag; return $ret; })()); } else { this.ai = null; } break; case "PixelScalingRatio": if (isNaN_(this.cs)) { this.a7.ay(); } else { this.cs = this.pixelScalingRatio; } break; case "ActualPixelScalingRatio": this.a7.a9(c); break; } this.gg(); } gb(a, b, c) { this.ge(a, b, c); if (this.propertyChanged != null) { this.propertyChanged(this, new PropertyChangedEventArgs(a)); } } gc(a, b) { this.a9 = b; if (a != null) { a.detachDataLegend(this); } if (b != null) { b.attachDataLegend(this); if (isNaN_(this.targetCursorPositionX)) { this.cq = -1; } if (isNaN_(this.targetCursorPositionY)) { this.cr = -1; } } } gv() { this.ch = this.ci(this.includedSeries); this.cg = this.ci(this.excludedSeries); } gu() { 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.fs(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.fs(this.cd); } } fs(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.cq = a.x; this.cr = a.y; } } notifySizeChanged() { this.a7.a7(); } notifyVisualPropertiesChanged(a) { } notifySeriesCollectionChanged() { this.gg(); } notifySeriesDataChanged() { if (this.b1) { this.gg(); } } updatePropertyByName(a, b) { switch (a) { case XamDataLegend.$$p[20]: this.isEmbeddedInDataTooltip = b; break; case XamDataLegend.$$p[19]: this.includedSeries = b; break; case XamDataLegend.$$p[3]: this.excludedSeries = b; break; case XamDataLegend.$$p[18]: this.includedColumns = b; break; case XamDataLegend.$$p[2]: this.excludedColumns = b; break; case XamDataLegend.$$p[45]: this.an = EnumUtil.getEnumValue(DataAbbreviationMode_$type, b); break; case XamDataLegend.$$p[48]: this.cy = typeGetValue(b); break; case XamDataLegend.$$p[49]: this.cz = typeGetValue(b); break; case XamDataLegend.$$p[50]: this.a5 = EnumUtil.getEnumValue(DataLegendValueMode_$type, b); break; case XamDataLegend.$$p[46]: this.e8 = b; break; case XamDataLegend.$$p[53]: this.ca = b; break; case XamDataLegend.$$p[52]: this.fg = b; break; case XamDataLegend.$$p[51]: this.ah = b; break; case XamDataLegend.$$p[54]: this.jf = b; break; case XamDataLegend.$$p[55]: this.cb = b; break; case XamDataLegend.$$p[59]: this.fp = b; break; case XamDataLegend.$$p[58]: this.cc = b; break; case XamDataLegend.$$p[57]: this.jg = b; break; case XamDataLegend.$$p[56]: this.ix = b; break; case "ValueTextStyle": this.bx = b; break; case XamDataLegend.$$p[11]: this.dm = b; break; case XamDataLegend.$$p[10]: this.ag = b; break; case XamDataLegend.$$p[8]: this.di = b; break; case XamDataLegend.$$p[9]: this.ap = EnumUtil.getEnumValue(DataLegendHeaderDateMode_$type, b); break; case XamDataLegend.$$p[12]: this.aq = EnumUtil.getEnumValue(DataLegendHeaderTimeMode_$type, b); break; case XamDataLegend.$$p[17]: this.ds = b; break; case XamDataLegend.$$p[15]: this.io = b; break; case XamDataLegend.$$p[16]: this.i8 = b; break; case XamDataLegend.$$p[13]: this.i7 = b; break; case XamDataLegend.$$p[14]: this.b5 = b; break; case "HeaderTextStyle": this.bp = b; break; case XamDataLegend.$$p[6]: this.im = b; break; case XamDataLegend.$$p[7]: this.i6 = b; break; case XamDataLegend.$$p[4]: this.i5 = b; break; case XamDataLegend.$$p[5]: this.b3 = b; break; case "GroupTextStyle": this.bo = b; break; case XamDataLegend.$$p[29]: this.is = b; break; case "SummaryTitleTextStyle": this.bs = b; break; case XamDataLegend.$$p[32]: this.a3 = EnumUtil.getEnumValue(DataLegendSummaryType_$type, b); break; case XamDataLegend.$$p[31]: this.ej = b; break; case XamDataLegend.$$p[30]: this.jb = b; break; case XamDataLegend.$$p[28]: this.ja = b; break; case XamDataLegend.$$p[35]: this.iu = b; break; case "SummaryValueTextStyle": this.bu = b; break; case XamDataLegend.$$p[27]: this.ee = b; break; case XamDataLegend.$$p[26]: this.ir = b; break; case "SummaryLabelTextStyle": this.br = b; break; case XamDataLegend.$$p[34]: this.ep = b; break; case XamDataLegend.$$p[33]: this.it = b; break; case "SummaryUnitsTextStyle": this.bt = b; break; case XamDataLegend.$$p[0]: this.i4 = b; break; case XamDataLegend.$$p[1]: this.ba = EnumUtil.getEnumValue(LegendItemBadgeShape_$type, b); break; case XamDataLegend.$$p[41]: this.a4 = EnumUtil.getEnumValue(DataLegendUnitsMode_$type, b); break; case XamDataLegend.$$p[44]: this.e2 = b; break; case XamDataLegend.$$p[42]: this.iw = b; break; case XamDataLegend.$$p[43]: this.jd = b; break; case "UnitsTextStyle": this.bw = b; break; case XamDataLegend.$$p[40]: this.jc = b; break; case XamDataLegend.$$p[39]: this.iv = b; break; case "TitleTextStyle": this.bv = b; break; case XamDataLegend.$$p[21]: this.ar = EnumUtil.getEnumValue(DataLegendLabelMode_$type, b); break; case XamDataLegend.$$p[22]: this.ip = b; break; case XamDataLegend.$$p[23]: this.b7 = true; this.i9 = b; break; case XamDataLegend.$$p[24]: 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); } gg() { if (this.by) { return; } this.by = this.a7.aa(); } get shouldOnDemandRender() { return this.bz; } set shouldOnDemandRender(a) { this.bz = a; } doRender(a, b) { if (this.iz.isEmpty) { let c = this.getDesiredSize(); this.iz = new Rect(0, 0, 0, c.width, c.height); } this.gh(true); this.a7.bb(a, b); } ensureUpdated() { let a = this.getDesiredSize(); } f1() { if (!this.by) { if (this.ao == null) { this.gg(); } else { return; } } this.gt(); } getDesiredSize() { this.f1(); if (this.ao == null) { return new Size(1, 0, 0); } return new Size(1, this.ao.d, this.ao.c); } gt() { this.fy(); if (this.a9 == null || this.a9.isDetached || !this.b4()) { return; } let a = this.a9; let b = a.getDataLegendSeries(); this.f2(b); this.fr(b, ""); this.cl = new List$1(String_$type, 0); for (let c of fromEnum(this.cf.keys)) { let d = this.cf.item(c); this.f5(d); for (let e of fromEnum(d.b)) { if (!this.cl.contains(e.h) && !stringContains(e.h, "Highlight") && !stringContains(e.h, "Overlay") && !stringContains(e.h, "Value Layer")) { this.cl.add(e.h); } } } for (let f of fromEnum(this.cf.keys)) { let g = this.cf.item(f); if (g.c.count > 0) { this.f4(g); } } this.b0 = this.b8(); this.fx(this.ao); } f2(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.cx(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); for (let l of fromEnum(i)) { let m = l.group; if (!this.cf.containsKey(m)) { this.cf.addItem(m, ((() => { let $ret = new DataLegendSeriesGroupInfo(); $ret.f = m; return $ret; })())); } this.cf.item(m).c.add(l); } } cx(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; } f0() { this.by = false;