igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
402 lines (401 loc) • 15.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 { 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
*/
export let ScatterTriangulationSeries = /*@__PURE__*/ (() => {
class ScatterTriangulationSeries extends Series {
constructor() {
super(...arguments);
this.xg = null;
this.xh = null;
this.xp = false;
this.xc = null;
this.triangulationStatusChanged = null;
this.xs = null;
this.xd = null;
this.xe = null;
this.xf = null;
}
o8() {
super.o8();
this.w9 = null;
this.xa = null;
}
ku(a, b) {
let c = this.ni(b);
if (c == ScatterTriangulationSeries.$$p[8]) {
return this.kv(a, b, this.yb);
}
if (c == ScatterTriangulationSeries.$$p[12]) {
return this.kv(a, b, this.yj);
}
return super.ku(a, b);
}
mi(a) {
let b = this.ni(a);
if (b == ScatterTriangulationSeries.$$p[8]) {
return this.yb;
}
if (b == ScatterTriangulationSeries.$$p[12]) {
return this.yj;
}
return super.mi(a);
}
get xm() {
return this.xg;
}
set xm(a) {
let b = this.xm != a;
if (b) {
let c = this.xm;
this.xg = a;
this.raisePropertyChanged("XColumn", c, this.xm);
}
}
get xn() {
return this.xh;
}
set xn(a) {
let b = this.xn != a;
if (b) {
let c = this.xn;
this.xh = a;
this.raisePropertyChanged("YColumn", c, this.xn);
}
}
r0(a) {
let b = this.dp != null && this.xo == null && this.xs == null && this.xm != null && this.xn != null && this.xm.count >= 3 && this.xn.count >= 3 && !this.xp;
if (b) {
this.yn();
this.xp = true;
}
}
yn() {
this.xc = new Triangulator(this.dp.count, this.xm, this.xn);
let a = this.xc;
a.triangulationStatusChanged = delegateCombine(a.triangulationStatusChanged, runOn(this, this.yo));
this.xc.y();
}
yl() {
if (this.xc == null) {
return;
}
this.xc.r();
let a = this.xc;
a.triangulationStatusChanged = delegateRemove(a.triangulationStatusChanged, runOn(this, this.yo));
this.xc = null;
}
yo(a, b) {
if (this.triangulationStatusChanged != null) {
this.triangulationStatusChanged(this, new TriangulationStatusEventArgs(b.currentStatus));
}
if (b.currentStatus >= 100) {
if (this.xc == null) {
return;
}
let c = this.xc;
c.triangulationStatusChanged = delegateRemove(c.triangulationStatusChanged, runOn(this, this.yo));
this.xs = this.xc.n();
this.xc = null;
let d = ((() => {
let $ret = new FastItemsSource();
$ret.e = this.xs;
return $ret;
})());
this.xj = this.xi(d, "v1");
this.xk = this.xi(d, "v2");
this.xl = this.xi(d, "v3");
this.rz(false);
}
}
xi(a, b) {
if (b == null) {
return a.registerColumnInt(null, null, false);
}
let c = null;
let d = SeriesViewer.c7(b, this.coercionMethods);
c = d.a;
return a.registerColumnInt(b, c, this.expectFunctions);
}
rh(a, b, c, d) {
super.rh(a, b, c, d);
switch (b) {
case ScatterTriangulationSeries.$$p[6]:
case ScatterTriangulationSeries.$$p[10]:
case ScatterTriangulationSeries.$$p[7]:
case ScatterTriangulationSeries.$$p[11]:
this.qm();
break;
case "FastItemsSource":
let e = typeCast(IFastItemsSource_$type, c);
if (e != null) {
e.deregisterColumn(this.xm);
e.deregisterColumn(this.xn);
this.xm = null;
this.xn = null;
}
this.ym();
let f = typeCast(IFastItemsSource_$type, d);
if (f != null) {
this.xm = this.dl(this.yb);
this.xn = this.dl(this.yj);
}
this.rz(this.gh && c != null);
break;
case ScatterTriangulationSeries.$$p[8]:
if (this.dp != null) {
this.dp.deregisterColumn(this.xm);
this.xm = this.dl(this.yb);
}
this.ym();
this.rz(false);
this.qs();
break;
case ScatterTriangulationSeries.$$p[12]:
if (this.dp != null) {
this.dp.deregisterColumn(this.xn);
this.xn = this.dl(this.yj);
}
this.ym();
this.rz(false);
this.qs();
break;
case ScatterTriangulationSeries.$$p[5]:
if (c != null) {
(typeCast(Axis.$, c)).cq(this);
}
if (d != null) {
(typeCast(Axis.$, d)).du(this);
}
if ((this.w9 != null && !this.w9.d2()) || (d == null && c != null)) {
this.rz(false);
}
this.qs();
break;
case ScatterTriangulationSeries.$$p[9]:
if (c != null) {
(typeCast(Axis.$, c)).cq(this);
}
if (d != null) {
(typeCast(Axis.$, d)).du(this);
}
if ((this.xa != null && !this.xa.d2()) || (d == null && c != null)) {
this.rz(false);
}
this.qs();
break;
case ScatterTriangulationSeries.$$p[4]:
if (this.trianglesSource != null) {
this.yl();
this.xo = ((() => {
let $ret = new FastItemsSource();
$ret.e = this.trianglesSource;
return $ret;
})());
}
else {
this.xo = null;
}
break;
case ScatterTriangulationSeries.$$p[0]:
let g = typeCast(IFastItemsSource_$type, c);
if (g != null) {
g.deregisterColumn(this.xj);
g.deregisterColumn(this.xk);
g.deregisterColumn(this.xl);
this.xj = null;
this.xk = null;
this.xl = null;
}
let h = typeCast(IFastItemsSource_$type, d);
if (h != null) {
this.xj = this.xi(h, this.xz);
this.xk = this.xi(h, this.x1);
this.xl = this.xi(h, this.x3);
}
this.rz(false);
this.qs();
break;
case ScatterTriangulationSeries.$$p[1]:
if (this.xo != null) {
this.xo.deregisterColumn(this.xj);
this.xj = this.xi(this.xo, this.xz);
}
this.rz(false);
this.qs();
break;
case ScatterTriangulationSeries.$$p[2]:
if (this.xo != null) {
this.xo.deregisterColumn(this.xk);
this.xk = this.xi(this.xo, this.x1);
}
this.rz(false);
this.qs();
break;
case ScatterTriangulationSeries.$$p[3]:
if (this.xo != null) {
this.xo.deregisterColumn(this.xl);
this.xl = this.xi(this.xo, this.x3);
}
this.rz(false);
this.qs();
break;
case "XColumn":
if (this.w9 != null) {
this.w9.d2();
}
break;
case "YColumn":
if (this.xa != null) {
this.xa.d2();
}
break;
}
}
xr(a) {
if (typeCast(NumericYAxis.$, a) !== null) {
return true;
}
return false;
}
xq(a) {
if (typeCast(NumericXAxis.$, a) !== null) {
return true;
}
return false;
}
hf(a, b, c) {
return super.hf(a, b, c) && this.dp != null && this.w9 != null && this.xa != null && this.w9.b0 != null && this.xa.b0 != null && a.width > 0 && a.height > 0 && this.xj != null && this.xj.count > 0 && this.xk != null && this.xk.count > 0 && this.xl != null && this.xl.count > 0 && this.xm != null && this.xm.count > 0 && this.xn != null && this.xn.count > 0;
}
ym() {
if (this.trianglesSource == null) {
this.xs = null;
this.xj = null;
this.xk = null;
this.xl = null;
this.xp = false;
}
}
qh() {
super.qh();
if (this.w9 != null) {
this.w9.k2();
}
if (this.xa != null) {
this.xa.k2();
}
}
ph(a, b, c, d) {
super.ph(a, b, c, d);
this.ym();
this.rz(false);
}
ay(a) {
if (a != null && a == this.w9 && this.xm != null) {
return new AxisRange(this.xm.minimum, this.xm.maximum);
}
if (a != null && a == this.xa && this.xn != null) {
return new AxisRange(this.xn.minimum, this.xn.maximum);
}
return null;
}
s0(a, b) {
this.rz(false);
}
sz(a, b) {
this.rz(false);
}
get xj() {
return this.xd;
}
set xj(a) {
let b = this.xj != a;
if (b) {
let c = this.xj;
this.xd = a;
this.raisePropertyChanged("TriangleVertexColumn1", c, this.xj);
}
}
get xk() {
return this.xe;
}
set xk(a) {
let b = this.xk != a;
if (b) {
let c = this.xk;
this.xe = a;
this.raisePropertyChanged("TriangleVertexColumn2", c, this.xk);
}
}
get xl() {
return this.xf;
}
set xl(a) {
let b = this.xl != a;
if (b) {
let c = this.xl;
this.xf = a;
this.raisePropertyChanged("TriangleVertexColumn3", c, this.xl);
}
}
get_fy() {
return true;
}
get_fm() {
return true;
}
getDataLegendSeriesContextAt(a, b) {
let c = { $type: Point_$type, x: a, y: b };
let d = this.kr(c);
let e = d == null ? NaN : this.iz(d, "XMemberPath");
let f = d == null ? NaN : this.iz(d, "YMemberPath");
let g = new DataLegendSeriesValueInfo();
g.l = e;
g.a = 13;
g.q = "X";
g.r = this.yb != null ? this.yb : "X";
g.s = this.x7 != null ? this.x7 : "X:";
g.t = this.x9 != null ? this.x9 : "";
let h = new DataLegendSeriesValueInfo();
h.l = f;
h.a = 14;
h.q = "Y";
h.r = this.yj != null ? this.yj : "Y";
h.s = this.yf != null ? this.yf : "Y:";
h.t = this.yh != null ? this.yh : "";
let i = new DataLegendSeriesContext();
i.e = ((() => {
let $ret = new List$1(DataLegendSeriesValueInfo.$, 0);
$ret.add(g);
$ret.add(h);
return $ret;
})());
i.h = this.mh();
return i;
}
}
ScatterTriangulationSeries.$t = /*@__PURE__*/ markType(ScatterTriangulationSeries, 'ScatterTriangulationSeries', Series.$);
ScatterTriangulationSeries.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, ScatterTriangulationSeries, 'raisePropertyChanged', ['FastTrianglesSource:xo:yp', [IFastItemsSource_$type, null], 'TriangleVertexMemberPath1:xz:yr', [2, null], 'TriangleVertexMemberPath2:x1:ys', [2, null], 'TriangleVertexMemberPath3:x3:yt', [2, null], 'TrianglesSource::yq', [IEnumerable_$type, null], 'XAxis:w9:yu', [NumericXAxis.$, null], 'XMemberAsLegendLabel:x7:yv', [2, null], 'XMemberAsLegendUnit:x9:yw', [2, null], 'XMemberPath:yb:yx', [2, null], 'YAxis:xa:yy', [NumericYAxis.$, null], 'YMemberAsLegendLabel:yf:yz', [2, null], 'YMemberAsLegendUnit:yh:y0', [2, null], 'YMemberPath:yj:y1', [2, null]]);
return ScatterTriangulationSeries;
})();