igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
681 lines (680 loc) • 22.5 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-react-core";
import { Point_$type, enumGetBox, runOn, delegateRemove, typeCast, delegateCombine, fromEnum, fromEn, markType, markDep } from "igniteui-react-core";
import { AnnotationAppearanceMode_$type } from "./AnnotationAppearanceMode";
import { DoubleCollection } from "igniteui-react-core";
import { PenLineCap_$type } from "igniteui-react-core";
import { SeriesView } from "./SeriesView";
import { XamDataChart } from "./XamDataChart";
import { Brush } from "igniteui-react-core";
import { PropertyMetadata } from "igniteui-react-core";
import { isNaN_, truncate } from "igniteui-react-core";
import { BrushUtil } from "igniteui-react-core";
import { Color } from "igniteui-react-core";
/**
* @hidden
*/
var AnnotationLayer = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(AnnotationLayer, _super);
function AnnotationLayer() {
var _this = _super.call(this) || this;
_this.aar = null;
_this.xx = null;
_this.xw = null;
_this.xy = null;
_this.aap = { $type: Point_$type, x: NaN, y: NaN };
_this.xz = false;
_this.aar = { $type: Point_$type, x: NaN, y: NaN };
_this.zn();
return _this;
}
AnnotationLayer.prototype.ct = function () {
return new AnnotationLayerView(this);
};
AnnotationLayer.prototype.rh = function (a) {
_super.prototype.rh.call(this, a);
this.xv = a;
};
AnnotationLayer.prototype.x4 = function (a) {
if (a == null) {
return false;
}
if (a.ev) {
return false;
}
if (a.isValueOverlay) {
return false;
}
if (a == this) {
return false;
}
return a.hk(a.cw.b9, a.cw.ca, a.cw);
};
AnnotationLayer.prototype.get_e4 = function () {
return this.x1;
};
AnnotationLayer.prototype.b3 = function () {
if (this.b4 == 0) {
return 1;
}
else {
return _super.prototype.b3.call(this);
}
};
AnnotationLayer.prototype.get_fj = function () {
return this.x6 || this.x7;
};
AnnotationLayer.prototype.get_isUsableInLegend = function () {
return this.x7;
};
AnnotationLayer.prototype.rq = function (a, b, c, d) {
_super.prototype.rq.call(this, a, b, c, d);
switch (b) {
case "SeriesViewer":
var e = c;
var f = d;
if (e != null) {
this.zm(e.b9);
var g = e.b9;
g.collectionChanged = delegateRemove(g.collectionChanged, runOn(this, this.zj));
if (typeCast(XamDataChart.$, e) !== null) {
var h = e;
this.zl(h.zq);
var i = h.zq;
i.collectionChanged = delegateRemove(i.collectionChanged, runOn(this, this.y9));
}
}
if (f != null) {
this.zh(f.b9);
var j = f.b9;
j.collectionChanged = delegateCombine(j.collectionChanged, runOn(this, this.zj));
if (typeCast(XamDataChart.$, f) !== null) {
var k = f;
this.zg(k.zq);
var l = k.zq;
l.collectionChanged = delegateCombine(l.collectionChanged, runOn(this, this.y9));
}
}
break;
case AnnotationLayer.$$p[19]:
case AnnotationLayer.$$p[18]:
if (this.fj) {
if (this.index == -1) {
this.index = XamDataChart.abr(this);
}
}
else {
this.index = -1;
this.vt = null;
this.vx = null;
}
if (this.dc != null) {
this.dc.q3();
}
this.r8(true);
break;
case "TransitionProgress":
this.xy.d(this.jz, this.xx, this.xw);
if (this.d7(this.cw)) {
return;
}
if (this.jz == 1) {
this.zi(this.xw, this.cw);
this.q3();
}
else {
this.zi(this.xy, this.cw);
}
if (this.dc != null) {
this.dc.st(this);
}
break;
case AnnotationLayer.$$p[16]:
if (this.dc != null) {
this.dc.qx();
}
break;
case AnnotationLayer.$$p[11]:
this.aar = this.aaq;
this.q6(this.aaq);
break;
case "ShouldRenderAsOverlay":
if (this.dc != null) {
this.cw.at(this.dc);
this.cw.ao(this.dc);
}
break;
case AnnotationLayer.$$p[10]:
case AnnotationLayer.$$p[17]:
case "DashArray":
case AnnotationLayer.$$p[13]:
case AnnotationLayer.$$p[20]:
case AnnotationLayer.$$p[15]:
case AnnotationLayer.$$p[22]:
case AnnotationLayer.$$p[14]:
case AnnotationLayer.$$p[21]:
this.zn();
break;
case AnnotationLayer.$$p[0]:
case AnnotationLayer.$$p[6]:
case AnnotationLayer.$$p[3]:
case AnnotationLayer.$$p[7]:
case AnnotationLayer.$$p[5]:
case AnnotationLayer.$$p[9]:
case AnnotationLayer.$$p[4]:
case AnnotationLayer.$$p[8]:
this.r8(true);
break;
}
};
AnnotationLayer.prototype.zm = 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.zk));
}
}
}
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.r8(true);
};
AnnotationLayer.prototype.zl = 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.za));
}
}
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.r8(true);
};
AnnotationLayer.prototype.zh = 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.zk));
}
}
}
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.r8(true);
};
AnnotationLayer.prototype.zg = 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.za));
}
}
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.r8(true);
};
AnnotationLayer.prototype.x2 = function (a) {
if (a == null) {
return false;
}
return true;
};
AnnotationLayer.prototype.za = function (a, b) {
if (this.x2(a)) {
this.zc(a, b.animate);
}
};
AnnotationLayer.prototype.x3 = function (a) {
if (a == null) {
return false;
}
if (a.ev) {
return false;
}
return true;
};
AnnotationLayer.prototype.zk = function (a, b) {
if (this.x3(a)) {
this.zd(a, b.animate);
}
};
AnnotationLayer.prototype.zc = function (a, b) {
};
AnnotationLayer.prototype.zd = function (a, b) {
};
AnnotationLayer.prototype.zj = function (a, b) {
this.ze(b);
};
AnnotationLayer.prototype.y9 = function (a, b) {
this.zb(b);
};
AnnotationLayer.prototype.aab = function () {
if (this.vt != null) {
return this.vt;
}
return this.vz;
};
AnnotationLayer.prototype.aac = function () {
if (this.vx != null) {
return this.vx;
}
return this.wf;
};
AnnotationLayer.prototype.zb = 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.za));
}
}
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.za));
}
}
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.r8(true);
};
AnnotationLayer.prototype.ze = 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.zk));
}
}
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.zk));
}
}
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.r8(true);
};
AnnotationLayer.prototype.s9 = function (a, b) {
this.r8(false);
};
AnnotationLayer.prototype.s8 = function (a, b) {
this.r8(true);
};
AnnotationLayer.prototype.r9 = function (a) {
_super.prototype.r9.call(this, a);
if (this.d7(this.cw)) {
return;
}
if (this.gl(a) && !this.gx) {
var b = this.xx;
if (this.d4()) {
if (this.dd.g) {
this.dd.t();
}
this.xx = this.xy;
this.xy = b;
}
else {
this.xx = this.xw;
this.xw = b;
}
this.zf(this.xw, this.cw);
this.sp();
}
else {
if (!this.gx) {
this.zf(this.xw, this.cw);
}
this.zi(this.xw, this.cw);
}
};
AnnotationLayer.prototype.get_ev = function () {
return true;
};
AnnotationLayer.prototype.zf = function (a, b) {
};
AnnotationLayer.prototype.zi = function (a, b) {
this.rd();
this.xv.ch();
};
AnnotationLayer.prototype.q6 = function (a) {
if (!this.x0) {
return;
}
_super.prototype.q6.call(this, a);
if (isNaN_(this.aar.x) && isNaN_(this.aar.y)) {
if (isNaN_(a.x) && isNaN_(a.y)) {
this.xv.cg();
return;
}
else {
this.xv.ci();
this.aap = a;
}
}
else {
this.xv.ci();
this.aap = this.aar;
}
this.r8(true);
};
AnnotationLayer.prototype.hk = function (a, b, c) {
var d = _super.prototype.hk.call(this, a, b, c);
if (this.dc == null) {
return false;
}
if (!this.cw.w()) {
d = false;
return d;
}
return d;
};
AnnotationLayer.prototype.yh = function () {
if (isNaN_(this.yk)) {
switch (this.xj) {
case 1: return this.yb();
case 2: return this.ye();
case 4: return this.yd();
}
}
return this.yk;
};
AnnotationLayer.prototype.yg = function () {
if (isNaN_(this.yj)) {
return this.x9;
}
return this.yj;
};
AnnotationLayer.prototype.yi = function () {
if (isNaN_(this.yl)) {
return this.x9;
}
return this.yl;
};
AnnotationLayer.prototype.xq = function () {
switch (this.xm) {
case 0: return this.xn();
}
return this.xm;
};
AnnotationLayer.prototype.xr = function () {
switch (this.xt) {
case 0: return this.xj;
}
return this.xt;
};
AnnotationLayer.prototype.xs = function () {
switch (this.xu) {
case 0: return this.xj;
}
return this.xu;
};
AnnotationLayer.prototype.aak = function () {
if (this.aam == null) {
if (this.wm == null) {
return this.aah();
}
return this.wm;
}
return this.aam;
};
AnnotationLayer.prototype.aal = function () {
if (this.aan == null) {
if (this.wm == null) {
return this.aai();
}
return this.wm;
}
return this.aan;
};
AnnotationLayer.prototype.aaj = function () {
if (this.wm == null) {
return this.aag();
}
return this.wm;
};
AnnotationLayer.prototype.xn = function () {
return 0;
};
AnnotationLayer.prototype.xo = function () {
return this.xn();
};
AnnotationLayer.prototype.xp = function () {
return this.xn();
};
AnnotationLayer.prototype.yb = function () {
return NaN;
};
AnnotationLayer.prototype.ye = function () {
return NaN;
};
AnnotationLayer.prototype.yd = function () {
return NaN;
};
AnnotationLayer.prototype.yc = function () {
return NaN;
};
AnnotationLayer.prototype.yf = function () {
return NaN;
};
AnnotationLayer.prototype.aah = function () {
return null;
};
AnnotationLayer.prototype.aai = function () {
return null;
};
AnnotationLayer.prototype.aag = function () {
return null;
};
AnnotationLayer.prototype.zn = function () {
this.xj = this.xq();
this.x9 = this.yh();
this.xk = this.xr();
this.x8 = this.yg();
this.xl = this.xs();
this.ya = this.yi();
this.aae = this.aak();
this.aaf = this.aal();
this.aad = this.aaj();
};
AnnotationLayer.prototype.get_hg = function () {
return this.x5;
};
Object.defineProperty(AnnotationLayer.prototype, "x5", {
get: function () {
return this.xz;
},
set: function (a) {
var b = this.xz;
this.xz = a;
this.raisePropertyChanged("ShouldRenderAsOverlay", b, this.xz);
},
enumerable: false,
configurable: true
});
AnnotationLayer.$t = markType(AnnotationLayer, 'AnnotationLayer', Series.$);
AnnotationLayer.$$p = markDep(DependencyProperty, PropertyMetadata, AnnotationLayer, 'raisePropertyChanged', ['ActualAppearanceMode:xj:zo', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualDashArray:aad:zp', [DoubleCollection.$], 'ActualDashCap:aao:zq', [PenLineCap_$type], 'ActualHorizontalAppearanceMode:xk:zr', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualHorizontalDashArray:aae:zs', [DoubleCollection.$], 'ActualHorizontalShiftAmount:x8:zt', [1, NaN], 'ActualShiftAmount:x9:zu', [1, NaN], 'ActualVerticalAppearanceMode:xl:zv', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualVerticalDashArray:aaf:zw', [DoubleCollection.$], 'ActualVerticalShiftAmount:ya:zx', [1, NaN], 'AppearanceMode:xm:zy', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'CursorPosition:aaq:zz', [Point_$type, { $type: Point_$type, x: NaN, y: NaN }], 'CursorPositionUpdatesOnMove:x0:z0', [0, true], 'HorizontalAppearanceMode:xt:z1', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'HorizontalDashArray:aam:z2', [DoubleCollection.$], 'HorizontalShiftAmount:yj:z3', [1, NaN], 'IsDefaultCrosshairDisabled:x1:z4', [0, true], 'ShiftAmount:yk:z5', [1, NaN], 'UseIndex:x6:z6', [0, false], 'UseLegend:x7:z7', [0, false], 'VerticalAppearanceMode:xu:z8', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'VerticalDashArray:aan:z9', [DoubleCollection.$], 'VerticalShiftAmount:yl:aaa', [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.cd = null;
_this.ce = false;
_this.cf = -1;
_this.cd = a;
return _this;
}
AnnotationLayerView.prototype.cj = function () {
if (this.ce) {
this.ce = false;
this.cf = -1;
this.cd.aap = { $type: Point_$type, x: NaN, y: NaN };
this.cd.r8(true);
}
};
AnnotationLayerView.prototype.cg = function () {
this.ce = true;
if (this.f.j8 != null) {
this.f.j8.setTimeout(runOn(this, this.cj), 300);
}
else {
this.cf = window.setTimeout(runOn(this, this.cj), 300);
}
};
AnnotationLayerView.prototype.ci = function () {
if (this.ce == true) {
this.ce = false;
if (this.cf != -1) {
window.clearTimeout(this.cf);
this.cf = -1;
}
}
};
AnnotationLayerView.prototype.ch = function () {
this.a2();
};
AnnotationLayerView.prototype.ck = function (a, b) {
if (a == null) {
return a;
}
return BrushUtil.o(a, b);
};
AnnotationLayerView.prototype.cm = function (a, b) {
if (a == null) {
return a;
}
return BrushUtil.q(a, b);
};
AnnotationLayerView.prototype.cl = function (a, b) {
if (a == null) {
return a;
}
var c = new Brush();
c.color = Color.u(truncate((a.color.l * b)), a.color.o, a.color.n, a.color.m);
return c;
};
AnnotationLayerView.$t = markType(AnnotationLayerView, 'AnnotationLayerView', SeriesView.$);
return AnnotationLayerView;
}(SeriesView));
export { AnnotationLayerView };