igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
330 lines (329 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 { Series } from "./Series";
import { DependencyProperty } from "igniteui-react-core";
import { TrendLineType_$type } from "igniteui-react-core";
import { enumGetBox, typeCast, 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 TrendLineLayer();
}
constructor() {
super();
this.aba = null;
this.abb = null;
this.ab = TrendLineLayer.$;
}
ac() {
super.ac();
}
ct() {
return new TrendLineLayerView(this);
}
rj(a) {
super.rj(a);
this.aaw = a;
}
get_ev() {
return true;
}
get_fo() {
return true;
}
get_isUsableInLegend() {
return this.x9 && this.aau != null;
}
zf(a, b) {
if (this.aau == null || this.aau == a) {
if (!this.a1.c) {
this.sa(b);
}
}
}
x6(a) {
if (a == null) {
return false;
}
if (a == this) {
return false;
}
if (a.dc != this.dc) {
return false;
}
if (a.ev || a.isStacked) {
return false;
}
return true;
}
sc(a, b) {
super.sc(a, b);
if (this.aau != null && this.aau.cv == null) {
this.aau.sd();
}
this.cw.be(b);
let c = typeCast(TrendLineLayerView.$, this.cv);
if (this.aau != null && c.cp) {
this.aau.sd();
c.cp = false;
}
}
r9(a, b, c, d, e) {
super.r9(a, b, c, d, e);
let f = typeCast(TrendLineLayerView.$, this.cv);
if (this.aau != null) {
this.aau.r9(a, b, c, d, e);
}
this.cw.bd(c);
}
zg(a) {
super.zg(a);
if (this.aau == null) {
this.aa5();
}
else {
if (a.oldItems != null && a.oldItems.contains(this.aau)) {
this.aau = null;
}
}
}
aa0() {
switch (this.aax) {
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;
}
aa5() {
if (this.aav != null && this.x6(this.aav)) {
this.aau = this.aav;
return;
}
}
aa2(a, b) {
this.aaw.ct(a, b);
if (b != null) {
b.sa(true);
}
this.pb(this.a5, this.a5);
}
aa4() {
if (this.aau != null && this.aaw.cn != null) {
this.aaw.cn.g$b = this.aax;
this.aau.sa(true);
}
}
aa3() {
if (this.aau != null && this.aaw.cn != null) {
this.aaw.cn.g$f = this.aay;
this.aau.sa(true);
}
}
s1() {
super.s1();
this.q2();
this.zp();
}
zp() {
super.zp();
let a = this.vv;
if (!this.x8) {
if (this.aau != null) {
a = this.v1 != null ? this.v1 : this.aau.vv;
if (this.aba == null) {
this.aba = this.vv;
}
}
else {
if (this.aba != null) {
a = this.aba;
}
}
}
switch (this.xl) {
case 0:
case 1:
a = this.aaw.ck(a, this.yb);
break;
case 2:
a = this.aaw.cm(a, this.yb);
break;
case 4:
a = this.aaw.cl(a, this.yb);
break;
}
this.vv = a;
}
xp() {
return 3;
}
yd() {
return 0.3;
}
yg() {
return -0.4;
}
yf() {
return 0.5;
}
aai() {
return this.xl == 3 ? this.abc() : null;
}
abc() {
if (this.abb == null) {
this.abb = new DoubleCollection();
this.abb.add(DeviceUtils.g(5));
this.abb.add(DeviceUtils.g(5));
}
return this.abb;
}
rs(a, b, c, d) {
super.rs(a, b, c, d);
switch (b) {
case "SeriesViewer":
this.aa5();
break;
case "TrendLineType":
this.aa4();
break;
case "TrendLinePeriod":
this.aa3();
break;
case TrendLineLayer.$$p[0]:
this.aa2(c, d);
this.zp();
this.aaw.cs();
break;
case TrendLineLayer.$$p[1]:
this.aa5();
break;
case "ActualBrush":
case "ActualThickness":
case AnnotationLayer.$$p[1]:
case "DashCap":
this.aaw.cs();
break;
case "UseItemWiseColors":
this.zp();
break;
}
}
qf(a) {
super.qf(a);
this.aaw.ax(a);
}
}
TrendLineLayer.$t = /*@__PURE__*/ markType(TrendLineLayer, 'TrendLineLayer', AnnotationLayer.$);
TrendLineLayer.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, TrendLineLayer, 'raisePropertyChanged', ['ActualTargetSeries:aau:aa6', [Series.$, null], 'TargetSeries:aav:aa7', [Series.$, null], 'TrendLineType:aax:aa9', [TrendLineType_$type, /*@__PURE__*/ enumGetBox(TrendLineType_$type, 0)], 'TrendLinePeriod:aay:aa8', [1, 7]]);
return TrendLineLayer;
})();
/**
* @hidden
*/
export let TrendLineLayerView = /*@__PURE__*/ (() => {
class TrendLineLayerView extends AnnotationLayerView {
constructor(a) {
super(a);
this.cq = 0;
this.co = null;
this.cn = null;
this.cp = false;
this.co = a;
this.cq = TrendLineLayerView.cr++;
}
cu() {
if (this.cn == null && this.co.aau != null) {
if (this.t) {
let a = this.co.aau.cv;
this.cn = a.e();
this.cp = true;
}
else if (this.s) {
let b = this.co.aau.ba.a$k.item(this.al);
this.cn = b.e();
}
else {
let c = this.co.aau.cw;
this.cn = c.e();
}
if (this.cn != null) {
this.cn.g$b = this.co.aax;
this.cn.g$f = this.co.aay;
this.cs();
}
}
}
bj(a, b) {
super.bj(a, b);
if (this.cn != null && a.d) {
if (this.co.aax != 0 && !b) {
let c = this.cn.g$n;
c.ad = this.co.io;
c._stroke = this.co.vv;
c.ai = this.co.aaf;
c.aj = this.co.wp;
a.v(c);
}
}
}
ct(a, b) {
if (a != null) {
let c = null;
if (this.t) {
c = a.cv;
}
else if (this.s) {
c = a.ba.a$k.item(this.al);
}
else {
c = a.cw;
}
if (this.cn != null) {
c.bf(this.cn);
this.cn = null;
}
}
this.cu();
}
cs() {
if (this.cn != null) {
this.cn.g$n.ad = this.co.io;
this.cn.g$n._stroke = this.co.vv;
this.cn.g$n.ai = this.co.aaf;
this.cn.g$n.aj = this.co.wp;
}
}
ax(a) {
super.ax(a);
if (this.cn != null) {
this.co.bc.exportTrendlineData(this.co, a, this.cn.g$n);
}
}
}
TrendLineLayerView.$t = /*@__PURE__*/ markType(TrendLineLayerView, 'TrendLineLayerView', AnnotationLayerView.$);
TrendLineLayerView.cr = 0;
return TrendLineLayerView;
})();