igniteui-angular-charts
Version:
Ignite UI Angular charting components for building rich data visualizations for modern web apps.
1,441 lines (1,440 loc) • 92.7 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, __generator, __values } from "tslib";
import { PieChartBase } from "./PieChartBase";
import { DependencyProperty } from "igniteui-angular-core";
import { PieChartBaseView } from "./PieChartBaseView";
import { Base, Number_$type, typeCast, fromEnum, markType, markDep, IEnumerable_$type, INotifyPropertyChanged_$type, PropertyChangedEventArgs, Point_$type, delegateCombine, enumGetBox, EnumUtil, Delegate_$type, Array_$type, Boolean_$type, delegateRemove, runOn, fromEn, toEnum } from "igniteui-angular-core";
import { Control } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { NotifyCollectionChangedEventArgs } from "igniteui-angular-core";
import { Pool$1 } from "igniteui-angular-core";
import { FastItemsSource } from "igniteui-angular-core";
import { IChartLegend_$type } from "igniteui-angular-core";
import { ContentControl } from "igniteui-angular-core";
import { Brush } from "igniteui-angular-core";
import { PieSliceDataContext } from "./PieSliceDataContext";
import { UIElement } from "igniteui-angular-core";
import { PropertyMetadata } from "igniteui-angular-core";
import { Visibility_$type } from "igniteui-angular-core";
import { OthersCategoryType_$type } from "igniteui-angular-core";
import { BrushCollection } from "igniteui-angular-core";
import { isNaN_, isInfinity, intDivide } from "igniteui-angular-core";
import { ILegendSeries_$type } from "igniteui-angular-core";
import { ILegendTemplateProvider_$type } from "igniteui-angular-core";
import { LabelsPosition_$type } from "./LabelsPosition";
import { Style } from "igniteui-angular-core";
import { LeaderLineType_$type } from "./LeaderLineType";
import { DataTemplate } from "igniteui-angular-core";
import { ILegendOwner_$type } from "igniteui-angular-core";
import { SRProvider } from "igniteui-angular-core";
import { PropertyUpdatedEventArgs } from "igniteui-angular-core";
import { stringIsNullOrWhiteSpace } from "igniteui-angular-core";
import { Size } from "igniteui-angular-core";
import { ObservableCollection$1 } from "igniteui-angular-core";
import { DomRenderer_$type } from "igniteui-angular-core";
import { DeviceUtils } from "igniteui-angular-core";
import { Rect } from "igniteui-angular-core";
import { HoleDimensionsChangedEventArgs } from "./HoleDimensionsChangedEventArgs";
import { DoughnutChartVisualData } from "./DoughnutChartVisualData";
import { RingSeriesVisualDataList } from "./RingSeriesVisualDataList";
import { RectData } from "igniteui-angular-core";
import { Dictionary$2 } from "igniteui-angular-core";
import { PieLegendTemplates } from "./PieLegendTemplates";
import { BrushUtil } from "igniteui-angular-core";
import { FontUtil } from "igniteui-angular-core";
import { DOMEventProxy } from "igniteui-angular-core";
import { SliceVisualData } from "./SliceVisualData";
import { RingSeriesVisualData } from "./RingSeriesVisualData";
import { RingVisualDataList } from "./RingVisualDataList";
import { RingVisualData } from "./RingVisualData";
import { ArcVisualDataList } from "./ArcVisualDataList";
import { ArcVisualData } from "./ArcVisualData";
import { SliceVisualDataList } from "./SliceVisualDataList";
import { PointData } from "igniteui-angular-core";
import { AppearanceHelper } from "igniteui-angular-core";
import { PathVisualData } from "igniteui-angular-core";
import { DoughnutChartLabelVisualData } from "./DoughnutChartLabelVisualData";
import { RectUtil } from "igniteui-angular-core";
import { SizeData } from "igniteui-angular-core";
/**
* @hidden
*/
var Arc = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(Arc, _super);
function Arc() {
var _this = _super.call(this) || this;
_this.jh = null;
_this.jf = null;
_this.jk = 0;
_this.ab = Arc.$;
return _this;
}
Arc.prototype.a3 = function () {
return new ArcView(this);
};
Arc.prototype.go = function (a) {
_super.prototype.go.call(this, a);
this.jg = a;
};
Object.defineProperty(Arc.prototype, "ji", {
get: function () {
return this.jh;
},
set: function (a) {
var b = this.jh;
this.jh = a;
this.jg.b8(b, this.jh);
},
enumerable: false,
configurable: true
});
Object.defineProperty(Arc.prototype, "jl", {
get: function () {
if (this.ji != null) {
return this.ji.i;
}
return 0;
},
enumerable: false,
configurable: true
});
Arc.prototype.gk = function (a, b) {
_super.prototype.gk.call(this, a, b);
if (this.ji != null) {
this.ji.c.ax.bu(a, b);
}
};
Arc.prototype.fz = function (a, b) {
if (this.ji != null && this.ji.d != null) {
_super.prototype.fz.call(this, a, b);
var c = this.jj(a);
if (c != null) {
this.ji.d.bj(c, b);
}
}
};
Arc.prototype.g2 = function (a, b) {
if (this.ji != null && this.ji.d != null) {
_super.prototype.g2.call(this, a, b);
var c = this.jj(a);
if (c != null) {
this.ji.d.b5(c, b);
}
}
};
Arc.prototype.jj = function (a) {
var e_1, _a;
try {
for (var _b = __values(fromEnum(this.jf.g)), _c = _b.next(); !_c.done; _c = _b.next()) {
var b = _c.value;
if (b.b == a) {
return b;
}
}
}
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;
}
}
return null;
};
Arc.prototype.g1 = function (a) {
if (this.b9) {
this.gr();
this.gz();
this.gy();
}
};
Arc.prototype.gr = function () {
if (this.actualItemsSource == null || this.bm == null) {
this.bx.count = 0;
return;
}
var a = this.co.count;
var b = this.cn.count > 0;
var c = PieChartBase.dh(this.c4);
var d = PieChartBase.dh(this.c4);
this.dm = a;
if (b) {
a++;
}
for (var e = 0; e < a; e++) {
var f = false;
var g = void 0;
if (e == a - 1 && b) {
g = this.de;
f = true;
}
else {
g = this.bv.item(this.co._inner[e]);
}
if (this.i3 == 1) {
d += PieChartBase.dh(Math.abs(g) * this.jm / this.dj);
}
else {
d -= PieChartBase.dh(Math.abs(g) * this.jm / this.dj);
}
var h = this.bx.item(e);
if (this.c1 >= 100) {
h._visibility = 1;
}
else {
h._visibility = 0;
}
h.aw = true;
h.a3 = c;
h.ax = d;
h.a1 = h.a0 = this.c1;
h.isOthersSlice = f;
h.ay = this.c0;
h.a5 = e;
h.dataContext = f ? this.cm : this.bm.item(this.co._inner[e]);
h.isExploded = this.explodedSlices.contains(e);
h.isSelected = this.selectedSlices.contains(e);
c = d;
h.aw = false;
}
this.bx.count = a;
if (this.jf != null) {
this.jf.q(this);
}
};
Arc.prototype.gy = function () {
var e_2, _a;
var _this = this;
var a = typeCast(IChartLegend_$type, this.legend);
if (a == null) {
return;
}
if (this.br == null || this.br.count == 0 || ((this.ji != null && this.ji.c != null) && (this.ji.d != null && !this.ji.d.series.contains(this.ji.c)))) {
a.clearLegendItemsForSeries(this.ji.c);
return;
}
this.cl = new List$1(UIElement.$, 0);
var _loop_1 = function (b) {
var c = new ContentControl();
var d = this_1.dp(b);
var e = b.b0;
var f = b.isOthersSlice ? this_1.e6 : (this_1.bs != null && this_1.bs.count > 0) ? this_1.bs.item(this_1.co._inner[b.a5]) : null;
f = (f == null && this_1.br.count > 0) ? this_1.br.item(this_1.co._inner[b.a5]) : f;
c.content = ((function () {
var $ret = new PieSliceDataContext();
$ret.series = _this.ji.c;
$ret.slice = b;
$ret.item = b.dataContext;
$ret.itemBrush = e;
$ret.legendLabel = f != null ? f.toString() : null;
$ret.itemLabel = d != null ? d.toString() : null;
$ret.percentValue = _this.c9(b);
$ret.isOthersSlice = b.isOthersSlice;
return $ret;
})());
var g = c.content;
if (this_1.a6 != null) {
var h = this_1.a6(g);
if (h != null) {
g.legendLabel = h.toString();
}
}
if (this_1.aq != null && !g.isOthersSlice) {
var i = this_1.aq.i(g);
g.legendLabel = i;
}
if (this_1.ar != null && g.isOthersSlice) {
var j = this_1.ar.i(g);
g.legendLabel = j;
}
if (this_1.legendItemTemplate != null) {
c.ah = this_1.legendItemTemplate;
}
this_1.cl.add(c);
};
var this_1 = this;
try {
for (var _b = __values(fromEnum(this.bx.a)), _c = _b.next(); !_c.done; _c = _b.next()) {
var b = _c.value;
_loop_1(b);
}
}
catch (e_2_1) {
e_2 = { error: e_2_1 };
}
finally {
try {
if (_c && !_c.done && (_a = _b.return))
_a.call(_b);
}
finally {
if (e_2)
throw e_2.error;
}
}
if (a.isItemwise) {
var k = a;
k.createLegendItemsInsert(this.cl, this.ji.c);
}
};
Arc.prototype.gs = function (a, b, c, d) {
_super.prototype.gs.call(this, a, b, c, d);
switch (b) {
case Arc.$$p[0]:
this.jk = d;
this.gr();
this.gq();
this.gz();
this.gx();
break;
case "RadiusFactor":
if (this.ji != null && this.ji.d != null) {
this.ji.d.bw();
}
break;
case "Legend":
var e = typeCast(IChartLegend_$type, c);
if (e != null && this.ji != null && this.ji.c != null) {
e.clearLegendItemsForSeries(this.ji.c);
}
break;
}
};
Arc.prototype.jn = function () {
return this.a4.ad();
};
Arc.$t = markType(Arc, 'Arc', PieChartBase.$);
Arc.$$p = markDep(DependencyProperty, PropertyMetadata, Arc, 'gu', ['EndAngle:jm:jp', [1, 360]]);
return Arc;
}(PieChartBase));
export { Arc };
/**
* @hidden
*/
var ArcItem = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(ArcItem, _super);
function ArcItem() {
var _this = _super.call(this) || this;
_this.d = null;
_this.b = null;
_this.n = null;
_this.l = 0;
_this.m = 0;
_this.k = 0;
_this.i = 0;
_this.j = 0;
_this.c = 0;
_this.a = null;
_this.g = null;
_this.e = null;
_this.h = null;
_this.k = 0;
_this.i = 360;
_this.g = new List$1(SliceItem.$, 0);
return _this;
}
ArcItem.prototype.o = function (a, b) {
var e_3, _a;
var c = 0;
var d = 0;
var e = new List$1(Number_$type, 0);
var f = new List$1(Number_$type, 0);
var g = new List$1(Base.$, 0);
this.g.clear();
if (this.h == null) {
return;
}
var h = new FastItemsSource();
h.e = this.h;
var i = this.f(h, this.n);
if (i == null || i.count == 0) {
h.deregisterColumn(i);
h.m();
return;
}
try {
for (var _b = __values(fromEnum(i)), _c = _b.next(); !_c.done; _c = _b.next()) {
var j = _c.value;
if (isNaN_(j) || isInfinity(j) || j <= 0) {
continue;
}
c = c + j;
}
}
catch (e_3_1) {
e_3 = { error: e_3_1 };
}
finally {
try {
if (_c && !_c.done && (_a = _b.return))
_a.call(_b);
}
finally {
if (e_3)
throw e_3.error;
}
}
for (var k = 0; k < i.count; k++) {
var l = i.item(k);
if (isNaN_(l) || isInfinity(l) || l <= 0) {
continue;
}
var m = this.c == 1 ? l / c : l;
var n = this.c == 1 ? this.j / 100 : this.j;
if (m <= n) {
d = d + l;
f.add(k);
g.add1(h.item(k));
}
else {
e.add(k);
}
}
var o = e.count;
var p = f.count > 0;
var q = PieChartBase.dh(a);
var r = PieChartBase.dh(a);
if (p) {
o++;
}
var _loop_2 = function (s) {
var t = false;
var u = void 0;
if (s == o - 1 && p) {
u = d;
t = true;
}
else {
u = i.item(e._inner[s]);
}
var v = 1;
if (v == 1) {
r += PieChartBase.dh(Math.abs(u) * b / c);
}
else {
r -= PieChartBase.dh(Math.abs(u) * b / c);
}
this_2.g.add(((function () {
var $ret = new SliceItem();
$ret.e = q;
$ret.d = r - q;
$ret.g = t ? g : h.item(e._inner[s]);
return $ret;
})()));
q = r;
};
var this_2 = this;
for (var s = 0; s < o; s++) {
_loop_2(s);
}
h.deregisterColumn(i);
h.m();
};
ArcItem.prototype.f = function (a, b) {
var c = null;
return a.registerColumn(b, c, false);
};
ArcItem.prototype.p = function (a) {
var b = this.e == null ? a : this.e.e;
var c = this.e == null ? 360 : this.e.d;
this.o(b, c);
};
ArcItem.prototype.q = function (a) {
var _this = this;
this.g.clear();
var _loop_3 = function (b) {
var c = a.bx.item(b);
this_3.g.add(((function () {
var $ret = new SliceItem();
$ret.e = c.a3;
$ret.d = c.ax - c.a3;
$ret.f = b;
$ret.a = _this;
$ret.g = c.dataContext;
$ret.c = c.isOthersSlice;
$ret.b = c;
return $ret;
})()));
};
var this_3 = this;
for (var b = 0; b < a.bx.count; b++) {
_loop_3(b);
}
};
ArcItem.$t = markType(ArcItem, 'ArcItem');
return ArcItem;
}(Base));
export { ArcItem };
/**
* @hidden
*/
var RingSeriesBase = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(RingSeriesBase, _super);
function RingSeriesBase() {
var _this = _super.call(this) || this;
_this.as = null;
_this.ax = null;
_this.propertyChanged = null;
_this.propertyUpdated = null;
_this.bd = null;
_this.a2 = false;
_this.a1 = false;
_this.bb = null;
_this.eh = null;
_this.aw = null;
_this.c9 = null;
_this.az = null;
_this.eh = { $type: Point_$type, x: 0, y: 0 };
_this.as = function (a, b) { return _this.c4(a, b.propertyName, b.oldValue, b.newValue); };
_this.propertyUpdated = delegateCombine(_this.propertyUpdated, _this.as);
_this.aw = _this.av();
_this.c1(_this.aw);
_this.aw.k();
_this.bb = function (a, b) { return _this.cv(b.action, b.position, b.count, b.propertyName); };
return _this;
}
RingSeriesBase.prototype.c6 = function (a, b, c) {
if (this.propertyChanged != null) {
this.propertyChanged(this, new PropertyChangedEventArgs(a));
}
if (this.propertyUpdated != null) {
this.propertyUpdated(this, new PropertyUpdatedEventArgs(a, b, c));
}
};
Object.defineProperty(RingSeriesBase.prototype, "el", {
get: function () {
if (this.ek != null) {
return this.ek;
}
if (this.ax != null && this.ax.cg != null) {
return this.ax.cg;
}
return null;
},
set: function (a) {
var b = this.el;
if (this.ek != null && a != this.ek) {
a = this.ek;
}
this.c6("SelectedStyleResolved", b, a);
},
enumerable: false,
configurable: true
});
Object.defineProperty(RingSeriesBase.prototype, "co", {
get: function () {
return this.bd;
},
set: function (a) {
var b = this.bd;
this.bd = a;
this.c6("TextStyle", b, a);
},
enumerable: false,
configurable: true
});
Object.defineProperty(RingSeriesBase.prototype, "da", {
get: function () {
return typeCast(DataTemplate.$, this.c(RingSeriesBase.dp));
},
set: function (a) {
this.h(RingSeriesBase.dp, a);
},
enumerable: false,
configurable: true
});
Object.defineProperty(RingSeriesBase.prototype, "a3", {
get: function () {
return this.c(RingSeriesBase.df);
},
set: function (a) {
this.a2 = true;
this.h(RingSeriesBase.df, a);
},
enumerable: false,
configurable: true
});
Object.defineProperty(RingSeriesBase.prototype, "a4", {
get: function () {
if (!this.a2) {
return this.ax.ax;
}
else {
return this.a3;
}
},
enumerable: false,
configurable: true
});
RingSeriesBase.prototype.c4 = function (a, b, c, d) {
if (b == RingSeriesBase.$$p[4]) {
this.ay = ((function () {
var $ret = new FastItemsSource();
$ret.e = d;
return $ret;
})());
}
if (b == RingSeriesBase.$$p[1]) {
if (typeCast(FastItemsSource.$, c) != null) {
var e = (typeCast(FastItemsSource.$, c));
e.event = delegateRemove(e.event, this.bb);
this.a1 = false;
}
if (typeCast(FastItemsSource.$, d) != null) {
var f = (typeCast(FastItemsSource.$, d));
f.event = delegateCombine(f.event, this.bb);
this.a1 = true;
}
this.c3();
}
switch (b) {
case RingSeriesBase.$$p[32]:
this.el = d;
break;
case RingSeriesBase.$$p[36]:
this.c3();
break;
case RingSeriesBase.$$p[23]:
this.c3();
break;
}
};
Object.defineProperty(RingSeriesBase.prototype, "container", {
get: function () {
return this.ax;
},
enumerable: false,
configurable: true
});
Object.defineProperty(RingSeriesBase.prototype, "isStacked", {
get: function () {
return false;
},
enumerable: false,
configurable: true
});
Object.defineProperty(RingSeriesBase.prototype, "isVertical", {
get: function () {
return false;
},
enumerable: false,
configurable: true
});
Object.defineProperty(RingSeriesBase.prototype, "isUsableInLegend", {
get: function () {
return true;
},
enumerable: false,
configurable: true
});
Object.defineProperty(RingSeriesBase.prototype, "hasMarkers", {
get: function () {
return false;
},
enumerable: false,
configurable: true
});
Object.defineProperty(RingSeriesBase.prototype, "hasSubItems", {
get: function () {
return false;
},
enumerable: false,
configurable: true
});
RingSeriesBase.prototype.cv = function (a, b, c, d) {
this.c3();
};
RingSeriesBase.prototype.av = function () {
return new RingSeriesBaseView(this);
};
RingSeriesBase.prototype.c1 = function (a) {
};
RingSeriesBase.prototype.c5 = function (a) {
this.aw.n(a);
};
RingSeriesBase.prototype.cu = function () {
if (this.aw != null) {
this.aw.i();
}
};
Object.defineProperty(RingSeriesBase.prototype, "isFragment", {
get: function () {
return false;
},
enumerable: false,
configurable: true
});
Object.defineProperty(RingSeriesBase.prototype, "isLayer", {
get: function () {
return false;
},
enumerable: false,
configurable: true
});
RingSeriesBase.prototype.cy = function (a, b) {
this.cw(new NotifyCollectionChangedEventArgs(1, 0, b, a));
};
RingSeriesBase.prototype.c0 = function (a, b, c) {
this.cw(new NotifyCollectionChangedEventArgs(2, 2, c, b, a));
};
RingSeriesBase.prototype.cx = function () {
this.cw(new NotifyCollectionChangedEventArgs(0, 4));
};
RingSeriesBase.prototype.cz = function (a, b) {
this.cw(new NotifyCollectionChangedEventArgs(1, 1, b, a));
};
RingSeriesBase.prototype.cw = function (a) {
if (this.ay != null) {
this.ay.handleCollectionChanged(a);
}
};
RingSeriesBase.prototype.resolveLegendIndex = function () {
return -1;
};
RingSeriesBase.prototype.forSubItems = function (a) {
};
Object.defineProperty(RingSeriesBase.prototype, "a0", {
get: function () {
if (this.az == null) {
this.az = new SRProvider(this.aw.g);
}
return this.az;
},
enumerable: false,
configurable: true
});
RingSeriesBase.prototype.cj = function () {
var a = this.a0.b7;
if (stringIsNullOrWhiteSpace(a)) {
a = "Others";
}
return this.ca != null ? this.ca : a;
};
RingSeriesBase.$t = markType(RingSeriesBase, 'RingSeriesBase', Control.$, [INotifyPropertyChanged_$type, ILegendSeries_$type, ILegendTemplateProvider_$type]);
RingSeriesBase.dp = DependencyProperty.i("LabelTemplate", DataTemplate.$, RingSeriesBase.$, new PropertyMetadata(2, null, function (a, b) { return (typeCast(RingSeriesBase.$, a)).c6("LabelTemplate", b.oldValue, b.newValue); }));
RingSeriesBase.df = DependencyProperty.i("IsSurfaceInteractionDisabled", Boolean_$type, RingSeriesBase.$, new PropertyMetadata(2, false, function (a, b) { return a.c6("IsSurfaceInteractionDisabled", b.oldValue, b.newValue); }));
RingSeriesBase.$$p = markDep(DependencyProperty, PropertyMetadata, RingSeriesBase, 'c6', ['Brushes:ak:db', [BrushCollection.$, null], 'FastItemsSource:ay:dc', [FastItemsSource.$], 'FormatLabel:aq:dd', [Delegate_$type], 'FormatLegendLabel:ar:de', [Delegate_$type], 'ItemsSource::dg', [IEnumerable_$type, null], 'LabelExtent:a6:dh', [1, 10], 'LabelFormat:bl:di', [2, null], 'LabelFormatSpecifiers:ag:dj', [Array_$type, null], 'LabelInnerColor:ef:dk', [Brush.$, null], 'LabelMemberPath:bp:dl', [2], 'LabelOuterColor:eg:dm', [Brush.$, null], 'LabelsPosition:an:dn', [LabelsPosition_$type, enumGetBox(LabelsPosition_$type, 1)], 'LeaderLineMargin:a7:dq', [1, 6], 'LeaderLineStyle:ei:dr', [Style.$, null], 'LeaderLineType:ao:ds', [LeaderLineType_$type, enumGetBox(LeaderLineType_$type, 0)], 'LeaderLineVisibility:en:dt', [Visibility_$type, enumGetBox(Visibility_$type, 0)], 'LegendItemBadgeTemplate::du', [DataTemplate.$, null], 'LegendItemTemplate::dv', [DataTemplate.$, null], 'LegendLabelFormat:b0:dw', [2, null], 'LegendLabelFormatSpecifiers:ah:dx', [Array_$type, null], 'LegendLabelMemberPath:b3:dy', [2], 'LegendOthersLabelFormat:b5:dz', [2, null], 'LegendOthersLabelFormatSpecifiers:ai:d0', [Array_$type, null], 'Legend::d1', [IChartLegend_$type, null], 'OthersCategoryStyle:ej:d2', [Style.$, null], 'OthersCategoryText:ca:d3', [2, null], 'OthersCategoryThreshold:a8:d4', [1, 3], 'OthersCategoryType:ap:d5', [OthersCategoryType_$type, enumGetBox(OthersCategoryType_$type, 1)], 'OthersLabelFormat:ce:d6', [2, null], 'OthersLabelFormatSpecifiers:aj:d7', [Array_$type, null], 'Outlines:al:d8', [BrushCollection.$, null], 'RadiusFactor:a9:d9', [1, 0.9], 'SelectedStyle:ek:ea', [Style.$, null], 'StartAngle:ba:eb', [1, 0], 'ToolTip::ec', [4, null], 'ToolTipStyle:em:ed', [Style.$, null], 'ValueMemberPath:cs:ee', [2, null]]);
return RingSeriesBase;
}(Control));
export { RingSeriesBase };
/**
* @hidden
*/
var Ring = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(Ring, _super);
function Ring() {
var _this = _super.call(this) || this;
_this.j = 0;
_this.h = 0;
_this.q = new Size();
_this.p = null;
_this._ringControl = null;
_this.b = null;
_this.i = 0;
_this.g = null;
_this.d = null;
_this.e = false;
_this.p = { $type: Point_$type, x: 0, y: 0 };
_this.q = new Size(1, 0, 0);
_this.ringControl = ((function () {
var $ret = new RingControl();
$ret.ai = _this;
return $ret;
})());
_this.g = new List$1(ArcItem.$, 0);
_this.e = true;
return _this;
}
Object.defineProperty(Ring.prototype, "ringControl", {
get: function () {
return this._ringControl;
},
set: function (a) {
this._ringControl = a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(Ring.prototype, "c", {
get: function () {
return this.b;
},
set: function (a) {
this.b = a;
this.b.aw.h(this.ringControl);
if (this.ringControl != null) {
this.ringControl.ak.s(a);
}
},
enumerable: false,
configurable: true
});
Ring.prototype.f = function () {
if (this.ringControl != null && this.ringControl.ak.d()) {
var a = void 0, b = void 0;
a = this.p.x - this.c.eh.x;
b = this.p.y - this.c.eh.y;
this.ringControl.ak.v(a, b);
return this.ringControl.an();
}
return false;
};
Ring.prototype.o = function () {
if (this.ringControl != null) {
this.ringControl.width = this.q.width;
this.ringControl.height = this.q.height;
this.c.aw.h(this.ringControl);
this.ringControl.ao = this.g;
}
};
Ring.prototype.l = function (source_, a, b) {
this.ringControl.as(source_, a, b);
};
Ring.prototype.k = function (source_) {
this.ringControl.ar(source_);
};
Ring.prototype.m = function (source_, a, b) {
this.ringControl.at(source_, a, b);
};
Ring.prototype.n = function (source_, a, b, c) {
this.ringControl.au(source_, a, b, c);
};
Ring.$t = markType(Ring, 'Ring');
return Ring;
}(Base));
export { Ring };
/**
* @hidden
*/
var RingCollection = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(RingCollection, _super);
function RingCollection() {
return _super.call(this, Ring.$, 0) || this;
}
RingCollection.prototype.p = function () {
var e_4, _a;
try {
for (var _b = __values(fromEnum(this)), _c = _b.next(); !_c.done; _c = _b.next()) {
var a = _c.value;
if (a.e) {
var b = 0;
var c = a.ringControl.arcs.count;
while (b < c) {
a.ringControl.arcs.destroy(a.ringControl.arcs.item(b));
b++;
}
a.ringControl.arcs.count = 0;
a.ringControl = null;
}
}
}
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;
}
}
_super.prototype.p.call(this);
};
RingCollection.prototype.u = function (a) {
var b = this._inner[a];
if (b.e) {
b.ringControl.arcs.destroy(b.ringControl.arcs.item(a));
b.ringControl.arcs.count = 0;
b.ringControl = null;
}
_super.prototype.u.call(this, a);
};
RingCollection.$t = markType(RingCollection, 'RingCollection', ObservableCollection$1.$.specialize(Ring.$));
return RingCollection;
}(ObservableCollection$1));
export { RingCollection };
/**
* @hidden
*/
var RingControl = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(RingControl, _super);
function RingControl() {
var _this = _super.call(this) || this;
_this.ak = null;
_this.ah = null;
_this.arcs = null;
_this.ao = null;
_this.a0 = null;
_this.propertyChanged = null;
_this.propertyUpdated = null;
_this.ab = RingControl.$;
_this.ak = _this.aj();
_this.ax(_this.ak);
_this.ak.r();
_this.arcs = ((function () {
var $ret = new Pool$1(Arc.$);
$ret.create = runOn(_this.ak, _this.ak.a);
$ret.activate = runOn(_this.ak, _this.ak.l);
$ret.disactivate = runOn(_this.ak, _this.ak.n);
$ret.destroy = runOn(_this.ak, _this.ak.m);
return $ret;
})());
return _this;
}
Object.defineProperty(RingControl.prototype, "al", {
get: function () {
return this.ai.c;
},
enumerable: false,
configurable: true
});
Object.defineProperty(RingControl.prototype, "ai", {
get: function () {
return this.ah;
},
set: function (a) {
this.ah = a;
if (this.ah == null) {
this.ak.s(null);
}
else {
this.ak.s(this.ah.c);
}
},
enumerable: false,
configurable: true
});
RingControl.prototype.aj = function () {
return new RingControlView(this);
};
RingControl.prototype.ax = function (a) {
};
RingControl.prototype.az = function (a, b, c) {
if (this.propertyChanged != null) {
this.propertyChanged(this, new PropertyChangedEventArgs(a));
}
if (this.propertyUpdated != null) {
this.propertyUpdated(this, new PropertyUpdatedEventArgs(a, b, c));
}
};
RingControl.prototype.aw = function () {
this.an();
};
RingControl.prototype.an = function () {
var e_5, _a;
if (this.ao == null) {
return false;
}
if (!this.ak.d()) {
return false;
}
var a = 0;
var b = false;
try {
for (var _b = __values(fromEnum(this.ao)), _c = _b.next(); !_c.done; _c = _b.next()) {
var c = _c.value;
var d = this.arcs.item(a);
d.jf = c;
if (d.da != this.ai.h) {
d.da = this.ai.h;
}
if ((d.width != this.ai.q.width || d.height != this.ai.q.height) && d.a4.s()) {
d.width = this.ai.q.width;
d.height = this.ai.q.height;
this.ak.ab(d);
b = true;
}
if (d.di != c.k) {
d.di = c.k;
}
if (d.jm != c.i) {
d.jm = c.i;
}
if (d.itemsSource != c.h) {
d.itemsSource = c.h;
}
if (d.am != c.a) {
d.am = c.a;
}
this.ak.t(d, 0, 0);
a++;
}
}
catch (e_5_1) {
e_5 = { error: e_5_1 };
}
finally {
try {
if (_c && !_c.done && (_a = _b.return))
_a.call(_b);
}
finally {
if (e_5)
throw e_5.error;
}
}
this.arcs.count = a;
return b;
};
RingControl.prototype.ay = function (a) {
this.ak.w(a);
};
RingControl.prototype.av = function () {
this.ak.q();
};
RingControl.prototype.ap = function () {
return this.ak.j();
};
RingControl.prototype.as = function (source_, a, b) {
for (var c = 0; c < this.arcs.count; c++) {
this.arcs.item(c).f7(source_, a, b);
}
};
RingControl.prototype.ar = function (source_) {
for (var a = 0; a < this.arcs.count; a++) {
this.arcs.item(a).f5(source_);
}
};
RingControl.prototype.at = function (source_, a, b) {
for (var c = 0; c < this.arcs.count; c++) {
this.arcs.item(c).f8(source_, a, b);
}
};
RingControl.prototype.au = function (source_, a, b, c) {
for (var d = 0; d < this.arcs.count; d++) {
this.arcs.item(d).f9(source_, a, b, c);
}
};
RingControl.$t = markType(RingControl, 'RingControl', Control.$, [INotifyPropertyChanged_$type]);
return RingControl;
}(Control));
export { RingControl };
/**
* @hidden
*/
var RingSeriesCollection = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(RingSeriesCollection, _super);
function RingSeriesCollection() {
return _super.call(this, RingSeriesBase.$, 0) || this;
}
RingSeriesCollection.$t = markType(RingSeriesCollection, 'RingSeriesCollection', ObservableCollection$1.$.specialize(RingSeriesBase.$));
return RingSeriesCollection;
}(ObservableCollection$1));
export { RingSeriesCollection };
/**
* @hidden
*/
var SliceItem = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(SliceItem, _super);
function SliceItem() {
var _this = _super.call(this) || this;
_this.e = 0;
_this.d = 0;
_this.a = null;
_this.f = 0;
_this.b = null;
_this.g = null;
_this.c = false;
return _this;
}
SliceItem.$t = markType(SliceItem, 'SliceItem');
return SliceItem;
}(Base));
export { SliceItem };
/**
* @hidden
*/
var SliceCollection = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(SliceCollection, _super);
function SliceCollection() {
var _this = _super.call(this, SliceItem.$, 0) || this;
_this.ae = false;
_this.ag = false;
return _this;
}
SliceCollection.prototype.r = function (a, b) {
if (this.contains(b)) {
return;
}
var c = this.ah(b.b);
if (c != -1) {
_super.prototype.x.call(this, c, b);
}
else {
_super.prototype.r.call(this, a, b);
if (this.ae) {
if (this.ag) {
b.b.isSelected = true;
}
else {
b.b.isExploded = true;
}
}
}
};
SliceCollection.prototype.x = function (a, b) {
if (this.ae) {
if (this.ag) {
this._inner[a].b.isSelected = false;
}
else {
this._inner[a].b.isExploded = false;
}
}
_super.prototype.x.call(this, a, b);
};
SliceCollection.prototype.u = function (a) {
var b = this._inner[a];
_super.prototype.u.call(this, a);
if (this.ae) {
if (this.ag) {
b.b.isSelected = false;
}
else {
b.b.isExploded = false;
}
}
};
SliceCollection.prototype.remove = function (a) {
var b = this.ah(a.b);
if (b != -1) {
this.u(b);
return true;
}
else {
return false;
}
};
SliceCollection.prototype.p = function () {
while (this.count > 0) {
this.u(0);
}
};
SliceCollection.prototype.ah = function (a) {
for (var b = 0; b < this.count; b++) {
if (this._inner[b].b == a) {
return b;
}
}
return -1;
};
SliceCollection.$t = markType(SliceCollection, 'SliceCollection', ObservableCollection$1.$.specialize(SliceItem.$));
return SliceCollection;
}(ObservableCollection$1));
export { SliceCollection };
/**
* @hidden
*/
var XamDoughnutChart = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(XamDoughnutChart, _super);
function XamDoughnutChart() {
var _this = _super.call(this) || this;
_this.al = new RingSeriesCollection();
_this.aj = new RingCollection();
_this.ap = ((function () {
var $ret = new SliceCollection();
$ret.ae = true;
$ret.ag = true;
return $ret;
})());
_this.ao = ((function () {
var $ret = new SliceCollection();
$ret.ae = true;
$ret.ag = false;
return $ret;
})());
_this.ah = null;
_this.a0 = NaN;
_this.az = 1;
_this.au = null;
_this.sliceClick = null;
_this.propertyChanged = null;
_this.propertyUpdated = null;
_this.holeDimensionsChanged = null;
var a = _this.at();
_this.bv(a);
a.s();
_this.ab = XamDoughnutChart.$;
_this.ah = function (b, c) { return _this.bz(b, c.propertyName, c.oldValue, c.newValue); };
_this.propertyUpdated = delegateCombine(_this.propertyUpdated, _this.ah);
var b = _this.series;
b.collectionChanged = delegateCombine(b.collectionChanged, runOn(_this, _this.b6));
return _this;
}
Object.defineProperty(XamDoughnutChart.prototype, "ak", {
get: function () {
return this.aj;
},
enumerable: false,
configurable: true
});
Object.defineProperty(XamDoughnutChart.prototype, "series", {
get: function () {
return this.al;
},
enumerable: false,
configurable: true
});
XamDoughnutChart.prototype.b6 = function (a, b) {
var e_6, _a;
var c = new List$1(RingSeriesBase.$, 0);
if (b.oldItems != null) {
try {
for (var _b = __values(fromEn(b.oldItems)), _c = _b.next(); !_c.done; _c = _b.next()) {
var d = _c.value;
if (b.newItems == null || !b.newItems.contains(d)) {
d.cu();
this.au.w(d);
}
}
}
catch (e_6_1) {
e_6 = { error: e_6_1 };
}
finally {
try {
if (_c && !_c.done && (_a = _b.return))
_a.call(_b);
}
finally {
if (e_6)
throw e_6.error;
}
}
}
this.bx();
this.b2();
};
Object.defineProperty(XamDoughnutChart.prototype, "a3", {
get: function () {
return this.c(XamDoughnutChart.cc);
},
set: function (a) {
this.h(XamDoughnutChart.cc, a);
},
enumerable: false,
configurable: true
});
Object.defineProperty(XamDoughnutChart.prototype, "ar", {
get: function () {
return this.ap;
},
set: function (a) {
this.ap.clear();
this.ap.ae = false;
this.ap = a;
this.ap.ae = true;
this.ap.ag = true;
for (var b = 0; b < this.ap.count; b++) {
this.ap._inner[b].b.isSelected = true;
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XamDoughnutChart.prototype, "aq", {
get: function () {
return this.ao;
},
set: function (a) {
this.ao.clear();
this.ao.ae = false;
this.ao = a;
this.ao.ae = true;
this.ao.ag = false;
for (var b = 0; b < this.ao.count; b++) {
this.ao._inner[b].b.isExploded = true;
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(XamDoughnutChart.prototype, "a4", {
get: function () {
return this.a0;
},
set: function (a) {
var b = this.a0;
this.a0 = a;
this.b1("PixelScalingRatio", b, this.a0);
},
enumerable: false,
configurable: true
});
Object.defineProperty(XamDoughnutChart.prototype, "a1", {
get: function () {
return this.az;
},
set: function (a) {
var b = this.az;
this.az = a;
this.b1("ActualPixelScalingRatio", b, this.az);
},
enumerable: false,
configurable: true
});
XamDoughnutChart.prototype.destroy = function () {
var e_7, _a;
this.au.v(null);
try {
for (var _b = __values(fromEnum(this.series)), _c = _b.next(); !_c.done; _c = _b.next()) {
var a = _c.value;
a.cu();
}
}
catch (e_7_1) {
e_7 = { error: e_7_1 };
}
finally {
try {
if (_c && !_c.done && (_a = _b.return))
_a.call(_b);
}
finally {
if (e_7)
throw e_7.error;
}
}
};
XamDoughnutChart.prototype.b5 = function (a, b) {
if (b) {
this.ar.add(a);
}
else {
this.ar.remove(a);
}
};
XamDoughnutChart.prototype.bj = function (a, b) {
if (b) {
this.aq.add(a);
}
else {
this.aq.remove(a);
}
};
XamDoughnutChart.prototype.bz = function (a, b, c, d) {
var e_8, _a, e_9, _b, e_10, _c, e_11, _d, e_12, _e;
switch (b) {
case XamDoughnutChart.$$p[5]:
try {
for (var _f = __values(fromEnum(this.series)), _g = _f.next(); !_g.done; _g = _f.next()) {
var e = _g.value;
e.el = d;
}
}
catch (e_8_1) {
e_8 = { error: e_8_1 };
}
finally {
try {
if (_g && !_g.done && (_a = _f.return))
_a.call(_f);
}
finally {
if (e_8)
throw e_8.error;
}
}
break;
case XamDoughnutChart.$$p[0]:
for (var f = 0; f < this.aj.count; f++) {
try {
for (var _h = (e_9 = void 0, __values(fromEnum(this.aj._inner[f].ringControl.arcs.a))), _j = _h.next(); !_j.done; _j = _h.next()) {
var g = _j.value;
g.b8 = this.av;
}
}
catch (e_9_1) {
e_9 = { error: e_9_1 };
}
finally {
try {
if (_j && !_j.done && (_b = _h.return))
_b.call(_h);
}
finally {
if (e_9)
throw e_9.error;
}
}
}
break;
case XamDoughnutChart.$$p[1]:
for (var h = 0; h < this.aj.count; h++) {
try {
for (var _k = (e_10 = void 0, __values(fromEnum(this.aj._inner[h].ringControl.arcs.a))), _l = _k.next(); !_l.done; _l = _k.next()) {
var i = _l.value;
i.b9 = this.aw;
}
}
catch (e_10_1) {
e_10 = { error: e_10_1 };
}
finally {
try {
if (_l && !_l.done && (_c = _k.return))
_c.call(_k);
}
finally {
if (e_10)
throw e_10.error;
}
}
}
break;
case "PixelScalingRatio":
var j = DeviceUtils.a(this.a4);
if (isNaN_(j)) {
this.a1 = 1;
}
else {
this.a1 = j;
}
break;
case "ActualPixelScalingRatio":
try {
for (var _m = __values(fromEnum(this.aj)), _o = _m.next(); !_o.done; _o = _m.next()) {
var k = _o.value;
try {
for (var _p = (e_12 = void 0, __values(fromEnum(k.ringControl.arcs.a))), _q = _p.next(); !_q.done; _q = _p.next()) {
var l = _q.value;
l.c2 = this.a1;
}
}
catch (e_12_1) {
e_12 = { error: e_12_1 };
}
finally {
try {
if (_q && !_q.done && (_e = _p.return))
_e.call(_p);
}
finally {
if (e_12)
throw e_12.error;
}
}
}
}
catch (e_11_1) {
e_11 = { error: e_11_1 };
}
finally {
try {
if (_o && !_o.done && (_d = _m.return))
_d.call(_m);
}