igniteui-angular-charts
Version:
Ignite UI Angular charting components for building rich data visualizations for modern web apps.
331 lines (330 loc) • 10.8 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-angular-core";
import { TrendLineType_$type } from "igniteui-angular-core";
import { ValueOverlay } from "./ValueOverlay";
import { enumGetBox, typeCast, markType, markDep } from "igniteui-angular-core";
import { AnnotationLayerView } from "./AnnotationLayerView";
import { DoubleCollection } from "igniteui-angular-core";
import { DeviceUtils } from "igniteui-angular-core";
import { PropertyMetadata } from "igniteui-angular-core";
/**
* @hidden
*/
export let TrendLineLayer = /*@__PURE__*/ (() => {
class TrendLineLayer extends AnnotationLayer {
constructor() {
super();
this.aa8 = null;
this.aa9 = null;
this.ab = TrendLineLayer.$;
}
bk() {
return new ValueOverlay();
}
ac() {
super.ac();
}
ct() {
return new TrendLineLayerView(this);
}
rg(a) {
super.rg(a);
this.aau = a;
}
get_ev() {
return true;
}
get_fn() {
return true;
}
get_isUsableInLegend() {
return this.x6 && this.aas != null;
}
zd(a, b) {
if (this.aas == null || this.aas == a) {
if (!this.a1.c) {
this.r7(b);
}
}
}
x3(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;
}
r9(a, b) {
super.r9(a, b);
if (this.aas != null && this.aas.cv == null) {
this.aas.sa();
}
this.cw.be(b);
let c = typeCast(TrendLineLayerView.$, this.cv);
if (this.aas != null && c.cp) {
this.aas.sa();
c.cp = false;
}
}
r6(a, b, c, d, e) {
super.r6(a, b, c, d, e);
let f = typeCast(TrendLineLayerView.$, this.cv);
if (this.aas != null) {
this.aas.r6(a, b, c, d, e);
}
this.cw.bd(c);
}
ze(a) {
super.ze(a);
if (this.aas == null) {
this.aa3();
}
else {
if (a.oldItems != null && a.oldItems.contains(this.aas)) {
this.aas = null;
}
}
}
aay() {
switch (this.aav) {
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;
}
aa3() {
if (this.aat != null && this.x3(this.aat)) {
this.aas = this.aat;
return;
}
}
aa0(a, b) {
this.aau.ct(a, b);
if (b != null) {
b.r7(true);
}
this.o8(this.a5, this.a5);
}
aa2() {
if (this.aas != null && this.aau.cn != null) {
this.aau.cn.g$b = this.aav;
this.aas.r7(true);
}
}
aa1() {
if (this.aas != null && this.aau.cn != null) {
this.aau.cn.g$f = this.aaw;
this.aas.r7(true);
}
}
sy() {
super.sy();
this.qz();
this.zn();
}
zn() {
super.zn();
let a = this.vs;
if (!this.x5) {
if (this.aas != null) {
a = this.vy != null ? this.vy : this.aas.vs;
if (this.aa8 == null) {
this.aa8 = this.vs;
}
}
else {
if (this.aa8 != null) {
a = this.aa8;
}
}
}
switch (this.xi) {
case 0:
case 1:
a = this.aau.ck(a, this.x8);
break;
case 2:
a = this.aau.cm(a, this.x8);
break;
case 4:
a = this.aau.cl(a, this.x8);
break;
}
this.vs = a;
}
xm() {
return 3;
}
ya() {
return 0.3;
}
yd() {
return -0.4;
}
yc() {
return 0.5;
}
aag() {
return this.xi == 3 ? this.aba() : null;
}
aba() {
if (this.aa9 == null) {
this.aa9 = new DoubleCollection();
this.aa9.add(DeviceUtils.g(5));
this.aa9.add(DeviceUtils.g(5));
}
return this.aa9;
}
rp(a, b, c, d) {
super.rp(a, b, c, d);
switch (b) {
case "SeriesViewer":
this.aa3();
break;
case "TrendLineType":
this.aa2();
break;
case "TrendLinePeriod":
this.aa1();
break;
case TrendLineLayer.$$p[0]:
this.aa0(c, d);
this.zn();
this.aau.cs();
break;
case TrendLineLayer.$$p[1]:
this.aa3();
break;
case "ActualBrush":
case "ActualThickness":
case AnnotationLayer.$$p[1]:
case "DashCap":
this.aau.cs();
break;
case "UseItemWiseColors":
this.zn();
break;
}
}
qc(a) {
super.qc(a);
this.aau.ax(a);
}
}
TrendLineLayer.$t = markType(TrendLineLayer, 'TrendLineLayer', AnnotationLayer.$);
TrendLineLayer.$$p = markDep(DependencyProperty, PropertyMetadata, TrendLineLayer, 'raisePropertyChanged', ['ActualTargetSeries:aas:aa4', [Series.$, null], 'TargetSeries:aat:aa5', [Series.$, null], 'TrendLineType:aav:aa7', [TrendLineType_$type, enumGetBox(TrendLineType_$type, 0)], 'TrendLinePeriod:aaw:aa6', [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.aas != null) {
if (this.t) {
let a = this.co.aas.cv;
this.cn = a.e();
this.cp = true;
}
else if (this.s) {
let b = this.co.aas.ba.a$k.item(this.al);
this.cn = b.e();
}
else {
let c = this.co.aas.cw;
this.cn = c.e();
}
if (this.cn != null) {
this.cn.g$b = this.co.aav;
this.cn.g$f = this.co.aaw;
this.cs();
}
}
}
bj(a, b) {
super.bj(a, b);
if (this.cn != null && a.d) {
if (this.co.aav != 0 && !b) {
let c = this.cn.g$n;
c.ad = this.co.il;
c._stroke = this.co.vs;
c.ai = this.co.aad;
c.aj = this.co.wm;
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.il;
this.cn.g$n._stroke = this.co.vs;
this.cn.g$n.ai = this.co.aad;
this.cn.g$n.aj = this.co.wm;
}
}
ax(a) {
super.ax(a);
if (this.cn != null) {
this.co.bc.exportTrendlineData(this.co, a, this.cn.g$n);
}
}
}
TrendLineLayerView.$t = markType(TrendLineLayerView, 'TrendLineLayerView', AnnotationLayerView.$);
TrendLineLayerView.cr = 0;
return TrendLineLayerView;
})();