igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
180 lines (179 loc) • 7.26 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 { DataAnnotationPointLayer } from "./DataAnnotationPointLayer";
import { DependencyProperty } from "igniteui-react-core";
import { typeCast, markType, markDep } from "igniteui-react-core";
import { List$1 } from "igniteui-react-core";
import { DataAnnotationInfo } from "./DataAnnotationInfo";
import { IFastItemsSource_$type } from "igniteui-react-core";
import { PropertyMetadata } from "igniteui-react-core";
import { isNaN_ } from "igniteui-react-core";
/**
* @hidden
*/
export let DataAnnotationBandLayer = /*@__PURE__*/ (() => {
class DataAnnotationBandLayer extends DataAnnotationPointLayer {
constructor() {
super();
this.ak8 = null;
this.ab = DataAnnotationBandLayer.$;
}
bk() {
return new DataAnnotationBandLayer();
}
afq(a) {
if (!this.adw(a)) {
return;
}
let b = this.ad6._inner[a];
b.c = new List$1(DataAnnotationInfo.$, 0);
b.b = new List$1(DataAnnotationInfo.$, 0);
b.centerLabelX = this.aeu(a, this.aim);
b.centerLabelY = this.aeu(a, this.ain);
b.startLabelX = this.aeu(a, this.ais);
b.startLabelY = this.aeu(a, this.ait);
b.endLabelX = this.aeu(a, this.aio);
b.endLabelY = this.aeu(a, this.aip);
b.shapeStartX = this.aeb(a, this.aiu, this.adf);
b.shapeStartY = this.aeb(a, this.aiv, this.adg);
b.shapeEndX = this.aeb(a, this.aiq, this.adf);
b.shapeEndY = this.aeb(a, this.air, this.adg);
let c = this.aeb(a, this.ak9, this.adg);
if (isNaN_(c)) {
c = this.ady ? 0.2 : 20;
}
let d = c / 2;
if (isNaN_(b.shapeStartX)) {
b.shapeStartX = b.shapeEndX;
}
if (isNaN_(b.shapeStartY)) {
b.shapeStartY = b.shapeEndY;
}
if (isNaN_(b.shapeEndX)) {
b.shapeEndX = b.shapeStartX;
}
if (isNaN_(b.shapeEndY)) {
b.shapeEndY = b.shapeStartY;
}
b.shapeCenterX = b.shapeStartX + ((b.shapeEndX - b.shapeStartX) / 2);
b.shapeCenterY = b.shapeStartY + ((b.shapeEndY - b.shapeStartY) / 2);
b.c.add(((() => {
let $ret = new DataAnnotationInfo();
$ret.q = b.ab.x;
$ret.r = b.ab.y + d;
return $ret;
})()));
b.c.add(((() => {
let $ret = new DataAnnotationInfo();
$ret.q = b.ab.x;
$ret.r = b.ab.y - d;
return $ret;
})()));
b.c.add(((() => {
let $ret = new DataAnnotationInfo();
$ret.q = b.aa.x;
$ret.r = b.aa.y - d;
return $ret;
})()));
b.c.add(((() => {
let $ret = new DataAnnotationInfo();
$ret.q = b.aa.x;
$ret.r = b.aa.y + d;
return $ret;
})()));
let e = this.aaw != null && this.aaw != this.adf;
let f = this.aaw != null && this.aaw != this.adg;
b.b.add(((() => {
let $ret = new DataAnnotationInfo();
$ret.isStartLabel = true;
$ret.textColor = this.ahn;
$ret.background = this.ahl;
$ret.borderColor = this.ahm;
$ret.q = b.ab.x;
$ret.r = b.ab.y;
$ret.dataLabelX = b.startLabelX;
$ret.dataLabelY = b.startLabelY;
$ret.dataValueX = b.ab.x;
$ret.dataValueY = b.ab.y;
$ret.a = this.aht(this.ahu, e);
$ret.b = this.aht(this.ahv, f);
return $ret;
})()));
b.b.add(((() => {
let $ret = new DataAnnotationInfo();
$ret.isEndLabel = true;
$ret.textColor = this.ahk;
$ret.background = this.ahi;
$ret.borderColor = this.ahj;
$ret.q = b.aa.x;
$ret.r = b.aa.y;
$ret.dataLabelX = b.endLabelX;
$ret.dataLabelY = b.endLabelY;
$ret.dataValueX = b.aa.x;
$ret.dataValueY = b.aa.y;
$ret.a = this.aht(this.ahq, e);
$ret.b = this.aht(this.ahr, f);
return $ret;
})()));
let g = this.ahs(this.aho, e, b.centerLabelX);
let h = this.ahs(this.ahp, f, b.centerLabelY);
b.b.add(((() => {
let $ret = new DataAnnotationInfo();
$ret.isCenterLabel = true;
$ret.textColor = this.ahh;
$ret.background = this.ahf;
$ret.borderColor = this.ahg;
$ret.q = b.z.x;
$ret.r = b.z.y;
$ret.dataLabelX = b.centerLabelX;
$ret.dataLabelY = b.centerLabelY;
$ret.dataValueX = b.z.x;
$ret.dataValueY = b.z.y;
$ret.a = g;
$ret.b = h;
return $ret;
})()));
}
rr(a, b, c, d) {
super.rr(a, b, c, d);
switch (b) {
case "BreadthAnnotationColumn":
this.acb();
break;
case DataAnnotationBandLayer.$$p[0]:
if (this.dp != null) {
this.dp.deregisterColumn(this.ak9);
this.ak9 = this.dl(this.ala);
}
break;
}
}
afs(a, b) {
super.afs(a, b);
if (typeCast(IFastItemsSource_$type, a) != null) {
a.deregisterColumn(this.ak9);
this.ak9 = null;
}
if (typeCast(IFastItemsSource_$type, b) != null) {
this.ak9 = this.dl(this.ala);
}
}
get ak9() {
return this.ak8;
}
set ak9(a) {
if (this.ak8 != a) {
let b = this.ak8;
this.ak8 = a;
this.raisePropertyChanged("BreadthAnnotationColumn", b, this.ak8);
}
}
}
DataAnnotationBandLayer.$t = /*@__PURE__*/ markType(DataAnnotationBandLayer, 'DataAnnotationBandLayer', DataAnnotationPointLayer.$);
DataAnnotationBandLayer.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, DataAnnotationBandLayer, 'raisePropertyChanged', ['AnnotationBreadthMemberPath:ala:ald', [2, null]]);
return DataAnnotationBandLayer;
})();