igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
701 lines (700 loc) • 23.2 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, Boolean_$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 { Tuple$2 } 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.z6 = null;
_this.xe = null;
_this.xd = null;
_this.xf = null;
_this.z4 = { $type: Point_$type, x: NaN, y: NaN };
_this.xg = false;
_this.z6 = { $type: Point_$type, x: NaN, y: NaN };
_this.y3();
return _this;
}
AnnotationLayer.prototype.ct = function () {
return new AnnotationLayerView(this);
};
AnnotationLayer.prototype.q1 = function (a) {
_super.prototype.q1.call(this, a);
this.xc = a;
};
AnnotationLayer.prototype.xk = function (a) {
if (a == null) {
return false;
}
if (a.et) {
return false;
}
if (a.isValueOverlay) {
return false;
}
if (a == this) {
return false;
}
return a.he(a.cw.b1, a.cw.b2, a.cw);
};
AnnotationLayer.prototype.get_e2 = function () {
return this.xh;
};
AnnotationLayer.prototype.b3 = function () {
if (this.b4 == 0) {
return 1;
}
else {
return _super.prototype.b3.call(this);
}
};
AnnotationLayer.prototype.get_fg = function () {
return this.xm || this.xn;
};
AnnotationLayer.prototype.get_isUsableInLegend = function () {
return this.xn;
};
AnnotationLayer.prototype.ra = function (a, b, c, d) {
_super.prototype.ra.call(this, a, b, c, d);
switch (b) {
case "SeriesViewer":
var e = c;
var f = d;
if (e != null) {
this.y2(e.series);
var g = e.series;
g.collectionChanged = delegateRemove(g.collectionChanged, runOn(this, this.yz));
if (typeCast(XamDataChart.$, e) !== null) {
var h = e;
this.y1(h.axes);
var i = h.axes;
i.collectionChanged = delegateRemove(i.collectionChanged, runOn(this, this.yp));
}
}
if (f != null) {
this.yx(f.series);
var j = f.series;
j.collectionChanged = delegateCombine(j.collectionChanged, runOn(this, this.yz));
if (typeCast(XamDataChart.$, f) !== null) {
var k = f;
this.yw(k.axes);
var l = k.axes;
l.collectionChanged = delegateCombine(l.collectionChanged, runOn(this, this.yp));
}
}
break;
case AnnotationLayer.$$p[18]:
case AnnotationLayer.$$p[17]:
if (this.fg) {
if (this.index == -1) {
this.index = XamDataChart.yu(this);
}
}
else {
this.index = -1;
this.vb = null;
this.vf = null;
}
if (this.dc != null) {
this.dc.pf();
}
this.rs(true);
break;
case "TransitionProgress":
this.xf.c(this.jq, this.xe, this.xd);
if (this.d6(this.cw)) {
return;
}
if (this.jq == 1) {
this.yy(this.xd, this.cw);
this.qo();
}
else {
this.yy(this.xf, this.cw);
}
if (this.dc != null) {
this.dc.qp(this);
}
break;
case AnnotationLayer.$$p[15]:
if (this.dc != null) {
this.dc.o9();
}
break;
case AnnotationLayer.$$p[11]:
this.z6 = this.z5;
this.qr(this.z5);
break;
case "ShouldRenderAsOverlay":
if (this.dc != null) {
this.cw.ao(this.dc);
this.cw.aj(this.dc);
}
break;
case AnnotationLayer.$$p[10]:
case AnnotationLayer.$$p[16]:
case "DashArray":
case AnnotationLayer.$$p[12]:
case AnnotationLayer.$$p[19]:
case AnnotationLayer.$$p[14]:
case AnnotationLayer.$$p[21]:
case AnnotationLayer.$$p[13]:
case AnnotationLayer.$$p[20]:
this.y3();
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.rs(true);
break;
}
};
AnnotationLayer.prototype.y2 = 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.y0));
}
}
}
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.rs(true);
};
AnnotationLayer.prototype.y1 = 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.yq));
}
}
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.rs(true);
};
AnnotationLayer.prototype.yx = 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.y0));
}
}
}
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.rs(true);
};
AnnotationLayer.prototype.yw = 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.yq));
}
}
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.rs(true);
};
AnnotationLayer.prototype.xi = function (a) {
if (a == null) {
return false;
}
return true;
};
AnnotationLayer.prototype.yq = function (a, b) {
if (this.xi(a)) {
this.ys(a, b.animate);
}
};
AnnotationLayer.prototype.xj = function (a) {
if (a == null) {
return false;
}
if (a.et) {
return false;
}
return true;
};
AnnotationLayer.prototype.y0 = function (a, b) {
if (this.xj(a)) {
this.yt(a, b.animate);
}
};
AnnotationLayer.prototype.ys = function (a, b) {
};
AnnotationLayer.prototype.yt = function (a, b) {
};
AnnotationLayer.prototype.yz = function (a, b) {
this.yu(b);
};
AnnotationLayer.prototype.yp = function (a, b) {
this.yr(b);
};
AnnotationLayer.prototype.zq = function () {
if (this.vb != null) {
return this.vb;
}
return this.vh;
};
AnnotationLayer.prototype.zr = function () {
if (this.vf != null) {
return this.vf;
}
return this.vx;
};
AnnotationLayer.prototype.yr = 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.yq));
}
}
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.yq));
}
}
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.rs(true);
};
AnnotationLayer.prototype.yu = 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.y0));
}
}
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.y0));
}
}
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.rs(true);
};
AnnotationLayer.prototype.st = function (a, b) {
this.rs(false);
};
AnnotationLayer.prototype.ss = function (a, b) {
this.rs(true);
};
AnnotationLayer.prototype.rt = function (a) {
_super.prototype.rt.call(this, a);
if (this.d6(this.cw)) {
return;
}
if (this.gf(a) && !this.gr) {
var b = this.xe;
if (this.d4()) {
if (this.dd.g) {
this.dd.t();
}
this.xe = this.xf;
this.xf = b;
}
else {
this.xe = this.xd;
this.xd = b;
}
this.yv(this.xd, this.cw);
this.r9();
}
else {
if (!this.gr) {
this.yv(this.xd, this.cw);
}
this.yy(this.xd, this.cw);
}
};
AnnotationLayer.prototype.get_et = function () {
return true;
};
AnnotationLayer.prototype.yv = function (a, b) {
};
AnnotationLayer.prototype.yy = function (a, b) {
this.qx();
this.xc.b8();
};
AnnotationLayer.prototype.yo = function (a) {
var b = { $type: Point_$type, x: this.z4.x, y: this.z4.y };
if (a.isVertical) {
if (isNaN_(this.z4.y)) {
return new Tuple$2(Boolean_$type, Point_$type, false, b);
}
if (isNaN_(this.z4.x)) {
b.x = 0;
return new Tuple$2(Boolean_$type, Point_$type, true, b);
}
}
else {
if (isNaN_(this.z4.x)) {
return new Tuple$2(Boolean_$type, Point_$type, false, b);
}
if (isNaN_(this.z4.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.qr = function (a) {
_super.prototype.qr.call(this, a);
if (isNaN_(this.z6.x) && isNaN_(this.z6.y)) {
if (isNaN_(a.x) && isNaN_(a.y)) {
this.xc.b7();
return;
}
else {
this.xc.b9();
this.z4 = a;
}
}
else {
this.xc.b9();
this.z4 = this.z6;
}
this.rs(true);
};
AnnotationLayer.prototype.he = function (a, b, c) {
var d = _super.prototype.he.call(this, a, b, c);
if (this.dc == null) {
return false;
}
if (!this.cw.u()) {
d = false;
return d;
}
return d;
};
AnnotationLayer.prototype.xx = function () {
if (isNaN_(this.x0)) {
switch (this.w0) {
case 1: return this.xr();
case 2: return this.xu();
case 4: return this.xt();
}
}
return this.x0;
};
AnnotationLayer.prototype.xw = function () {
if (isNaN_(this.xz)) {
return this.xp;
}
return this.xz;
};
AnnotationLayer.prototype.xy = function () {
if (isNaN_(this.x1)) {
return this.xp;
}
return this.x1;
};
AnnotationLayer.prototype.w7 = function () {
switch (this.w3) {
case 0: return this.w4();
}
return this.w3;
};
AnnotationLayer.prototype.w8 = function () {
switch (this.xa) {
case 0: return this.w0;
}
return this.xa;
};
AnnotationLayer.prototype.w9 = function () {
switch (this.xb) {
case 0: return this.w0;
}
return this.xb;
};
AnnotationLayer.prototype.zz = function () {
if (this.z1 == null) {
if (this.v4 == null) {
return this.zw();
}
return this.v4;
}
return this.z1;
};
AnnotationLayer.prototype.z0 = function () {
if (this.z2 == null) {
if (this.v4 == null) {
return this.zx();
}
return this.v4;
}
return this.z2;
};
AnnotationLayer.prototype.zy = function () {
if (this.v4 == null) {
return this.zv();
}
return this.v4;
};
AnnotationLayer.prototype.w4 = function () {
return 0;
};
AnnotationLayer.prototype.w5 = function () {
return this.w4();
};
AnnotationLayer.prototype.w6 = function () {
return this.w4();
};
AnnotationLayer.prototype.xr = function () {
return NaN;
};
AnnotationLayer.prototype.xu = function () {
return NaN;
};
AnnotationLayer.prototype.xt = function () {
return NaN;
};
AnnotationLayer.prototype.xs = function () {
return NaN;
};
AnnotationLayer.prototype.xv = function () {
return NaN;
};
AnnotationLayer.prototype.zw = function () {
return null;
};
AnnotationLayer.prototype.zx = function () {
return null;
};
AnnotationLayer.prototype.zv = function () {
return null;
};
AnnotationLayer.prototype.y3 = function () {
this.w0 = this.w7();
this.xp = this.xx();
this.w1 = this.w8();
this.xo = this.xw();
this.w2 = this.w9();
this.xq = this.xy();
this.zt = this.zz();
this.zu = this.z0();
this.zs = this.zy();
};
AnnotationLayer.prototype.get_ha = function () {
return this.xl;
};
Object.defineProperty(AnnotationLayer.prototype, "xl", {
get: function () {
return this.xg;
},
set: function (a) {
var b = this.xg;
this.xg = a;
this.raisePropertyChanged("ShouldRenderAsOverlay", b, this.xg);
},
enumerable: false,
configurable: true
});
AnnotationLayer.$t = markType(AnnotationLayer, 'AnnotationLayer', Series.$);
AnnotationLayer.$$p = markDep(DependencyProperty, PropertyMetadata, AnnotationLayer, 'raisePropertyChanged', ['ActualAppearanceMode:w0:y4', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualDashArray:zs:y5', [DoubleCollection.$], 'ActualDashCap:z3:y6', [PenLineCap_$type], 'ActualHorizontalAppearanceMode:w1:y7', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualHorizontalDashArray:zt:y8', [DoubleCollection.$], 'ActualHorizontalShiftAmount:xo:y9', [1, NaN], 'ActualShiftAmount:xp:za', [1, NaN], 'ActualVerticalAppearanceMode:w2:zb', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualVerticalDashArray:zu:zc', [DoubleCollection.$], 'ActualVerticalShiftAmount:xq:zd', [1, NaN], 'AppearanceMode:w3:ze', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'CursorPosition:z5:zf', [Point_$type, { $type: Point_$type, x: NaN, y: NaN }], 'HorizontalAppearanceMode:xa:zg', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'HorizontalDashArray:z1:zh', [DoubleCollection.$], 'HorizontalShiftAmount:xz:zi', [1, NaN], 'IsDefaultCrosshairDisabled:xh:zj', [0, true], 'ShiftAmount:x0:zk', [1, NaN], 'UseIndex:xm:zl', [0, false], 'UseLegend:xn:zm', [0, false], 'VerticalAppearanceMode:xb:zn', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'VerticalDashArray:z2:zo', [DoubleCollection.$], 'VerticalShiftAmount:x1:zp', [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.b4 = null;
_this.b5 = false;
_this.b6 = -1;
_this.b4 = a;
return _this;
}
AnnotationLayerView.prototype.ca = function () {
if (this.b5) {
this.b5 = false;
this.b6 = -1;
this.b4.z4 = { $type: Point_$type, x: NaN, y: NaN };
this.b4.rs(true);
}
};
AnnotationLayerView.prototype.b7 = function () {
this.b5 = true;
if (this.f.jz != null) {
this.f.jz.setTimeout(runOn(this, this.ca), 300);
}
else {
this.b6 = window.setTimeout(runOn(this, this.ca), 300);
}
};
AnnotationLayerView.prototype.b9 = function () {
if (this.b5 == true) {
this.b5 = false;
if (this.b6 != -1) {
window.clearTimeout(this.b6);
this.b6 = -1;
}
}
};
AnnotationLayerView.prototype.b8 = function () {
this.av();
};
AnnotationLayerView.prototype.cb = function (a, b) {
if (a == null) {
return a;
}
return BrushUtil.m(a, b);
};
AnnotationLayerView.prototype.cd = function (a, b) {
if (a == null) {
return a;
}
return BrushUtil.o(a, b);
};
AnnotationLayerView.prototype.cc = 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 };