igniteui-angular-charts
Version:
Ignite UI Angular charting components for building rich data visualizations for modern web apps.
667 lines (666 loc) • 22.8 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 { Series } from "./Series";
import { DependencyProperty } from "igniteui-angular-core";
import { Point_$type, Boolean_$type, enumGetBox, runOn, delegateRemove, typeCast, delegateCombine, fromEnum, fromEn, markType, markDep } from "igniteui-angular-core";
import { AnnotationAppearanceMode_$type } from "./AnnotationAppearanceMode";
import { DoubleCollection } from "igniteui-angular-core";
import { SeriesView } from "./SeriesView";
import { XamDataChart } from "./XamDataChart";
import { Tuple$2 } from "igniteui-angular-core";
import { PropertyMetadata } from "igniteui-angular-core";
import { isNaN_ } from "igniteui-angular-core";
/**
* @hidden
*/
var AnnotationLayer = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(AnnotationLayer, _super);
function AnnotationLayer() {
var _this = _super.call(this) || this;
_this.zv = null;
_this.xb = null;
_this.xa = null;
_this.xc = null;
_this.zt = { $type: Point_$type, x: NaN, y: NaN };
_this.xd = false;
_this.zv = { $type: Point_$type, x: NaN, y: NaN };
_this.yy();
return _this;
}
AnnotationLayer.prototype.cs = function () {
return new AnnotationLayerView(this);
};
AnnotationLayer.prototype.q0 = function (a) {
_super.prototype.q0.call(this, a);
this.w9 = a;
};
AnnotationLayer.prototype.xh = function (a) {
if (a == null) {
return false;
}
if (a.es) {
return false;
}
if (a.isValueOverlay) {
return false;
}
if (a == this) {
return false;
}
return a.hd(a.cv.bx, a.cv.by, a.cv);
};
AnnotationLayer.prototype.get_e1 = function () {
return this.xe;
};
AnnotationLayer.prototype.b2 = function () {
if (this.b3 == 0) {
return 1;
}
else {
return _super.prototype.b2.call(this);
}
};
AnnotationLayer.prototype.get_ff = function () {
return this.xj || this.xk;
};
AnnotationLayer.prototype.get_isUsableInLegend = function () {
return this.xk;
};
AnnotationLayer.prototype.q8 = function (a, b, c, d) {
_super.prototype.q8.call(this, a, b, c, d);
switch (b) {
case "SeriesViewer":
var e = c;
var f = d;
if (e != null) {
this.yx(e.series);
var g = e.series;
g.collectionChanged = delegateRemove(g.collectionChanged, runOn(this, this.yu));
if (typeCast(XamDataChart.$, e) !== null) {
var h = e;
this.yw(h.axes);
var i = h.axes;
i.collectionChanged = delegateRemove(i.collectionChanged, runOn(this, this.yk));
}
}
if (f != null) {
this.ys(f.series);
var j = f.series;
j.collectionChanged = delegateCombine(j.collectionChanged, runOn(this, this.yu));
if (typeCast(XamDataChart.$, f) !== null) {
var k = f;
this.yr(k.axes);
var l = k.axes;
l.collectionChanged = delegateCombine(l.collectionChanged, runOn(this, this.yk));
}
}
break;
case AnnotationLayer.$$p[16]:
case AnnotationLayer.$$p[15]:
if (this.ff) {
if (this.index == -1) {
this.index = XamDataChart.yr(this);
}
}
else {
this.index = -1;
this.u8 = null;
this.vc = null;
}
if (this.db != null) {
this.db.pe();
}
this.rq(true);
break;
case "TransitionProgress":
this.xc.c(this.jp, this.xb, this.xa);
if (this.d5(this.cv)) {
return;
}
if (this.jp == 1) {
this.yt(this.xa, this.cv);
this.qn();
}
else {
this.yt(this.xc, this.cv);
}
if (this.db != null) {
this.db.qo(this);
}
break;
case AnnotationLayer.$$p[13]:
if (this.db != null) {
this.db.o8();
}
break;
case AnnotationLayer.$$p[9]:
this.zv = this.zu;
this.qq(this.zu);
break;
case "ShouldRenderAsOverlay":
if (this.db != null) {
this.cv.al(this.db);
this.cv.ag(this.db);
}
break;
case AnnotationLayer.$$p[8]:
case AnnotationLayer.$$p[14]:
case "DashArray":
case AnnotationLayer.$$p[10]:
case AnnotationLayer.$$p[17]:
case AnnotationLayer.$$p[12]:
case AnnotationLayer.$$p[19]:
case AnnotationLayer.$$p[11]:
case AnnotationLayer.$$p[18]:
this.yy();
break;
case AnnotationLayer.$$p[0]:
case AnnotationLayer.$$p[4]:
case AnnotationLayer.$$p[1]:
case AnnotationLayer.$$p[5]:
case AnnotationLayer.$$p[3]:
case AnnotationLayer.$$p[7]:
case AnnotationLayer.$$p[2]:
case AnnotationLayer.$$p[6]:
this.rq(true);
break;
}
};
AnnotationLayer.prototype.yx = function (a) {
var e_1, _a;
try {
for (var _b = __values(fromEnum(a)), _c = _b.next(); !_c.done; _c = _b.next()) {
var b = _c.value;
if (!(b == this)) {
b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.yv));
}
}
}
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;
}
}
this.rq(true);
};
AnnotationLayer.prototype.yw = function (a) {
var e_2, _a;
try {
for (var _b = __values(fromEnum(a)), _c = _b.next(); !_c.done; _c = _b.next()) {
var b = _c.value;
b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.yl));
}
}
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;
}
}
this.rq(true);
};
AnnotationLayer.prototype.ys = function (a) {
var e_3, _a;
try {
for (var _b = __values(fromEnum(a)), _c = _b.next(); !_c.done; _c = _b.next()) {
var b = _c.value;
if (!(b == this)) {
b.renderRequested = delegateCombine(b.renderRequested, runOn(this, this.yv));
}
}
}
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;
}
}
this.rq(true);
};
AnnotationLayer.prototype.yr = function (a) {
var e_4, _a;
try {
for (var _b = __values(fromEnum(a)), _c = _b.next(); !_c.done; _c = _b.next()) {
var b = _c.value;
b.renderRequested = delegateCombine(b.renderRequested, runOn(this, this.yl));
}
}
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;
}
}
this.rq(true);
};
AnnotationLayer.prototype.xf = function (a) {
if (a == null) {
return false;
}
return true;
};
AnnotationLayer.prototype.yl = function (a, b) {
if (this.xf(a)) {
this.yn(a, b.animate);
}
};
AnnotationLayer.prototype.xg = function (a) {
if (a == null) {
return false;
}
if (a.es) {
return false;
}
return true;
};
AnnotationLayer.prototype.yv = function (a, b) {
if (this.xg(a)) {
this.yo(a, b.animate);
}
};
AnnotationLayer.prototype.yn = function (a, b) {
};
AnnotationLayer.prototype.yo = function (a, b) {
};
AnnotationLayer.prototype.yu = function (a, b) {
this.yp(b);
};
AnnotationLayer.prototype.yk = function (a, b) {
this.ym(b);
};
AnnotationLayer.prototype.zj = function () {
if (this.u8 != null) {
return this.u8;
}
return this.ve;
};
AnnotationLayer.prototype.zk = function () {
if (this.vc != null) {
return this.vc;
}
return this.vu;
};
AnnotationLayer.prototype.ym = function (a) {
var e_5, _a, e_6, _b;
if (a.oldItems != null) {
try {
for (var _c = __values(fromEn(a.oldItems)), _d = _c.next(); !_d.done; _d = _c.next()) {
var b = _d.value;
b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.yl));
}
}
catch (e_5_1) {
e_5 = { error: e_5_1 };
}
finally {
try {
if (_d && !_d.done && (_a = _c.return))
_a.call(_c);
}
finally {
if (e_5)
throw e_5.error;
}
}
}
if (a.newItems != null) {
try {
for (var _e = __values(fromEn(a.newItems)), _f = _e.next(); !_f.done; _f = _e.next()) {
var c = _f.value;
c.renderRequested = delegateCombine(c.renderRequested, runOn(this, this.yl));
}
}
catch (e_6_1) {
e_6 = { error: e_6_1 };
}
finally {
try {
if (_f && !_f.done && (_b = _e.return))
_b.call(_e);
}
finally {
if (e_6)
throw e_6.error;
}
}
}
this.rq(true);
};
AnnotationLayer.prototype.yp = function (a) {
var e_7, _a, e_8, _b;
if (a.oldItems != null) {
try {
for (var _c = __values(fromEn(a.oldItems)), _d = _c.next(); !_d.done; _d = _c.next()) {
var b = _d.value;
b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.yv));
}
}
catch (e_7_1) {
e_7 = { error: e_7_1 };
}
finally {
try {
if (_d && !_d.done && (_a = _c.return))
_a.call(_c);
}
finally {
if (e_7)
throw e_7.error;
}
}
}
if (a.newItems != null) {
try {
for (var _e = __values(fromEn(a.newItems)), _f = _e.next(); !_f.done; _f = _e.next()) {
var c = _f.value;
c.renderRequested = delegateCombine(c.renderRequested, runOn(this, this.yv));
}
}
catch (e_8_1) {
e_8 = { error: e_8_1 };
}
finally {
try {
if (_f && !_f.done && (_b = _e.return))
_b.call(_e);
}
finally {
if (e_8)
throw e_8.error;
}
}
}
this.rq(true);
};
AnnotationLayer.prototype.sq = function (a, b) {
this.rq(false);
};
AnnotationLayer.prototype.sp = function (a, b) {
this.rq(true);
};
AnnotationLayer.prototype.rr = function (a) {
_super.prototype.rr.call(this, a);
if (this.d5(this.cv)) {
return;
}
if (this.ge(a) && !this.gq) {
var b = this.xb;
if (this.d3()) {
if (this.dc.g) {
this.dc.t();
}
this.xb = this.xc;
this.xc = b;
}
else {
this.xb = this.xa;
this.xa = b;
}
this.yq(this.xa, this.cv);
this.r6();
}
else {
if (!this.gq) {
this.yq(this.xa, this.cv);
}
this.yt(this.xa, this.cv);
}
};
AnnotationLayer.prototype.get_es = function () {
return true;
};
AnnotationLayer.prototype.yq = function (a, b) {
};
AnnotationLayer.prototype.yt = function (a, b) {
this.qw();
this.w9.b4();
};
AnnotationLayer.prototype.yj = function (a) {
var b = { $type: Point_$type, x: this.zt.x, y: this.zt.y };
if (a.isVertical) {
if (isNaN_(this.zt.y)) {
return new Tuple$2(Boolean_$type, Point_$type, false, b);
}
if (isNaN_(this.zt.x)) {
b.x = 0;
return new Tuple$2(Boolean_$type, Point_$type, true, b);
}
}
else {
if (isNaN_(this.zt.x)) {
return new Tuple$2(Boolean_$type, Point_$type, false, b);
}
if (isNaN_(this.zt.y)) {
b.y = 0;
return new Tuple$2(Boolean_$type, Point_$type, true, b);
}
}
return new Tuple$2(Boolean_$type, Point_$type, true, b);
};
AnnotationLayer.prototype.qq = function (a) {
_super.prototype.qq.call(this, a);
if (isNaN_(this.zv.x) && isNaN_(this.zv.y)) {
if (isNaN_(a.x) && isNaN_(a.y)) {
this.w9.b3();
return;
}
else {
this.w9.b5();
this.zt = a;
}
}
else {
this.w9.b5();
this.zt = this.zv;
}
this.rq(true);
};
AnnotationLayer.prototype.hd = function (a, b, c) {
var d = _super.prototype.hd.call(this, a, b, c);
if (this.db == null) {
return false;
}
if (!this.cv.t()) {
d = false;
return d;
}
return d;
};
AnnotationLayer.prototype.xu = function () {
if (isNaN_(this.xx)) {
switch (this.wx) {
case 1: return this.xo();
case 2: return this.xr();
case 4: return this.xq();
}
}
return this.xx;
};
AnnotationLayer.prototype.xt = function () {
if (isNaN_(this.xw)) {
return this.xm;
}
return this.xw;
};
AnnotationLayer.prototype.xv = function () {
if (isNaN_(this.xy)) {
return this.xm;
}
return this.xy;
};
AnnotationLayer.prototype.w4 = function () {
switch (this.w0) {
case 0: return this.w1();
}
return this.w0;
};
AnnotationLayer.prototype.w5 = function () {
switch (this.w7) {
case 0: return this.wx;
}
return this.w7;
};
AnnotationLayer.prototype.w6 = function () {
switch (this.w8) {
case 0: return this.wx;
}
return this.w8;
};
AnnotationLayer.prototype.zp = function () {
if (this.zr == null) {
if (this.v1 == null) {
return this.zn();
}
return this.v1;
}
return this.zr;
};
AnnotationLayer.prototype.zq = function () {
if (this.zs == null) {
if (this.v1 == null) {
return this.zo();
}
return this.v1;
}
return this.zs;
};
AnnotationLayer.prototype.w1 = function () {
return 0;
};
AnnotationLayer.prototype.w2 = function () {
return this.w1();
};
AnnotationLayer.prototype.w3 = function () {
return this.w1();
};
AnnotationLayer.prototype.xo = function () {
return NaN;
};
AnnotationLayer.prototype.xr = function () {
return NaN;
};
AnnotationLayer.prototype.xq = function () {
return NaN;
};
AnnotationLayer.prototype.xp = function () {
return NaN;
};
AnnotationLayer.prototype.xs = function () {
return NaN;
};
AnnotationLayer.prototype.zn = function () {
return null;
};
AnnotationLayer.prototype.zo = function () {
return null;
};
AnnotationLayer.prototype.yy = function () {
this.wx = this.w4();
this.xm = this.xu();
this.wy = this.w5();
this.xl = this.xt();
this.wz = this.w6();
this.xn = this.xv();
this.zl = this.zp();
this.zm = this.zq();
};
AnnotationLayer.prototype.get_g9 = function () {
return this.xi;
};
Object.defineProperty(AnnotationLayer.prototype, "xi", {
get: function () {
return this.xd;
},
set: function (a) {
var b = this.xd;
this.xd = a;
this.raisePropertyChanged("ShouldRenderAsOverlay", b, this.xd);
},
enumerable: false,
configurable: true
});
AnnotationLayer.$t = markType(AnnotationLayer, 'AnnotationLayer', Series.$);
AnnotationLayer.$$p = markDep(DependencyProperty, PropertyMetadata, AnnotationLayer, 'raisePropertyChanged', ['ActualAppearanceMode:wx:yz', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualHorizontalAppearanceMode:wy:y0', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualHorizontalDashArray:zl:y1', [DoubleCollection.$], 'ActualHorizontalShiftAmount:xl:y2', [1, NaN], 'ActualShiftAmount:xm:y3', [1, NaN], 'ActualVerticalAppearanceMode:wz:y4', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualVerticalDashArray:zm:y5', [DoubleCollection.$], 'ActualVerticalShiftAmount:xn:y6', [1, NaN], 'AppearanceMode:w0:y7', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'CursorPosition:zu:y8', [Point_$type, { $type: Point_$type, x: NaN, y: NaN }], 'HorizontalAppearanceMode:w7:y9', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'HorizontalDashArray:zr:za', [DoubleCollection.$], 'HorizontalShiftAmount:xw:zb', [1, NaN], 'IsDefaultCrosshairDisabled:xe:zc', [0, true], 'ShiftAmount:xx:zd', [1, NaN], 'UseIndex:xj:ze', [0, false], 'UseLegend:xk:zf', [0, false], 'VerticalAppearanceMode:w8:zg', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'VerticalDashArray:zs:zh', [DoubleCollection.$], 'VerticalShiftAmount:xy:zi', [1, NaN]]);
return AnnotationLayer;
}(Series));
export { AnnotationLayer };
/**
* @hidden
*/
var AnnotationLayerView = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(AnnotationLayerView, _super);
function AnnotationLayerView(a) {
var _this = _super.call(this, a) || this;
_this.b0 = null;
_this.b1 = false;
_this.b2 = -1;
_this.b0 = a;
return _this;
}
AnnotationLayerView.prototype.b6 = function () {
if (this.b1) {
this.b1 = false;
this.b2 = -1;
this.b0.zt = { $type: Point_$type, x: NaN, y: NaN };
this.b0.rq(true);
}
};
AnnotationLayerView.prototype.b3 = function () {
this.b1 = true;
if (this.e.jy != null) {
this.e.jy.setTimeout(runOn(this, this.b6), 300);
}
else {
this.b2 = window.setTimeout(runOn(this, this.b6), 300);
}
};
AnnotationLayerView.prototype.b5 = function () {
if (this.b1 == true) {
this.b1 = false;
if (this.b2 != -1) {
window.clearTimeout(this.b2);
this.b2 = -1;
}
}
};
AnnotationLayerView.prototype.b4 = function () {
this.as();
};
AnnotationLayerView.$t = markType(AnnotationLayerView, 'AnnotationLayerView', SeriesView.$);
return AnnotationLayerView;
}(SeriesView));
export { AnnotationLayerView };