igniteui-angular-charts
Version:
Ignite UI Angular charting components for building rich data visualizations for modern web apps.
262 lines (261 loc) • 10.9 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 { Base, Number_$type, typeCast, markType } from "igniteui-angular-core";
import { Thickness } from "igniteui-angular-core";
import { Axis } from "./Axis";
import { List$1 } from "igniteui-angular-core";
import { NumberFormatSpecifier } from "igniteui-angular-core";
import { BindingFormatter } from "igniteui-angular-core";
import { Dictionary$2 } from "igniteui-angular-core";
import { Pool$1 } from "igniteui-angular-core";
import { AxisAnnotation } from "./AxisAnnotation";
import { HashSet$1 } from "igniteui-angular-core";
import { Series } from "./Series";
import { truncate, log10, isNaN_ } from "igniteui-angular-core";
import { round10N } from "igniteui-angular-core";
/**
* @hidden
*/
export let DataAnnotationShapeFrameManager = /*@__PURE__*/ (() => {
class DataAnnotationShapeFrameManager extends Base {
static b(a, b, c, d, e, f, g, h, i) {
a.ab.add(b.xAxisValue);
a.aw.add(b.yAxisValue);
if (f != null) {
a.j.add(b.borderRadius);
a.y.add(b.borderThickness);
a.k.add(b.background);
a.z.add(b.textColor);
a.t.add(b.borderColor);
a.x.add(c.top);
a.v.add(c.left);
a.w.add(c.right);
a.u.add(c.bottom);
if (d) {
a.i.add(f);
a.bn.add(b.xAxisLabel);
a.ac.add(b.xAxisValue);
}
else {
a.i.add(null);
a.bn.add(null);
a.ac.add(NaN);
}
a.l.add(b.xAxisBadgeBackground);
a.q.add(b.xAxisBadgeOutline);
a.r.add(b.xAxisBadgeOutlineThickness);
a.m.add(b.xAxisBadgeRadius);
a.s.add(b.xAxisBadgeSize);
a.p.add(b.xAxisBadgeMargin);
a.o.add(b.xAxisBadgeImagePath);
a.n.add(b.isXAxisBadgeEnabled);
a.aa.add(b.xAxisUserAnnotation);
}
if (g != null) {
a.ae.add(b.borderRadius);
a.at.add(b.borderThickness);
a.af.add(b.background);
a.au.add(b.textColor);
a.ao.add(b.borderColor);
a.as.add(c.top);
a.aq.add(c.left);
a.ar.add(c.right);
a.ap.add(c.bottom);
if (e) {
a.ad.add(g);
a.bo.add(b.yAxisLabel);
a.ax.add(b.yAxisValue);
}
else {
a.ad.add(null);
a.bo.add(null);
a.ax.add(NaN);
}
a.ag.add(b.yAxisBadgeBackground);
a.al.add(b.yAxisBadgeOutline);
a.am.add(b.yAxisBadgeOutlineThickness);
a.ah.add(b.yAxisBadgeRadius);
a.an.add(b.yAxisBadgeSize);
a.ak.add(b.yAxisBadgeMargin);
a.aj.add(b.yAxisBadgeImagePath);
a.ai.add(b.isYAxisBadgeEnabled);
a.av.add(b.yAxisUserAnnotation);
}
}
static a(a, b, c, d) {
if (!b.dq) {
return a.toString();
}
if (c >= 0) {
let e = new NumberFormatSpecifier();
e.minimumFractionDigits = c;
e.maximumFractionDigits = d > 0 ? d : c;
let f = new BindingFormatter();
f.j = "{0}";
f.d = [e];
return f.i(a);
}
let g = 0;
if (d >= 0) {
g = d;
}
else {
let h = b.gh();
g = h == 0 ? 0 : truncate(Math.max(-Math.floor(log10(h)), 0));
g += 1;
}
return round10N(a, g).toString();
}
static c(a, b, c, d, e, f, g, h) {
let i = new List$1(Axis.$, 0);
let j = new HashSet$1(Axis.$, 0);
let k = new Dictionary$2(Axis.$, Number_$type, 0);
for (let l = 0; l < b.ac.count; l++) {
if (isNaN_(b.ac._inner[l]) || isNaN_(b.ab._inner[l])) {
continue;
}
let m = b.i._inner[l];
if (m != null) {
if (!j.contains(m)) {
i.add(m);
k.item(m, 0);
j.add_1(m);
}
let n;
if (!d.containsKey(m)) {
n = new Pool$1(AxisAnnotation.$);
n.create = () => new AxisAnnotation();
n.destroy = (o) => {
};
n.activate = (o) => m.at.add(o);
n.disactivate = (o) => m.at.remove(o);
d.item(m, n);
e.add(m);
}
else {
n = d.item(m);
}
let o = n.item(k.item(m));
k.item(m, k.item(m) + 1);
let p = typeCast(Series.$, a);
if (p != null) {
o.ag = p.mb;
}
o.l = false;
o.value = b.ab._inner[l];
o.text = b.bn._inner[l];
o.textColor = b.z._inner[l];
o.outline = b.t._inner[l];
o.strokeThickness = b.y._inner[l];
o.background = b.k._inner[l];
o.backgroundCornerRadius = b.j._inner[l];
o.backgroundPadding = new Thickness(1, b.v._inner[l], b.x._inner[l], b.w._inner[l], b.u._inner[l]);
o.isBadgeEnabled = b.n._inner[l];
o.badgeSize = b.s._inner[l];
o.badgeMargin = b.p._inner[l];
o.badgeBackground = b.l._inner[l];
o.badgeOutline = b.q._inner[l];
o.badgeOutlineThickness = b.r._inner[l];
o.badgeCornerRadius = b.m._inner[l];
o.badgeImagePath = b.o._inner[l];
o.k = b.aa._inner[l];
o.o = false;
if (o.l) {
o.l = false;
c = true;
}
}
}
for (let q = 0; q < b.ax.count; q++) {
if (isNaN_(b.ax._inner[q]) || isNaN_(b.aw._inner[q])) {
continue;
}
let r = b.ad._inner[q];
if (r != null) {
if (!j.contains(r)) {
i.add(r);
k.item(r, 0);
j.add_1(r);
}
let s;
if (!d.containsKey(r)) {
s = new Pool$1(AxisAnnotation.$);
s.create = () => new AxisAnnotation();
s.destroy = (t) => {
};
s.activate = (t) => r.at.add(t);
s.disactivate = (t) => r.at.remove(t);
d.item(r, s);
e.add(r);
}
else {
s = d.item(r);
}
let t = s.item(k.item(r));
k.item(r, k.item(r) + 1);
let u = typeCast(Series.$, a);
if (u != null) {
t.ag = u.mb;
}
t.l = false;
t.value = b.aw._inner[q];
t.text = b.bo._inner[q];
t.textColor = b.au._inner[q];
t.background = b.af._inner[q];
t.outline = b.ao._inner[q];
t.strokeThickness = b.at._inner[q];
t.backgroundCornerRadius = b.ae._inner[q];
t.backgroundPadding = new Thickness(1, b.aq._inner[q], b.as._inner[q], b.ar._inner[q], b.ap._inner[q]);
t.isBadgeEnabled = b.ai._inner[q];
t.badgeSize = b.an._inner[q];
t.badgeMargin = b.ak._inner[q];
t.badgeBackground = b.ag._inner[q];
t.badgeOutline = b.al._inner[q];
t.badgeOutlineThickness = b.am._inner[q];
t.badgeCornerRadius = b.ah._inner[q];
t.badgeImagePath = b.aj._inner[q];
t.k = b.av._inner[q];
t.o = false;
if (t.l) {
t.l = false;
c = true;
}
}
}
for (let v = 0; v < i.count; v++) {
if (d.containsKey(i._inner[v])) {
let w = d.item(i._inner[v]);
w.count = k.item(i._inner[v]);
}
}
for (let x = e.count - 1; x >= 0; x--) {
if (!j.contains(e._inner[x])) {
c = true;
let y = d.item(e._inner[x]);
y.count = 0;
y.activate = null;
y.create = null;
y.destroy = null;
y.disactivate = null;
d.removeItem(e._inner[x]);
e.removeAt(x);
}
}
if (c && f) {
for (let z = 0; z < i.count; z++) {
let aa = i._inner[z];
if (aa.bq.c) {
aa.kv(true);
aa.bq.c = false;
}
}
}
}
}
DataAnnotationShapeFrameManager.$t = markType(DataAnnotationShapeFrameManager, 'DataAnnotationShapeFrameManager');
return DataAnnotationShapeFrameManager;
})();