igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
326 lines (325 loc) • 10.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 { AnnotationLayer } from "./AnnotationLayer";
import { DependencyProperty } from "igniteui-react-core";
import { Series } from "./Series";
import { TrendLineType_$type } from "igniteui-react-core";
import { ValueOverlay } from "./ValueOverlay";
import { Base, enumGetBox, typeCast, fromEnum, markType, markDep } from "igniteui-react-core";
import { AnnotationLayerView } from "./AnnotationLayerView";
import { DoubleCollection } from "igniteui-react-core";
import { DeviceUtils } from "igniteui-react-core";
import { PropertyMetadata } from "igniteui-react-core";
/**
* @hidden
*/
export let TrendLineLayer = /*@__PURE__*/ (() => {
class TrendLineLayer extends AnnotationLayer {
bk() {
return new ValueOverlay();
}
constructor() {
super();
this.aaq = null;
this.aar = null;
this.ab = TrendLineLayer.$;
}
ac() {
super.ac();
}
ct() {
return new TrendLineLayerView(this);
}
q1(a) {
super.q1(a);
this.z9 = a;
}
get_et() {
return true;
}
get_fk() {
return true;
}
yt(a, b) {
if (this.z7 == null || this.z7 == a) {
if (!this.a1.c) {
this.rs(b);
}
}
}
xk(a) {
if (a == null) {
return false;
}
if (a == this) {
return false;
}
if (a.et || a.isStacked) {
return false;
}
return true;
}
ru(a, b) {
super.ru(a, b);
if (this.z7 != null && this.z7.cv == null) {
this.z7.rv();
}
this.cw.a7(b);
let c = typeCast(TrendLineLayerView.$, this.cv);
if (this.z7 != null && c.cg) {
this.z7.rv();
c.cg = false;
}
}
rr(a, b, c, d, e) {
super.rr(a, b, c, d, e);
let f = typeCast(TrendLineLayerView.$, this.cv);
if (this.z7 != null) {
this.z7.rr(a, b, c, d, e);
}
this.cw.a6(c);
}
yu(a) {
super.yu(a);
this.aak();
}
aad() {
switch (this.aaa) {
case 3: return "TrendLineLayer_CubicFit";
case 12: return "TrendLineLayer_CumulativeAverage";
case 10: return "TrendLineLayer_ExponentialAverage";
case 7: return "TrendLineLayer_ExponentialAverage";
case 1: return "TrendLineLayer_LinearFit";
case 6: return "TrendLineLayer_LogarithmicFit";
case 11: return "TrendLineLayer_ModifiedAverage";
case 8: return "TrendLineLayer_PowerLawFit";
case 2: return "TrendLineLayer_QuadraticFit";
case 4: return "TrendLineLayer_QuarticFit";
case 5: return "TrendLineLayer_QuinticFit";
case 9: return "TrendLineLayer_SimpleAverage";
case 13: return "TrendLineLayer_WeightedAverage";
}
return null;
}
aak() {
if (this.z8 != null && this.xk(this.z8)) {
this.z7 = this.z8;
return;
}
if (this.aae != null && this.dc != null) {
for (let a of fromEnum(this.dc.series)) {
if (!this.xk(a)) {
continue;
}
if (Base.equalsStatic(this.aae, a.name)) {
this.z7 = a;
break;
}
}
}
}
aah(a, b) {
this.z9.ck(a, b);
}
aaj() {
if (this.z7 != null && this.z9.ce != null) {
this.z9.ce.g$b = this.aaa;
this.z7.rs(true);
}
}
aai() {
if (this.z7 != null && this.z9.ce != null) {
this.z9.ce.g$f = this.aab;
this.z7.rs(true);
}
}
sj() {
super.sj();
this.ql();
this.y3();
}
y3() {
super.y3();
let a = this.vb;
if (!this.g9) {
if (this.z7 != null) {
a = this.vh != null ? this.vh : this.z7.vb;
if (this.aaq == null) {
this.aaq = this.vb;
}
}
else {
if (this.aaq != null) {
a = this.aaq;
}
}
}
switch (this.w0) {
case 0:
case 1:
a = this.z9.cb(a, this.xp);
break;
case 2:
a = this.z9.cd(a, this.xp);
break;
case 4:
a = this.z9.cc(a, this.xp);
break;
}
this.vb = a;
}
w4() {
return 3;
}
xr() {
return 0.3;
}
xu() {
return -0.4;
}
xt() {
return 0.5;
}
zv() {
return this.w0 == 3 ? this.aas() : null;
}
aas() {
if (this.aar == null) {
this.aar = new DoubleCollection();
this.aar.add(DeviceUtils.g(5));
this.aar.add(DeviceUtils.g(5));
}
return this.aar;
}
ra(a, b, c, d) {
super.ra(a, b, c, d);
switch (b) {
case "SeriesViewer":
this.aak();
break;
case "TrendLineType":
this.aaj();
break;
case "TrendLinePeriod":
this.aai();
break;
case TrendLineLayer.$$p[0]:
this.aah(c, d);
this.y3();
this.z9.cj();
break;
case TrendLineLayer.$$p[2]:
case TrendLineLayer.$$p[1]:
this.aak();
break;
case "ActualBrush":
case "ActualThickness":
case AnnotationLayer.$$p[1]:
case "DashCap":
this.z9.cj();
break;
case "UseItemWiseColors":
this.y3();
break;
}
}
pz(a) {
super.pz(a);
this.z9.aq(a);
}
}
TrendLineLayer.$t = /*@__PURE__*/ markType(TrendLineLayer, 'TrendLineLayer', AnnotationLayer.$);
TrendLineLayer.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, TrendLineLayer, 'raisePropertyChanged', ['ActualTargetSeries:z7:aal', [Series.$, null], 'TargetSeriesName:aae:aam', [2, null], 'TargetSeries:z8:aan', [Series.$, null], 'TrendLineType:aaa:aap', [TrendLineType_$type, /*@__PURE__*/ enumGetBox(TrendLineType_$type, 0)], 'TrendLinePeriod:aab:aao', [1, 7]]);
return TrendLineLayer;
})();
/**
* @hidden
*/
export let TrendLineLayerView = /*@__PURE__*/ (() => {
class TrendLineLayerView extends AnnotationLayerView {
constructor(a) {
super(a);
this.ch = 0;
this.cf = null;
this.ce = null;
this.cg = false;
this.cf = a;
this.ch = TrendLineLayerView.ci++;
}
cl() {
if (this.ce == null && this.cf.z7 != null) {
if (this.r) {
let a = this.cf.z7.cv;
this.ce = a.e();
this.cg = true;
}
else if (this.q) {
let b = this.cf.z7.ba.a$j.item(this.ag);
this.ce = b.e();
}
else {
let c = this.cf.z7.cw;
this.ce = c.e();
}
if (this.ce != null) {
this.ce.g$b = this.cf.aaa;
this.ce.g$f = this.cf.aab;
this.cj();
}
}
}
bc(a, b) {
super.bc(a, b);
if (this.ce != null && a.d) {
if (this.cf.aaa != 0 && !b) {
let c = this.ce.g$n;
c.ad = this.cf.ie;
c._stroke = this.cf.vb;
c.ai = this.cf.zs;
c.aj = this.cf.v5;
a.v(c);
}
}
}
ck(a, b) {
if (a != null) {
let c = null;
if (this.r) {
c = a.cv;
}
else if (this.q) {
c = a.ba.a$j.item(this.ag);
}
else {
c = a.cw;
}
if (this.ce != null) {
c.a8(this.ce);
this.ce = null;
}
}
this.cl();
}
cj() {
if (this.ce != null) {
this.ce.g$n.ad = this.cf.ie;
this.ce.g$n._stroke = this.cf.vb;
this.ce.g$n.ai = this.cf.zs;
this.ce.g$n.aj = this.cf.v5;
}
}
aq(a) {
super.aq(a);
if (this.ce != null) {
this.cf.bc.exportTrendlineData(this.cf, a, this.ce.g$n);
}
}
}
TrendLineLayerView.$t = /*@__PURE__*/ markType(TrendLineLayerView, 'TrendLineLayerView', AnnotationLayerView.$);
TrendLineLayerView.ci = 0;
return TrendLineLayerView;
})();