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.z9 = null;
_this.xh = null;
_this.xg = null;
_this.xi = null;
_this.z7 = { $type: Point_$type, x: NaN, y: NaN };
_this.xj = false;
_this.z9 = { $type: Point_$type, x: NaN, y: NaN };
_this.y6();
return _this;
}
AnnotationLayer.prototype.ct = function () {
return new AnnotationLayerView(this);
};
AnnotationLayer.prototype.q3 = function (a) {
_super.prototype.q3.call(this, a);
this.xf = a;
};
AnnotationLayer.prototype.xn = function (a) {
if (a == null) {
return false;
}
if (a.eu) {
return false;
}
if (a.isValueOverlay) {
return false;
}
if (a == this) {
return false;
}
return a.hf(a.cw.b9, a.cw.ca, a.cw);
};
AnnotationLayer.prototype.get_e3 = function () {
return this.xk;
};
AnnotationLayer.prototype.b3 = function () {
if (this.b4 == 0) {
return 1;
}
else {
return _super.prototype.b3.call(this);
}
};
AnnotationLayer.prototype.get_fh = function () {
return this.xp || this.xq;
};
AnnotationLayer.prototype.get_isUsableInLegend = function () {
return this.xq;
};
AnnotationLayer.prototype.rc = function (a, b, c, d) {
_super.prototype.rc.call(this, a, b, c, d);
switch (b) {
case "SeriesViewer":
var e = c;
var f = d;
if (e != null) {
this.y5(e.series);
var g = e.series;
g.collectionChanged = delegateRemove(g.collectionChanged, runOn(this, this.y2));
if (typeCast(XamDataChart.$, e) !== null) {
var h = e;
this.y4(h.axes);
var i = h.axes;
i.collectionChanged = delegateRemove(i.collectionChanged, runOn(this, this.ys));
}
}
if (f != null) {
this.y0(f.series);
var j = f.series;
j.collectionChanged = delegateCombine(j.collectionChanged, runOn(this, this.y2));
if (typeCast(XamDataChart.$, f) !== null) {
var k = f;
this.yz(k.axes);
var l = k.axes;
l.collectionChanged = delegateCombine(l.collectionChanged, runOn(this, this.ys));
}
}
break;
case AnnotationLayer.$$p[18]:
case AnnotationLayer.$$p[17]:
if (this.fh) {
if (this.index == -1) {
this.index = XamDataChart.zi(this);
}
}
else {
this.index = -1;
this.ve = null;
this.vi = null;
}
if (this.dc != null) {
this.dc.px();
}
this.ru(true);
break;
case "TransitionProgress":
this.xi.c(this.jr, this.xh, this.xg);
if (this.d7(this.cw)) {
return;
}
if (this.jr == 1) {
this.y1(this.xg, this.cw);
this.qq();
}
else {
this.y1(this.xi, this.cw);
}
if (this.dc != null) {
this.dc.q7(this);
}
break;
case AnnotationLayer.$$p[15]:
if (this.dc != null) {
this.dc.pr();
}
break;
case AnnotationLayer.$$p[11]:
this.z9 = this.z8;
this.qt(this.z8);
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[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.y6();
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.ru(true);
break;
}
};
AnnotationLayer.prototype.y5 = 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.y3));
}
}
}
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.ru(true);
};
AnnotationLayer.prototype.y4 = 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.yt));
}
}
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.ru(true);
};
AnnotationLayer.prototype.y0 = 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.y3));
}
}
}
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.ru(true);
};
AnnotationLayer.prototype.yz = 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.yt));
}
}
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.ru(true);
};
AnnotationLayer.prototype.xl = function (a) {
if (a == null) {
return false;
}
return true;
};
AnnotationLayer.prototype.yt = function (a, b) {
if (this.xl(a)) {
this.yv(a, b.animate);
}
};
AnnotationLayer.prototype.xm = function (a) {
if (a == null) {
return false;
}
if (a.eu) {
return false;
}
return true;
};
AnnotationLayer.prototype.y3 = function (a, b) {
if (this.xm(a)) {
this.yw(a, b.animate);
}
};
AnnotationLayer.prototype.yv = function (a, b) {
};
AnnotationLayer.prototype.yw = function (a, b) {
};
AnnotationLayer.prototype.y2 = function (a, b) {
this.yx(b);
};
AnnotationLayer.prototype.ys = function (a, b) {
this.yu(b);
};
AnnotationLayer.prototype.zt = function () {
if (this.ve != null) {
return this.ve;
}
return this.vk;
};
AnnotationLayer.prototype.zu = function () {
if (this.vi != null) {
return this.vi;
}
return this.v0;
};
AnnotationLayer.prototype.yu = 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.yt));
}
}
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.yt));
}
}
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.ru(true);
};
AnnotationLayer.prototype.yx = 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.y3));
}
}
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.y3));
}
}
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.ru(true);
};
AnnotationLayer.prototype.sv = function (a, b) {
this.ru(false);
};
AnnotationLayer.prototype.su = function (a, b) {
this.ru(true);
};
AnnotationLayer.prototype.rv = function (a) {
_super.prototype.rv.call(this, a);
if (this.d7(this.cw)) {
return;
}
if (this.gg(a) && !this.gs) {
var b = this.xh;
if (this.d4()) {
if (this.dd.g) {
this.dd.t();
}
this.xh = this.xi;
this.xi = b;
}
else {
this.xh = this.xg;
this.xg = b;
}
this.yy(this.xg, this.cw);
this.sb();
}
else {
if (!this.gs) {
this.yy(this.xg, this.cw);
}
this.y1(this.xg, this.cw);
}
};
AnnotationLayer.prototype.get_eu = function () {
return true;
};
AnnotationLayer.prototype.yy = function (a, b) {
};
AnnotationLayer.prototype.y1 = function (a, b) {
this.qz();
this.xf.ch();
};
AnnotationLayer.prototype.yr = function (a) {
var b = { $type: Point_$type, x: this.z7.x, y: this.z7.y };
if (a.isVertical) {
if (isNaN_(this.z7.y)) {
return new Tuple$2(Boolean_$type, Point_$type, false, b);
}
if (isNaN_(this.z7.x)) {
b.x = 0;
return new Tuple$2(Boolean_$type, Point_$type, true, b);
}
}
else {
if (isNaN_(this.z7.x)) {
return new Tuple$2(Boolean_$type, Point_$type, false, b);
}
if (isNaN_(this.z7.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.qt = function (a) {
_super.prototype.qt.call(this, a);
if (isNaN_(this.z9.x) && isNaN_(this.z9.y)) {
if (isNaN_(a.x) && isNaN_(a.y)) {
this.xf.cg();
return;
}
else {
this.xf.ci();
this.z7 = a;
}
}
else {
this.xf.ci();
this.z7 = this.z9;
}
this.ru(true);
};
AnnotationLayer.prototype.hf = function (a, b, c) {
var d = _super.prototype.hf.call(this, a, b, c);
if (this.dc == null) {
return false;
}
if (!this.cw.w()) {
d = false;
return d;
}
return d;
};
AnnotationLayer.prototype.x0 = function () {
if (isNaN_(this.x3)) {
switch (this.w3) {
case 1: return this.xu();
case 2: return this.xx();
case 4: return this.xw();
}
}
return this.x3;
};
AnnotationLayer.prototype.xz = function () {
if (isNaN_(this.x2)) {
return this.xs;
}
return this.x2;
};
AnnotationLayer.prototype.x1 = function () {
if (isNaN_(this.x4)) {
return this.xs;
}
return this.x4;
};
AnnotationLayer.prototype.xa = function () {
switch (this.w6) {
case 0: return this.w7();
}
return this.w6;
};
AnnotationLayer.prototype.xb = function () {
switch (this.xd) {
case 0: return this.w3;
}
return this.xd;
};
AnnotationLayer.prototype.xc = function () {
switch (this.xe) {
case 0: return this.w3;
}
return this.xe;
};
AnnotationLayer.prototype.z2 = function () {
if (this.z4 == null) {
if (this.v7 == null) {
return this.zz();
}
return this.v7;
}
return this.z4;
};
AnnotationLayer.prototype.z3 = function () {
if (this.z5 == null) {
if (this.v7 == null) {
return this.z0();
}
return this.v7;
}
return this.z5;
};
AnnotationLayer.prototype.z1 = function () {
if (this.v7 == null) {
return this.zy();
}
return this.v7;
};
AnnotationLayer.prototype.w7 = function () {
return 0;
};
AnnotationLayer.prototype.w8 = function () {
return this.w7();
};
AnnotationLayer.prototype.w9 = function () {
return this.w7();
};
AnnotationLayer.prototype.xu = function () {
return NaN;
};
AnnotationLayer.prototype.xx = function () {
return NaN;
};
AnnotationLayer.prototype.xw = function () {
return NaN;
};
AnnotationLayer.prototype.xv = function () {
return NaN;
};
AnnotationLayer.prototype.xy = function () {
return NaN;
};
AnnotationLayer.prototype.zz = function () {
return null;
};
AnnotationLayer.prototype.z0 = function () {
return null;
};
AnnotationLayer.prototype.zy = function () {
return null;
};
AnnotationLayer.prototype.y6 = function () {
this.w3 = this.xa();
this.xs = this.x0();
this.w4 = this.xb();
this.xr = this.xz();
this.w5 = this.xc();
this.xt = this.x1();
this.zw = this.z2();
this.zx = this.z3();
this.zv = this.z1();
};
AnnotationLayer.prototype.get_hb = function () {
return this.xo;
};
Object.defineProperty(AnnotationLayer.prototype, "xo", {
get: function () {
return this.xj;
},
set: function (a) {
var b = this.xj;
this.xj = a;
this.raisePropertyChanged("ShouldRenderAsOverlay", b, this.xj);
},
enumerable: false,
configurable: true
});
AnnotationLayer.$t = markType(AnnotationLayer, 'AnnotationLayer', Series.$);
AnnotationLayer.$$p = markDep(DependencyProperty, PropertyMetadata, AnnotationLayer, 'raisePropertyChanged', ['ActualAppearanceMode:w3:y7', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualDashArray:zv:y8', [DoubleCollection.$], 'ActualDashCap:z6:y9', [PenLineCap_$type], 'ActualHorizontalAppearanceMode:w4:za', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualHorizontalDashArray:zw:zb', [DoubleCollection.$], 'ActualHorizontalShiftAmount:xr:zc', [1, NaN], 'ActualShiftAmount:xs:zd', [1, NaN], 'ActualVerticalAppearanceMode:w5:ze', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualVerticalDashArray:zx:zf', [DoubleCollection.$], 'ActualVerticalShiftAmount:xt:zg', [1, NaN], 'AppearanceMode:w6:zh', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'CursorPosition:z8:zi', [Point_$type, { $type: Point_$type, x: NaN, y: NaN }], 'HorizontalAppearanceMode:xd:zj', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'HorizontalDashArray:z4:zk', [DoubleCollection.$], 'HorizontalShiftAmount:x2:zl', [1, NaN], 'IsDefaultCrosshairDisabled:xk:zm', [0, true], 'ShiftAmount:x3:zn', [1, NaN], 'UseIndex:xp:zo', [0, false], 'UseLegend:xq:zp', [0, false], 'VerticalAppearanceMode:xe:zq', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'VerticalDashArray:z5:zr', [DoubleCollection.$], 'VerticalShiftAmount:x4:zs', [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.z7 = { $type: Point_$type, x: NaN, y: NaN };
this.cd.ru(true);
}
};
AnnotationLayerView.prototype.cg = function () {
this.ce = true;
if (this.f.j0 != null) {
this.f.j0.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 };