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.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;
}
o2() {
super.o2();
this.w0 = null;
this.w1 = null;
}
kq(a, b) {
let 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.kq(a, b);
}
md(a) {
let b = this.nd(a);
if (b == ScatterTriangulationSeries.$$p[8]) {
return this.x2;
}
if (b == ScatterTriangulationSeries.$$p[12]) {
return this.ya;
}
return super.md(a);
}
get xd() {
return this.w7;
}
set xd(a) {
let b = this.xd != a;
if (b) {
let c = this.xd;
this.w7 = a;
this.raisePropertyChanged("XColumn", 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("YColumn", c, this.xe);
}
}
rt(a) {
let 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;
}
}
ye() {
this.w3 = new Triangulator(this.dp.count, this.xd, this.xe);
let a = this.w3;
a.triangulationStatusChanged = delegateCombine(a.triangulationStatusChanged, runOn(this, this.yf));
this.w3.y();
}
yc() {
if (this.w3 == null) {
return;
}
this.w3.r();
let a = this.w3;
a.triangulationStatusChanged = delegateRemove(a.triangulationStatusChanged, runOn(this, this.yf));
this.w3 = null;
}
yf(a, b) {
if (this.triangulationStatusChanged != null) {
this.triangulationStatusChanged(this, new TriangulationStatusEventArgs(b.currentStatus));
}
if (b.currentStatus >= 100) {
if (this.w3 == null) {
return;
}
let c = this.w3;
c.triangulationStatusChanged = delegateRemove(c.triangulationStatusChanged, runOn(this, this.yf));
this.xj = this.w3.n();
this.w3 = null;
let d = ((() => {
let $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);
}
}
w9(a, b) {
if (b == null) {
return a.registerColumnInt(null, null, false);
}
let c = null;
let d = SeriesViewer.cu(b, this.coercionMethods);
c = d.a;
return a.registerColumnInt(b, c, this.expectFunctions);
}
ra(a, b, c, d) {
super.ra(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":
let e = typeCast(IFastItemsSource_$type, c);
if (e != null) {
e.deregisterColumn(this.xd);
e.deregisterColumn(this.xe);
this.xd = null;
this.xe = null;
}
this.yd();
let 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 = ((() => {
let $ret = new FastItemsSource();
$ret.e = this.trianglesSource;
return $ret;
})());
}
else {
this.xf = null;
}
break;
case ScatterTriangulationSeries.$$p[0]:
let 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;
}
let 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;
}
}
xi(a) {
if (typeCast(NumericYAxis.$, a) !== null) {
return true;
}
return false;
}
xh(a) {
if (typeCast(NumericXAxis.$, a) !== null) {
return true;
}
return false;
}
he(a, b, c) {
return super.he(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;
}
yd() {
if (this.trianglesSource == null) {
this.xj = null;
this.xa = null;
this.xb = null;
this.xc = null;
this.xg = false;
}
}
qb() {
super.qb();
if (this.w0 != null) {
this.w0.ia();
}
if (this.w1 != null) {
this.w1.ia();
}
}
pb(a, b, c, d) {
super.pb(a, b, c, d);
this.yd();
this.rs(false);
}
ay(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;
}
st(a, b) {
this.rs(false);
}
ss(a, b) {
this.rs(false);
}
get xa() {
return this.w4;
}
set xa(a) {
let b = this.xa != a;
if (b) {
let c = this.xa;
this.w4 = a;
this.raisePropertyChanged("TriangleVertexColumn1", c, this.xa);
}
}
get xb() {
return this.w5;
}
set xb(a) {
let b = this.xb != a;
if (b) {
let c = this.xb;
this.w5 = a;
this.raisePropertyChanged("TriangleVertexColumn2", c, this.xb);
}
}
get xc() {
return this.w6;
}
set xc(a) {
let b = this.xc != a;
if (b) {
let c = this.xc;
this.w6 = a;
this.raisePropertyChanged("TriangleVertexColumn3", c, this.xc);
}
}
get_fx() {
return true;
}
get_fl() {
return true;
}
getDataLegendSeriesContextAt(a, b) {
let c = { $type: Point_$type, x: a, y: b };
let d = this.kn(c);
let e = d == null ? NaN : this.ix(d, "XMemberPath");
let f = d == null ? NaN : this.ix(d, "YMemberPath");
let 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 : "";
let 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 : "";
let i = new DataLegendSeriesContext();
i.e = ((() => {
let $ret = new List$1(DataLegendSeriesValueInfo.$, 0);
$ret.add(g);
$ret.add(h);
return $ret;
})());
i.h = this.mc();
return i;
}
}
ScatterTriangulationSeries.$t = /*@__PURE__*/ markType(ScatterTriangulationSeries, 'ScatterTriangulationSeries', Series.$);
ScatterTriangulationSeries.$$p = /*@__PURE__*/ 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;
})();