igniteui-angular-charts
Version:
Ignite UI Angular charting components for building rich data visualizations for modern web apps.
340 lines (339 loc) • 11.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 { HorizontalAnchoredCategorySeries } from "./HorizontalAnchoredCategorySeries";
import { DependencyProperty } from "igniteui-angular-core";
import { ConsolidatedItemsPosition_$type } from "./ConsolidatedItemsPosition";
import { Defaults } from "./Defaults";
import { runOn, enumGetBox, markType, markDep, fromEnum } from "igniteui-angular-core";
import { Pool$1 } from "igniteui-angular-core";
import { Rectangle } from "igniteui-angular-core";
import { ChartSelection } from "./ChartSelection";
import { List$1 } from "igniteui-angular-core";
import { ScalerParams } from "./ScalerParams";
import { PropertyMetadata } from "igniteui-angular-core";
import { truncate, isNaN_, isInfinity } from "igniteui-angular-core";
import { AnchoredCategorySeriesView } from "./AnchoredCategorySeriesView";
/**
* @hidden
*/
export let ColumnSeries = /*@__PURE__*/ (() => {
class ColumnSeries extends HorizontalAnchoredCategorySeries {
constructor() {
super();
this.ado = null;
this.adj = 0;
this.ab = ColumnSeries.$;
this.ac2 = 2;
}
bk() {
return new ColumnSeries();
}
get_e2() {
return true;
}
get_fo() {
return true;
}
js() {
if (!isNaN_(this.jr)) {
return super.js();
}
return Defaults.h;
}
ct() {
return new ColumnSeriesView(this);
}
rg(a) {
super.rg(a);
this.adi = a;
}
cz() {
if (this.c0 == 0) {
return 2;
}
return super.cz();
}
zo() {
return 1;
}
get_ef() {
return true;
}
preferredCategoryMode(a) {
return this.ac2;
}
w7(a) {
if (this.ado == null) {
this.ado = runOn(this, this.adl);
}
let b = this.ac5 != null ? this.ac5 : this.yAxis;
let c = this.acz;
return this.abm.c$d(this, a, c, b, this.ze, this.aaf(this.cw), this.aag(this.cw), this.ado);
}
g2(a, b) {
if (this.g5(a, b)) {
return true;
}
if (this.x1(a, b)) {
return true;
}
return false;
}
ph(a, b) {
super.ph(a, b);
let c = b;
if (a && c.du != null) {
c.du.count = 0;
}
}
i3() {
return this.acz.pw(this.cw.ca, this.cw.b9, this.getEffectiveViewport1(this.cw));
}
ak(a, b) {
let c = new List$1(ChartSelection.$, 0);
this.qh(a, c, b);
return c.toArray();
}
qh(a, b, c) {
this.aaz(a, b, c, this.zd, 1);
}
aa7(a, b) {
super.aa7(a, b);
let c = a.k;
if (!b.w()) {
return;
}
let d = b.ca;
let e = b.b9;
let f = this.getEffectiveViewport1(b);
let g = new ScalerParams(0, d, e, this.ac5.dn, f);
g.b = this.i5();
let h = new ScalerParams(0, d, e, this.acz.dn, f);
let i = this.ac5;
let j = i.f5(i.q7, g);
let k = this.acz.pw(d, e, f);
let l = this.acz;
let m = b;
if (isNaN_(k) || isInfinity(k)) {
m.du.count = 0;
return;
}
this.zm.a2(this, this.z6(), runOn(this, this.y6), this.aaf(b), this.aag(b));
this.zm.r = this.adm;
this.zm.s = this.adn;
this.zm.k = this.adm;
this.zm.l = this.adn;
let n = false;
let o = this.zm.b;
if (o != null) {
n = true;
}
let p = this.acz.dv;
let q = p ? this.acz : null;
let r = this.valueColumn.count;
let s = this.aaf(b);
let t = 0;
for (let u = 0; u < c.count; ++u) {
let v = c._inner[u][0] - 0.5 * k;
let w = this.adl(c._inner[u]);
let x = j;
w = Math.max(w, -100);
x = Math.min(x, e.bottom + 100);
let y = Math.abs(x - w);
if (isInfinity(y) || isNaN_(y)) {
continue;
}
let z = m.du.item(t);
t++;
z.width = k;
z.height = y;
let aa = this.zm.aw(r, u)[0];
if (p && a.r != null && u >= 0 && u < a.r.count) {
aa = truncate(Math.round(a.r._inner[u]));
}
if (n) {
this.aa3(c, u, r, l, h, b.t, aa);
}
if (z.dataContext != null) {
let ab = z.dataContext;
if (s == 1) {
if (aa >= 0 && aa < this.dp.count) {
if (q != null && q.i$b != null && q.i$b.count > aa) {
aa = q.i$b._inner[aa];
}
ab.item = this.dp.item(aa);
}
}
else {
ab.item = null;
}
}
this.zm.ad(z, false, false, false, false);
z.ap = this.zm.k;
z.aq = this.zm.l;
m.dz(z, v, Math.min(x, w));
}
m.du.count = t;
b.dg(a);
}
get adk() {
return this.adj;
}
set adk(a) {
if (this.adk != a) {
let b = this.adk;
this.adj = a;
this.raisePropertyChanged("ConsolidatedColumnVerticalPosition", enumGetBox(ConsolidatedItemsPosition_$type, b), enumGetBox(ConsolidatedItemsPosition_$type, this.adk));
}
}
adl(a) {
if (a == null || a.length < 3) {
return NaN;
}
switch (this.adk) {
case 0: return a[1];
case 1: return a[2];
case 2: return (a[1] + a[2]) / 2;
case 3:
let b = (a[1] + a[2]) / 2;
if (this.yAxis == null) {
return b;
}
let c = this.yAxis.f8(b, new ScalerParams(1, this.dc.za, this.dc.y9, this.yAxis.dn));
if (c < this.yAxis.q7) {
return a[2];
}
else {
return a[1];
}
case 4:
let d = (a[1] + a[2]) / 2;
let e = this.yAxis.f8(d, new ScalerParams(1, this.dc.za, this.dc.y9, this.yAxis.dn));
if (this.yAxis == null) {
return d;
}
if (e < this.yAxis.q7) {
return a[1];
}
else {
return a[2];
}
default: return (a[1] + a[2]) / 2;
}
}
get useHighMarkerFidelity() {
return this.aaa;
}
}
ColumnSeries.$t = markType(ColumnSeries, 'ColumnSeries', HorizontalAnchoredCategorySeries.$);
ColumnSeries.$$p = markDep(DependencyProperty, PropertyMetadata, ColumnSeries, 'raisePropertyChanged', ['RadiusX:adm:ads', [1, 0], 'RadiusY:adn:adt', [1, 0]]);
return ColumnSeries;
})();
/**
* @hidden
*/
export let ColumnSeriesView = /*@__PURE__*/ (() => {
class ColumnSeriesView extends AnchoredCategorySeriesView {
constructor(a) {
super(a);
this.dt = null;
this.dv = null;
this.d0 = new Rectangle();
this.du = null;
this.dt = a;
this.du = ((() => {
let $ret = new Pool$1(Rectangle.$);
$ret.create = runOn(this, this.d1);
$ret.activate = runOn(this, this.dw);
$ret.disactivate = runOn(this, this.dy);
$ret.destroy = runOn(this, this.dx);
return $ret;
})());
}
a4() {
super.a4();
this.dv = new List$1(Rectangle.$, 0);
if (!this.t) {
this.dt.jy = Defaults.i;
this.dt.xu = Defaults.c;
}
}
d1() {
let a = new Rectangle();
this.dv.add(a);
a._visibility = 1;
return a;
}
dw(a) {
a._visibility = 0;
}
dy(a) {
a._visibility = 1;
}
dx(a) {
this.dv.remove(a);
}
dz(a, b, c) {
if (!this.isDirty) {
this.a2();
}
a.o = c;
a.n = b;
}
ak(a) {
return this.dv._inner[a];
}
aj(a) {
let b = this.dv._inner[a];
this.d0._visibility = b._visibility;
this.d0.n = b.n;
this.d0.o = b.o;
this.d0.width = b.width;
this.d0.height = b.height;
let c = this.b4(a);
this.d0._fill = c;
this.d0._stroke = c;
this.d0.ad = this.f.il + 3;
return this.d0;
}
bj(a, b) {
super.bj(a, b);
if (a.d) {
for (let c = 0; c < this.dv.count; c++) {
let d = this.ai(c, b);
this.br(d, c, b);
a.w(d);
}
}
}
ax(a) {
super.ax(a);
let b = 0;
let c = new List$1(Rectangle.$, 0);
for (let d of fromEnum(this.du.a)) {
c.add(d);
}
c.aa((e, f) => {
if (e.n < f.n) {
return -1;
}
else if (e.n > f.n) {
return 1;
}
else {
return 0;
}
});
for (let e of fromEnum(c)) {
this.f.bc.exportRectangleData(a, e, "column" + b, ["Main", "Fill"]);
}
b++;
}
}
ColumnSeriesView.$t = markType(ColumnSeriesView, 'ColumnSeriesView', AnchoredCategorySeriesView.$);
return ColumnSeriesView;
})();