igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
1,487 lines (1,486 loc) • 111 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, __values } from "tslib";
import { Base, markType, INotifyPropertyChanged_$type, PropertyChangedEventArgs, Array_$type, enumGetBox, EnumUtil, typeGetValue, Number_$type, String_$type, fromEnum, typeCast, Date_$type, markDep, runOn, TypeRegistrar } from "igniteui-react-core";
import { List$1 } from "igniteui-react-core";
import { DataAbbreviationMode_$type } from "igniteui-react-core";
import { Brush } from "igniteui-react-core";
import { FontInfo } from "igniteui-react-core";
import { Thickness } from "igniteui-react-core";
import { Size } from "igniteui-react-core";
import { Rect } from "igniteui-react-core";
import { stringIsNullOrEmpty, stringEmpty, stringContains } from "igniteui-react-core";
import { DataLegendSeriesContext } from "igniteui-react-core";
import { LegendItemBadgeShape_$type } from "igniteui-react-core";
import { Control } from "igniteui-react-core";
import { IDataLegend_$type } from "igniteui-react-core";
import { IOnDemandRender_$type } from "igniteui-react-core";
import { DependencyProperty } from "igniteui-react-core";
import { DataLegendValueMode_$type } from "igniteui-react-core";
import { FontUtil } from "igniteui-react-core";
import { DataLegendHeaderDateMode_$type } from "igniteui-react-core";
import { DataLegendHeaderTimeMode_$type } from "igniteui-react-core";
import { DataLegendSummaryType_$type } from "igniteui-react-core";
import { DataLegendUnitsMode_$type } from "igniteui-react-core";
import { DataLegendLabelMode_$type } from "igniteui-react-core";
import { DataLegendLayoutMode_$type } from "igniteui-react-core";
import { BindingFormatter } from "igniteui-react-core";
import { DataLegendVisualData } from "./DataLegendVisualData";
import { Extensions } from "igniteui-react-core";
import { TextBlock } from "igniteui-react-core";
import { DataLegendVisualDataRow } from "./DataLegendVisualDataRow";
import { DataLegendVisualDataColumn } from "./DataLegendVisualDataColumn";
import { ILegendContext_$type } from "igniteui-react-core";
import { RectData } from "igniteui-react-core";
import { AppearanceHelper } from "igniteui-react-core";
import { PrimitiveAppearanceData } from "igniteui-react-core";
import { FrameworkElement } from "igniteui-react-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-react-core";
import { IDataLegendSeries_$type } from "igniteui-react-core";
import { DataLegendSeriesGroupInfo } from "./DataLegendSeriesGroupInfo";
import { RenderingContext } from "igniteui-react-core";
import { DataLegendRenderContext } from "./DataLegendRenderContext";
import { Pool$1 } from "igniteui-react-core";
import { ContentControl } from "igniteui-react-core";
import { DataLegendSeriesValueInfo } from "igniteui-react-core";
import { DataLegendColumn } from "./DataLegendColumn";
import { DataLegendSummaryColumn } from "igniteui-react-core";
import { DataAbbreviator } from "./DataAbbreviator";
import { NumberFormatSpecifier } from "igniteui-react-core";
import { DateTimeFormatSpecifier } from "igniteui-react-core";
import { PropertyMetadata } from "igniteui-react-core";
import { isNaN_, isInfinity, truncate } from "igniteui-react-core";
import { EventProxy } from "igniteui-react-core";
import { Tuple$2 } from "igniteui-react-core";
import { CanvasViewRenderer } from "igniteui-react-core";
import { DataTemplatePassInfo } from "igniteui-react-core";
import { DataTemplateMeasureInfo } from "igniteui-react-core";
import { DataTemplateRenderInfo } from "igniteui-react-core";
import { FontDefaults } from "igniteui-react-core";
/**
* @hidden
*/
var DataLegendContent = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(DataLegendContent, _super);
function DataLegendContent() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.a = new List$1(DataLegendRowInfo.$, 0);
_this.d = 0;
_this.c = 0;
return _this;
}
Object.defineProperty(DataLegendContent.prototype, "b", {
get: function () {
return this.a;
},
enumerable: false,
configurable: true
});
DataLegendContent.prototype.f = function () {
this.b.clear();
};
DataLegendContent.prototype.e = function (a) {
this.b.add(a);
};
DataLegendContent.$t = markType(DataLegendContent, 'DataLegendContent');
return DataLegendContent;
}(Base));
export { DataLegendContent };
/**
* @hidden
*/
var DataLegendRowBase = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(DataLegendRowBase, _super);
function DataLegendRowBase(a, b, c, d, e) {
var _this = _super.call(this) || this;
_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;
return _this;
}
DataLegendRowBase.$t = markType(DataLegendRowBase, 'DataLegendRowBase');
return DataLegendRowBase;
}(Base));
export { DataLegendRowBase };
/**
* @hidden
*/
var DataLegendRowCell = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(DataLegendRowCell, _super);
function DataLegendRowCell(a, b, c, d, e) {
var _this = _super.call(this, a, b, c, d, e) || this;
_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) {
var f = a.bv();
var 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) {
var h = a.bs();
var i = a.j();
_this.ab = h;
_this.ad = h;
_this.ac = h;
_this.i = i;
_this.k = i;
_this.j = i;
}
else {
var j = a.bt();
var 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;
return _this;
}
DataLegendRowCell.prototype.m = function () {
return this.ai.width > 0 && this.ai.height > 0;
};
DataLegendRowCell.prototype.p = function () {
return this.ak.width > 0 && this.ak.height > 0;
};
DataLegendRowCell.prototype.r = function () {
return this.am.width > 0 && this.am.height > 0;
};
DataLegendRowCell.prototype.n = function () {
return this.v != null;
};
DataLegendRowCell.prototype.q = function () {
return this.w != null;
};
DataLegendRowCell.prototype.s = function () {
return !stringIsNullOrEmpty(this.z) && this.am.width > 0 && this.am.height > 0;
};
DataLegendRowCell.prototype.aa = function () {
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;
}(DataLegendRowBase));
export { DataLegendRowCell };
/**
* @hidden
*/
var DataLegendRowInfo = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(DataLegendRowInfo, _super);
function DataLegendRowInfo(a, b, c, d, e) {
var _this = _super.call(this, a, b, c, d, e) || this;
_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) {
var f = a.bv();
var g = a.m();
_this.u = f;
_this.k = g;
}
else if (_this.a) {
var h = a.bs();
var i = a.j();
_this.u = h;
_this.k = i;
}
else {
var j = a.bt();
var k = a.k();
_this.u = j;
_this.k = k;
}
_this.w = Rect.empty;
_this.v = Rect.empty;
_this.j = 7;
_this.o = "None";
return _this;
}
DataLegendRowInfo.prototype.s = function (a) {
if (this.m == null) {
return;
}
for (var b = 0; b < this.m.count; b++) {
a(this.m._inner[b]);
}
};
DataLegendRowInfo.$t = markType(DataLegendRowInfo, 'DataLegendRowInfo', DataLegendRowBase.$);
return DataLegendRowInfo;
}(DataLegendRowBase));
export { DataLegendRowInfo };
/**
* @hidden
*/
var XamDataLegend = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(XamDataLegend, _super);
function XamDataLegend() {
var _this = _super.call(this) || this;
_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();
return _this;
}
Object.defineProperty(XamDataLegend.prototype, "cq", {
get: function () {
return this.cm;
},
set: function (a) {
var b = this.cm;
this.cm = a;
if (b != this.cm) {
this.gb("ActualCursorPositionX", b, this.cm);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XamDataLegend.prototype, "cr", {
get: function () {
return this.cn;
},
set: function (a) {
var b = this.cn;
this.cn = a;
if (b != this.cn) {
this.gb("ActualCursorPositionY", b, this.cn);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XamDataLegend.prototype, "cs", {
get: function () {
return this.co;
},
set: function (a) {
var b = this.co;
this.co = a;
this.gb("ActualPixelScalingRatio", b, this.co);
},
enumerable: false,
configurable: true
});
Object.defineProperty(XamDataLegend.prototype, "bx", {
get: function () {
return this.bm;
},
set: function (a) {
var 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);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XamDataLegend.prototype, "bp", {
get: function () {
return this.be;
},
set: function (a) {
var 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);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XamDataLegend.prototype, "bo", {
get: function () {
return this.bd;
},
set: function (a) {
var 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);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XamDataLegend.prototype, "bs", {
get: function () {
return this.bh;
},
set: function (a) {
var 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);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XamDataLegend.prototype, "bu", {
get: function () {
return this.bj;
},
set: function (a) {
var 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);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XamDataLegend.prototype, "br", {
get: function () {
return this.bg;
},
set: function (a) {
var 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);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XamDataLegend.prototype, "bt", {
get: function () {
return this.bi;
},
set: function (a) {
var 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);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XamDataLegend.prototype, "bw", {
get: function () {
return this.bl;
},
set: function (a) {
var 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);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XamDataLegend.prototype, "bv", {
get: function () {
return this.bk;
},
set: function (a) {
var 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);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XamDataLegend.prototype, "bq", {
get: function () {
return this.bf;
},
set: function (a) {
var 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);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XamDataLegend.prototype, "pixelScalingRatio", {
get: function () {
return this.cp;
},
set: function (a) {
var b = this.cp;
this.cp = a;
this.gb("PixelScalingRatio", b, this.cp);
},
enumerable: false,
configurable: true
});
XamDataLegend.prototype.exportSerializedVisualData = function () {
var a = this.exportVisualData();
return a.serialize();
};
XamDataLegend.prototype.cu = function (a, b) {
var c = Math.max(b.left, a);
var d = Math.max(b.right, a);
var e = Math.max(b.right, a);
return Math.min(b.top, a);
};
XamDataLegend.prototype.ct = function (a, b) {
return Math.min(b.left, a);
};
XamDataLegend.prototype.iy = function (a, b) {
var c = Rect.l_op_Equality(a, null) || a.isEmpty || !Extensions.b(a);
var 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;
}
var e = Math.min(a.top, b.top);
var f = Math.min(a.left, b.left);
var g = Math.max(a.right, b.right);
var h = Math.max(a.bottom, b.bottom);
return new Rect(0, f, e, g - f, h - e);
};
XamDataLegend.prototype.exportVisualData = function () {
var e_1, _a;
var a = new DataLegendVisualData();
a.width = this.ao.d;
a.height = this.ao.c;
if (this.a7 == null) {
return a;
}
var b = -1;
var c = -1;
var d = -1;
var e = -1;
var f = this.a7.af;
var g = this.a7.ad;
var h = this.a7.ah;
var 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 (var j = 0; j < this.ao.b.count; j++) {
var k = this.ao.b._inner[j];
var 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;
var m = Rect.empty;
if (k.c) {
if (Extensions.b(k.w) && f.count > (b + 1)) {
b++;
var n = f._inner[b];
var o = this.bn(n, k.k);
var 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);
}
try {
for (var _b = (e_1 = void 0, __values(fromEnum(k.m))), _c = _b.next(); !_c.done; _c = _b.next()) {
var q = _c.value;
if (Extensions.b(q.ae) && g.count > (c + 1)) {
c++;
var r = g._inner[c];
var s = this.bn(r, q.i);
var 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++;
var u = h._inner[d];
var v = this.bn(u, q.k);
var 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++;
var x = i._inner[e];
var y = this.bn(x, q.j);
var 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);
}
}
}
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;
}
}
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();
var aa = typeCast(ILegendContext_$type, k.n);
var 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;
};
XamDataLegend.prototype.gl = function (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;
}
}
};
XamDataLegend.prototype.bn = function (a, b) {
var 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);
}
};
XamDataLegend.prototype.a2 = function (a) {
if (this.calculateColumnSummary != null) {
var 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;
};
XamDataLegend.prototype.a8 = function () {
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();
}
};
XamDataLegend.prototype.gq = function (a) {
if (this.styleSummaryRow != null) {
var b = this.a0(a);
this.styleSummaryRow(this, b);
this.gm(a, b);
}
if (a.c && a.m != null && this.styleSummaryColumn != null) {
for (var c = 0; c < a.m.count; c++) {
var 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);
}
}
};
XamDataLegend.prototype.gp = function (a) {
if (this.styleSeriesRow != null) {
var b = this.a0(a);
this.styleSeriesRow(this, b);
this.gm(a, b);
}
if (a.c && a.m != null && this.styleSeriesColumn != null) {
for (var c = 0; c < a.m.count; c++) {
var 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);
}
}
};
XamDataLegend.prototype.go = function (a) {
if (this.styleHeaderRow != null) {
var b = this.a0(a);
this.styleHeaderRow(this, b);
this.gm(a, b);
}
};
XamDataLegend.prototype.gn = function (a) {
if (this.styleGroupRow != null) {
var b = this.a0(a);
this.styleGroupRow(this, b);
this.gm(a, b);
}
};
XamDataLegend.prototype.a0 = function (a) {
var 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;
};
XamDataLegend.prototype.gm = function (a, b) {
a.r = b.g;
a.u = b.h;
a.j = b.a;
a.l = b.b;
a.c = b.c;
};
XamDataLegend.prototype.az = function (a) {
var 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;
};
XamDataLegend.prototype.gr = function (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;
};
XamDataLegend.prototype.ge = function (a, b, c) {
var _this = this;
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]:
var d = c;
var 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 = ((function () {
var $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 = ((function () {
var $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();
};
XamDataLegend.prototype.gb = function (a, b, c) {
this.ge(a, b, c);
if (this.propertyChanged != null) {
this.propertyChanged(this, new PropertyChangedEventArgs(a));
}
};
XamDataLegend.prototype.gc = function (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;
}
}
};
XamDataLegend.prototype.gv = function () {
this.ch = this.ci(this.includedSeries);
this.cg = this.ci(this.excludedSeries);
};
XamDataLegend.prototype.gu = function () {
var e_2, _a, e_3, _b;
this.ce = this.ci(this.includedColumns);
this.cd = this.ci(this.excludedColumns);
if (this.ce != null) {
var a = new List$1(String_$type, 1, this.ce.keys);
try {
for (var _c = __values(fromEnum(a)), _d = _c.next(); !_d.done; _d = _c.next()) {
var b = _d.value;
var c = b + ":";
var d = this.ce.item(b);
if (!this.ce.containsKey(c)) {
this.ce.addItem(c, d);
}
}
}
catch (e_2_1) {
e_2 = { error: e_2_1 };
}
finally {
try {
if (_d && !_d.done && (_a = _c.return))
_a.call(_c);
}
finally {
if (e_2)
throw e_2.error;
}
}
this.fs(this.ce);
}
if (this.cd != null) {
var e = new List$1(String_$type, 1, this.cd.keys);
try {
for (var _e = __values(fromEnum(e)), _f = _e.next(); !_f.done; _f = _e.next()) {
var f = _f.value;
var g = f + ":";
var h = this.cd.item(f);
if (!this.cd.containsKey(g)) {
this.cd.addItem(g, h);
}
}
}
catch (e_3_1) {
e_3 = { error: e_3_1 };
}
finally {
try {
if (_f && !_f.done && (_b = _e.return))
_b.call(_e);
}
finally {
if (e_3)
throw e_3.error;
}
}
this.fs(this.cd);
}
};
XamDataLegend.prototype.fs = function (a) {
var e_4, _a;
var b = new List$1(String_$type, 1, a.keys);
try {
for (var _b = __values(fromEnum(b)), _c = _b.next(); !_c.done; _c = _b.next()) {
var c = _c.value;
var d = a.item(c);
var e = c.toLowerCase();
if (!a.containsKey(e)) {
a.addItem(e, d);
}
var f = c.toUpperCase();
if (!a.containsKey(f)) {
a.addItem(f, d);
}
if (c.length > 0) {
var g = f.substr(0, 1) + e.substr(1);
if (!a.containsKey(g)) {
a.addItem(g, d);
}
}
}
}
catch (e_4_1) {
e_4 = { error: e_4_1 };
}
finally {
try {
if (_c && !_c.done && (_a = _b.return))
_a.call(_b);
}
finally {
if (e_4)
throw e_4.error;
}
}
};
XamDataLegend.prototype.ci = function (a) {
if (a == null) {
return null;
}
var b = new Dictionary$2(String_$type, Number_$type, 0);
for (var c = 0; c < a.length; c++) {
var d = a[c];
if (!stringIsNullOrEmpty(d) && !b.containsKey(d.trim())) {
b.addItem(d.trim(), b.count);
}
}
return b;
};
XamDataLegend.prototype.b6 = function (a) {
return a >= 0 && a <= 1;
};
XamDataLegend.prototype.notifyCursorPositionChanged = function (a) {
var b = !isNaN_(this.targetCursorPositionX) || !isNaN_(this.targetCursorPositionY);
var c = !isNaN_(a.x) && this.b6(a.x);
var d = !isNaN_(a.y) && this.b6(a.y);
if (!b && c && d) {
this.cq = a.x;
this.cr = a.y;
}
};
XamDataLegend.prototype.notifySizeChanged = function () {
this.a7.a7();
};
XamDataLegend.prototype.notifyVisualPropertiesChanged = function (a) {
};
XamDataLegend.prototype.notifySeriesCollectionChanged = function () {
this.gg();
};
XamDataLegend.prototype.notifySeriesDataChanged = function () {
if (this.b1) {
this.gg();
}
};
XamDataLegend.prototype.updatePropertyByName = function (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;
}
};
XamDataLegend.prototype.a6 = function () {
return new DataLegendView(this);
};
XamDataLegend.prototype.destroy = function () {
this.provideContainer(null);
};
Object.defineProperty(XamDataLegend.prototype, "externalObject", {
get: function () {
return this._externalObject;
},
set: function (a) {
this._externalObject = a;
},
enumerable: false,
configurable: true
});
XamDataLegend.prototype.flush = function () {
this.a7.av();
};
XamDataLegend.prototype.onAttachedToUI = function () {
this.a7.a5();
};
XamDataLegend.prototype.onDetachedFromUI = function () {
this.a7.a8();
};
XamDataLegend.prototype.ensureIndirectContainer = function (a, b) {
if (this.a7.al == null) {
this.a7.a6(a, true);
}
};
XamDataLegend.prototype.provideContainer = function (a) {
this.a7.a6(a, false);
};
XamDataLegend.prototype.gg = function () {
if (this.by) {
return;
}
this.by = this.a7.aa();
};
Object.defineProperty(XamDataLegend.prototype, "shouldOnDemandRender", {
get: function () {
return this.bz;
},
set: function (a) {
this.bz = a;
},
enumerable: false,
configurable: true
});
XamDataLegend.prototype.doRender = function (a, b) {
if (this.iz.isEmpty) {
var c = this.getDesiredSize();
this.iz = new Rect(0, 0, 0, c.width, c.height);
}
this.gh(true);
this.a7.bb(a, b);
};
XamDataLegend.prototype.ensureUpdated = function () {
var a = this.getDesiredSize();
};
XamDataLegend.prototype.f1 = function () {
if (!this.by) {
if (this.ao == null) {
this.gg();
}
else {
return;
}
}
this.gt();
};
XamDataLegend.prototype.getDesiredSize = function () {
this.f1();
if (this.ao == null) {
return new Size(1, 0, 0);
}
return new Size(1, this.ao.d, this.ao.c);
};
XamDataLegend.prototype.gt = function () {
var e_5, _a, e_6, _b, e_7, _c;
this.fy();
if (this.a9 == null || this.a9.isDetached || !this.b4()) {
return;
}
var a = this.a9;
var b = a.getDataLegendSeries();
this.f2(b);
this.fr(b, "");
this.cl = new List$1(String_$type, 0);
try {
for (var _d = __values(fromEnum(this.cf.keys)), _e = _d.next(); !_e.done; _e = _d.next()) {
var c = _e.value;
var d = this.cf.item(c);
this.f5(d);
try {
for (var _f = (e_6 = void 0, __values(fromEnum(d.b))), _g = _f.next(); !_g.done; _g = _f.next()) {
var e = _g.value;
if (!this.cl.contains(e.h) && !stringContains(e.h, "Highlight") && !stringContains(e.h, "Overlay") && !stringContains(e.h, "Value Layer")) {
this.cl.add(e.h);
}
}
}
catch (e_6_1) {
e_6 = { error: e_6_1 };
}
finally {
try {
if (_g && !_g.done && (_b = _f.return))
_b.call(_f);
}
finally {
if (e_6)
throw e_6.error;
}
}
}
}
catch (e_5_1) {
e_5 = { error: e_5_1 };
}
finally {