igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
426 lines (425 loc) • 16.4 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 } from "tslib";
import { Series } from "./Series";
import { DependencyProperty } from "igniteui-react-core";
import { IEnumerable_$type, runOn, delegateCombine, delegateRemove, typeCast, Point_$type, markType, markDep } from "igniteui-react-core";
import { NumericXAxis } from "./NumericXAxis";
import { NumericYAxis } from "./NumericYAxis";
import { IFastItemsSource_$type } from "igniteui-react-core";
import { Triangulator } from "igniteui-react-core";
import { TriangulationStatusEventArgs } from "igniteui-react-core";
import { FastItemsSource } from "igniteui-react-core";
import { SeriesViewer } from "./SeriesViewer";
import { Axis } from "./Axis";
import { AxisRange } from "./AxisRange";
import { DataLegendSeriesValueInfo } from "igniteui-react-core";
import { DataLegendSeriesContext } from "igniteui-react-core";
import { List$1 } from "igniteui-react-core";
import { PropertyMetadata } from "igniteui-react-core";
/**
* @hidden
*/
var ScatterTriangulationSeries = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(ScatterTriangulationSeries, _super);
function ScatterTriangulationSeries() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.w7 = null;
_this.w8 = null;
_this.xg = false;
_this.w3 = null;
_this.triangulationStatusChanged = null;
_this.xj = null;
_this.w4 = null;
_this.w5 = null;
_this.w6 = null;
return _this;
}
ScatterTriangulationSeries.prototype.o2 = function () {
_super.prototype.o2.call(this);
this.w0 = null;
this.w1 = null;
};
ScatterTriangulationSeries.prototype.kq = function (a, b) {
var c = this.nd(b);
if (c == ScatterTriangulationSeries.$$p[8]) {
return this.kr(a, b, this.x2);
}
if (c == ScatterTriangulationSeries.$$p[12]) {
return this.kr(a, b, this.ya);
}
return _super.prototype.kq.call(this, a, b);
};
ScatterTriangulationSeries.prototype.md = function (a) {
var b = this.nd(a);
if (b == ScatterTriangulationSeries.$$p[8]) {
return this.x2;
}
if (b == ScatterTriangulationSeries.$$p[12]) {
return this.ya;
}
return _super.prototype.md.call(this, a);
};
Object.defineProperty(ScatterTriangulationSeries.prototype, "xd", {
get: function () {
return this.w7;
},
set: function (a) {
var b = this.xd != a;
if (b) {
var c = this.xd;
this.w7 = a;
this.raisePropertyChanged("XColumn", c, this.xd);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(ScatterTriangulationSeries.prototype, "xe", {
get: function () {
return this.w8;
},
set: function (a) {
var b = this.xe != a;
if (b) {
var c = this.xe;
this.w8 = a;
this.raisePropertyChanged("YColumn", c, this.xe);
}
},
enumerable: false,
configurable: true
});
ScatterTriangulationSeries.prototype.rt = function (a) {
var b = this.dp != null && this.xf == null && this.xj == null && this.xd != null && this.xe != null && this.xd.count >= 3 && this.xe.count >= 3 && !this.xg;
if (b) {
this.ye();
this.xg = true;
}
};
ScatterTriangulationSeries.prototype.ye = function () {
this.w3 = new Triangulator(this.dp.count, this.xd, this.xe);
var a = this.w3;
a.triangulationStatusChanged = delegateCombine(a.triangulationStatusChanged, runOn(this, this.yf));
this.w3.y();
};
ScatterTriangulationSeries.prototype.yc = function () {
if (this.w3 == null) {
return;
}
this.w3.r();
var a = this.w3;
a.triangulationStatusChanged = delegateRemove(a.triangulationStatusChanged, runOn(this, this.yf));
this.w3 = null;
};
ScatterTriangulationSeries.prototype.yf = function (a, b) {
var _this = this;
if (this.triangulationStatusChanged != null) {
this.triangulationStatusChanged(this, new TriangulationStatusEventArgs(b.currentStatus));
}
if (b.currentStatus >= 100) {
if (this.w3 == null) {
return;
}
var c = this.w3;
c.triangulationStatusChanged = delegateRemove(c.triangulationStatusChanged, runOn(this, this.yf));
this.xj = this.w3.n();
this.w3 = null;
var d = ((function () {
var $ret = new FastItemsSource();
$ret.e = _this.xj;
return $ret;
})());
this.xa = this.w9(d, "v1");
this.xb = this.w9(d, "v2");
this.xc = this.w9(d, "v3");
this.rs(false);
}
};
ScatterTriangulationSeries.prototype.w9 = function (a, b) {
if (b == null) {
return a.registerColumnInt(null, null, false);
}
var c = null;
var d = SeriesViewer.cu(b, this.coercionMethods);
c = d.a;
return a.registerColumnInt(b, c, this.expectFunctions);
};
ScatterTriangulationSeries.prototype.ra = function (a, b, c, d) {
var _this = this;
_super.prototype.ra.call(this, a, b, c, d);
switch (b) {
case ScatterTriangulationSeries.$$p[6]:
case ScatterTriangulationSeries.$$p[10]:
case ScatterTriangulationSeries.$$p[7]:
case ScatterTriangulationSeries.$$p[11]:
this.qf();
break;
case "FastItemsSource":
var e = typeCast(IFastItemsSource_$type, c);
if (e != null) {
e.deregisterColumn(this.xd);
e.deregisterColumn(this.xe);
this.xd = null;
this.xe = null;
}
this.yd();
var f = typeCast(IFastItemsSource_$type, d);
if (f != null) {
this.xd = this.dl(this.x2);
this.xe = this.dl(this.ya);
}
this.rs(this.gg && c != null);
break;
case ScatterTriangulationSeries.$$p[8]:
if (this.dp != null) {
this.dp.deregisterColumn(this.xd);
this.xd = this.dl(this.x2);
}
this.yd();
this.rs(false);
this.ql();
break;
case ScatterTriangulationSeries.$$p[12]:
if (this.dp != null) {
this.dp.deregisterColumn(this.xe);
this.xe = this.dl(this.ya);
}
this.yd();
this.rs(false);
this.ql();
break;
case ScatterTriangulationSeries.$$p[5]:
if (c != null) {
(typeCast(Axis.$, c)).b0(this);
}
if (d != null) {
(typeCast(Axis.$, d)).ct(this);
}
if ((this.w0 != null && !this.w0.c1()) || (d == null && c != null)) {
this.rs(false);
}
this.ql();
break;
case ScatterTriangulationSeries.$$p[9]:
if (c != null) {
(typeCast(Axis.$, c)).b0(this);
}
if (d != null) {
(typeCast(Axis.$, d)).ct(this);
}
if ((this.w1 != null && !this.w1.c1()) || (d == null && c != null)) {
this.rs(false);
}
this.ql();
break;
case ScatterTriangulationSeries.$$p[4]:
if (this.trianglesSource != null) {
this.yc();
this.xf = ((function () {
var $ret = new FastItemsSource();
$ret.e = _this.trianglesSource;
return $ret;
})());
}
else {
this.xf = null;
}
break;
case ScatterTriangulationSeries.$$p[0]:
var g = typeCast(IFastItemsSource_$type, c);
if (g != null) {
g.deregisterColumn(this.xa);
g.deregisterColumn(this.xb);
g.deregisterColumn(this.xc);
this.xa = null;
this.xb = null;
this.xc = null;
}
var h = typeCast(IFastItemsSource_$type, d);
if (h != null) {
this.xa = this.w9(h, this.xq);
this.xb = this.w9(h, this.xs);
this.xc = this.w9(h, this.xu);
}
this.rs(false);
this.ql();
break;
case ScatterTriangulationSeries.$$p[1]:
if (this.xf != null) {
this.xf.deregisterColumn(this.xa);
this.xa = this.w9(this.xf, this.xq);
}
this.rs(false);
this.ql();
break;
case ScatterTriangulationSeries.$$p[2]:
if (this.xf != null) {
this.xf.deregisterColumn(this.xb);
this.xb = this.w9(this.xf, this.xs);
}
this.rs(false);
this.ql();
break;
case ScatterTriangulationSeries.$$p[3]:
if (this.xf != null) {
this.xf.deregisterColumn(this.xc);
this.xc = this.w9(this.xf, this.xu);
}
this.rs(false);
this.ql();
break;
case "XColumn":
if (this.w0 != null) {
this.w0.c1();
}
break;
case "YColumn":
if (this.w1 != null) {
this.w1.c1();
}
break;
}
};
ScatterTriangulationSeries.prototype.xi = function (a) {
if (typeCast(NumericYAxis.$, a) !== null) {
return true;
}
return false;
};
ScatterTriangulationSeries.prototype.xh = function (a) {
if (typeCast(NumericXAxis.$, a) !== null) {
return true;
}
return false;
};
ScatterTriangulationSeries.prototype.he = function (a, b, c) {
return _super.prototype.he.call(this, a, b, c) && this.dp != null && this.w0 != null && this.w1 != null && this.w0.bi != null && this.w1.bi != null && a.width > 0 && a.height > 0 && this.xa != null && this.xa.count > 0 && this.xb != null && this.xb.count > 0 && this.xc != null && this.xc.count > 0 && this.xd != null && this.xd.count > 0 && this.xe != null && this.xe.count > 0;
};
ScatterTriangulationSeries.prototype.yd = function () {
if (this.trianglesSource == null) {
this.xj = null;
this.xa = null;
this.xb = null;
this.xc = null;
this.xg = false;
}
};
ScatterTriangulationSeries.prototype.qb = function () {
_super.prototype.qb.call(this);
if (this.w0 != null) {
this.w0.ia();
}
if (this.w1 != null) {
this.w1.ia();
}
};
ScatterTriangulationSeries.prototype.pb = function (a, b, c, d) {
_super.prototype.pb.call(this, a, b, c, d);
this.yd();
this.rs(false);
};
ScatterTriangulationSeries.prototype.ay = function (a) {
if (a != null && a == this.w0 && this.xd != null) {
return new AxisRange(this.xd.minimum, this.xd.maximum);
}
if (a != null && a == this.w1 && this.xe != null) {
return new AxisRange(this.xe.minimum, this.xe.maximum);
}
return null;
};
ScatterTriangulationSeries.prototype.st = function (a, b) {
this.rs(false);
};
ScatterTriangulationSeries.prototype.ss = function (a, b) {
this.rs(false);
};
Object.defineProperty(ScatterTriangulationSeries.prototype, "xa", {
get: function () {
return this.w4;
},
set: function (a) {
var b = this.xa != a;
if (b) {
var c = this.xa;
this.w4 = a;
this.raisePropertyChanged("TriangleVertexColumn1", c, this.xa);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(ScatterTriangulationSeries.prototype, "xb", {
get: function () {
return this.w5;
},
set: function (a) {
var b = this.xb != a;
if (b) {
var c = this.xb;
this.w5 = a;
this.raisePropertyChanged("TriangleVertexColumn2", c, this.xb);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(ScatterTriangulationSeries.prototype, "xc", {
get: function () {
return this.w6;
},
set: function (a) {
var b = this.xc != a;
if (b) {
var c = this.xc;
this.w6 = a;
this.raisePropertyChanged("TriangleVertexColumn3", c, this.xc);
}
},
enumerable: false,
configurable: true
});
ScatterTriangulationSeries.prototype.get_fx = function () {
return true;
};
ScatterTriangulationSeries.prototype.get_fl = function () {
return true;
};
ScatterTriangulationSeries.prototype.getDataLegendSeriesContextAt = function (a, b) {
var c = { $type: Point_$type, x: a, y: b };
var d = this.kn(c);
var e = d == null ? NaN : this.ix(d, "XMemberPath");
var f = d == null ? NaN : this.ix(d, "YMemberPath");
var g = new DataLegendSeriesValueInfo();
g.l = e;
g.a = 13;
g.q = "X";
g.r = this.x2 != null ? this.x2 : "X";
g.s = this.xy != null ? this.xy : "X:";
g.t = this.x0 != null ? this.x0 : "";
var h = new DataLegendSeriesValueInfo();
h.l = f;
h.a = 14;
h.q = "Y";
h.r = this.ya != null ? this.ya : "Y";
h.s = this.x6 != null ? this.x6 : "Y:";
h.t = this.x8 != null ? this.x8 : "";
var i = new DataLegendSeriesContext();
i.e = ((function () {
var $ret = new List$1(DataLegendSeriesValueInfo.$, 0);
$ret.add(g);
$ret.add(h);
return $ret;
})());
i.h = this.mc();
return i;
};
ScatterTriangulationSeries.$t = markType(ScatterTriangulationSeries, 'ScatterTriangulationSeries', Series.$);
ScatterTriangulationSeries.$$p = markDep(DependencyProperty, PropertyMetadata, ScatterTriangulationSeries, 'raisePropertyChanged', ['FastTrianglesSource:xf:yg', [IFastItemsSource_$type, null], 'TriangleVertexMemberPath1:xq:yi', [2, null], 'TriangleVertexMemberPath2:xs:yj', [2, null], 'TriangleVertexMemberPath3:xu:yk', [2, null], 'TrianglesSource::yh', [IEnumerable_$type, null], 'XAxis:w0:yl', [NumericXAxis.$, null], 'XMemberAsLegendLabel:xy:ym', [2, null], 'XMemberAsLegendUnit:x0:yn', [2, null], 'XMemberPath:x2:yo', [2, null], 'YAxis:w1:yp', [NumericYAxis.$, null], 'YMemberAsLegendLabel:x6:yq', [2, null], 'YMemberAsLegendUnit:x8:yr', [2, null], 'YMemberPath:ya:ys', [2, null]]);
return ScatterTriangulationSeries;
}(Series));
export { ScatterTriangulationSeries };