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.xa = null;
this.xb = null;
this.xj = false;
this.w6 = null;
this.triangulationStatusChanged = null;
this.xm = null;
this.w7 = null;
this.w8 = null;
this.w9 = null;
}
o4() {
super.o4();
this.w3 = null;
this.w4 = null;
}
kr(a, b) {
let c = this.nf(b);
if (c == ScatterTriangulationSeries.$$p[8]) {
return this.ks(a, b, this.x5);
}
if (c == ScatterTriangulationSeries.$$p[12]) {
return this.ks(a, b, this.yd);
}
return super.kr(a, b);
}
mf(a) {
let b = this.nf(a);
if (b == ScatterTriangulationSeries.$$p[8]) {
return this.x5;
}
if (b == ScatterTriangulationSeries.$$p[12]) {
return this.yd;
}
return super.mf(a);
}
get xg() {
return this.xa;
}
set xg(a) {
let b = this.xg != a;
if (b) {
let c = this.xg;
this.xa = a;
this.raisePropertyChanged("XColumn", c, this.xg);
}
}
get xh() {
return this.xb;
}
set xh(a) {
let b = this.xh != a;
if (b) {
let c = this.xh;
this.xb = a;
this.raisePropertyChanged("YColumn", c, this.xh);
}
}
rv(a) {
let b = this.dp != null && this.xi == null && this.xm == null && this.xg != null && this.xh != null && this.xg.count >= 3 && this.xh.count >= 3 && !this.xj;
if (b) {
this.yh();
this.xj = true;
}
}
yh() {
this.w6 = new Triangulator(this.dp.count, this.xg, this.xh);
let a = this.w6;
a.triangulationStatusChanged = delegateCombine(a.triangulationStatusChanged, runOn(this, this.yi));
this.w6.y();
}
yf() {
if (this.w6 == null) {
return;
}
this.w6.r();
let a = this.w6;
a.triangulationStatusChanged = delegateRemove(a.triangulationStatusChanged, runOn(this, this.yi));
this.w6 = null;
}
yi(a, b) {
if (this.triangulationStatusChanged != null) {
this.triangulationStatusChanged(this, new TriangulationStatusEventArgs(b.currentStatus));
}
if (b.currentStatus >= 100) {
if (this.w6 == null) {
return;
}
let c = this.w6;
c.triangulationStatusChanged = delegateRemove(c.triangulationStatusChanged, runOn(this, this.yi));
this.xm = this.w6.n();
this.w6 = null;
let d = ((() => {
let $ret = new FastItemsSource();
$ret.e = this.xm;
return $ret;
})());
this.xd = this.xc(d, "v1");
this.xe = this.xc(d, "v2");
this.xf = this.xc(d, "v3");
this.ru(false);
}
}
xc(a, b) {
if (b == null) {
return a.registerColumnInt(null, null, false);
}
let c = null;
let d = SeriesViewer.cv(b, this.coercionMethods);
c = d.a;
return a.registerColumnInt(b, c, this.expectFunctions);
}
rc(a, b, c, d) {
super.rc(a, b, c, d);
switch (b) {
case ScatterTriangulationSeries.$$p[6]:
case ScatterTriangulationSeries.$$p[10]:
case ScatterTriangulationSeries.$$p[7]:
case ScatterTriangulationSeries.$$p[11]:
this.qh();
break;
case "FastItemsSource":
let e = typeCast(IFastItemsSource_$type, c);
if (e != null) {
e.deregisterColumn(this.xg);
e.deregisterColumn(this.xh);
this.xg = null;
this.xh = null;
}
this.yg();
let f = typeCast(IFastItemsSource_$type, d);
if (f != null) {
this.xg = this.dl(this.x5);
this.xh = this.dl(this.yd);
}
this.ru(this.gh && c != null);
break;
case ScatterTriangulationSeries.$$p[8]:
if (this.dp != null) {
this.dp.deregisterColumn(this.xg);
this.xg = this.dl(this.x5);
}
this.yg();
this.ru(false);
this.qn();
break;
case ScatterTriangulationSeries.$$p[12]:
if (this.dp != null) {
this.dp.deregisterColumn(this.xh);
this.xh = this.dl(this.yd);
}
this.yg();
this.ru(false);
this.qn();
break;
case ScatterTriangulationSeries.$$p[5]:
if (c != null) {
(typeCast(Axis.$, c)).b0(this);
}
if (d != null) {
(typeCast(Axis.$, d)).ct(this);
}
if ((this.w3 != null && !this.w3.c1()) || (d == null && c != null)) {
this.ru(false);
}
this.qn();
break;
case ScatterTriangulationSeries.$$p[9]:
if (c != null) {
(typeCast(Axis.$, c)).b0(this);
}
if (d != null) {
(typeCast(Axis.$, d)).ct(this);
}
if ((this.w4 != null && !this.w4.c1()) || (d == null && c != null)) {
this.ru(false);
}
this.qn();
break;
case ScatterTriangulationSeries.$$p[4]:
if (this.trianglesSource != null) {
this.yf();
this.xi = ((() => {
let $ret = new FastItemsSource();
$ret.e = this.trianglesSource;
return $ret;
})());
}
else {
this.xi = null;
}
break;
case ScatterTriangulationSeries.$$p[0]:
let g = typeCast(IFastItemsSource_$type, c);
if (g != null) {
g.deregisterColumn(this.xd);
g.deregisterColumn(this.xe);
g.deregisterColumn(this.xf);
this.xd = null;
this.xe = null;
this.xf = null;
}
let h = typeCast(IFastItemsSource_$type, d);
if (h != null) {
this.xd = this.xc(h, this.xt);
this.xe = this.xc(h, this.xv);
this.xf = this.xc(h, this.xx);
}
this.ru(false);
this.qn();
break;
case ScatterTriangulationSeries.$$p[1]:
if (this.xi != null) {
this.xi.deregisterColumn(this.xd);
this.xd = this.xc(this.xi, this.xt);
}
this.ru(false);
this.qn();
break;
case ScatterTriangulationSeries.$$p[2]:
if (this.xi != null) {
this.xi.deregisterColumn(this.xe);
this.xe = this.xc(this.xi, this.xv);
}
this.ru(false);
this.qn();
break;
case ScatterTriangulationSeries.$$p[3]:
if (this.xi != null) {
this.xi.deregisterColumn(this.xf);
this.xf = this.xc(this.xi, this.xx);
}
this.ru(false);
this.qn();
break;
case "XColumn":
if (this.w3 != null) {
this.w3.c1();
}
break;
case "YColumn":
if (this.w4 != null) {
this.w4.c1();
}
break;
}
}
xl(a) {
if (typeCast(NumericYAxis.$, a) !== null) {
return true;
}
return false;
}
xk(a) {
if (typeCast(NumericXAxis.$, a) !== null) {
return true;
}
return false;
}
hf(a, b, c) {
return super.hf(a, b, c) && this.dp != null && this.w3 != null && this.w4 != null && this.w3.bi != null && this.w4.bi != null && a.width > 0 && a.height > 0 && this.xd != null && this.xd.count > 0 && this.xe != null && this.xe.count > 0 && this.xf != null && this.xf.count > 0 && this.xg != null && this.xg.count > 0 && this.xh != null && this.xh.count > 0;
}
yg() {
if (this.trianglesSource == null) {
this.xm = null;
this.xd = null;
this.xe = null;
this.xf = null;
this.xj = false;
}
}
qd() {
super.qd();
if (this.w3 != null) {
this.w3.ia();
}
if (this.w4 != null) {
this.w4.ia();
}
}
pd(a, b, c, d) {
super.pd(a, b, c, d);
this.yg();
this.ru(false);
}
ay(a) {
if (a != null && a == this.w3 && this.xg != null) {
return new AxisRange(this.xg.minimum, this.xg.maximum);
}
if (a != null && a == this.w4 && this.xh != null) {
return new AxisRange(this.xh.minimum, this.xh.maximum);
}
return null;
}
sv(a, b) {
this.ru(false);
}
su(a, b) {
this.ru(false);
}
get xd() {
return this.w7;
}
set xd(a) {
let b = this.xd != a;
if (b) {
let c = this.xd;
this.w7 = a;
this.raisePropertyChanged("TriangleVertexColumn1", c, this.xd);
}
}
get xe() {
return this.w8;
}
set xe(a) {
let b = this.xe != a;
if (b) {
let c = this.xe;
this.w8 = a;
this.raisePropertyChanged("TriangleVertexColumn2", c, this.xe);
}
}
get xf() {
return this.w9;
}
set xf(a) {
let b = this.xf != a;
if (b) {
let c = this.xf;
this.w9 = a;
this.raisePropertyChanged("TriangleVertexColumn3", c, this.xf);
}
}
get_fy() {
return true;
}
get_fm() {
return true;
}
getDataLegendSeriesContextAt(a, b) {
let c = { $type: Point_$type, x: a, y: b };
let d = this.ko(c);
let e = d == null ? NaN : this.iy(d, "XMemberPath");
let f = d == null ? NaN : this.iy(d, "YMemberPath");
let g = new DataLegendSeriesValueInfo();
g.l = e;
g.a = 13;
g.q = "X";
g.r = this.x5 != null ? this.x5 : "X";
g.s = this.x1 != null ? this.x1 : "X:";
g.t = this.x3 != null ? this.x3 : "";
let h = new DataLegendSeriesValueInfo();
h.l = f;
h.a = 14;
h.q = "Y";
h.r = this.yd != null ? this.yd : "Y";
h.s = this.x9 != null ? this.x9 : "Y:";
h.t = this.yb != null ? this.yb : "";
let i = new DataLegendSeriesContext();
i.e = ((() => {
let $ret = new List$1(DataLegendSeriesValueInfo.$, 0);
$ret.add(g);
$ret.add(h);
return $ret;
})());
i.h = this.me();
return i;
}
}
ScatterTriangulationSeries.$t = /*@__PURE__*/ markType(ScatterTriangulationSeries, 'ScatterTriangulationSeries', Series.$);
ScatterTriangulationSeries.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, ScatterTriangulationSeries, 'raisePropertyChanged', ['FastTrianglesSource:xi:yj', [IFastItemsSource_$type, null], 'TriangleVertexMemberPath1:xt:yl', [2, null], 'TriangleVertexMemberPath2:xv:ym', [2, null], 'TriangleVertexMemberPath3:xx:yn', [2, null], 'TrianglesSource::yk', [IEnumerable_$type, null], 'XAxis:w3:yo', [NumericXAxis.$, null], 'XMemberAsLegendLabel:x1:yp', [2, null], 'XMemberAsLegendUnit:x3:yq', [2, null], 'XMemberPath:x5:yr', [2, null], 'YAxis:w4:ys', [NumericYAxis.$, null], 'YMemberAsLegendLabel:x9:yt', [2, null], 'YMemberAsLegendUnit:yb:yu', [2, null], 'YMemberPath:yd:yv', [2, null]]);
return ScatterTriangulationSeries;
})();