igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
310 lines (309 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 { __extends } from "tslib";
import { HorizontalAnchoredCategorySeries } from "./HorizontalAnchoredCategorySeries";
import { CategoryLineRasterizer } from "./CategoryLineRasterizer";
import { typeCast, Array_$type, runOn, markType } from "igniteui-react-core";
import { ISortingAxis_$type } from "./ISortingAxis";
import { List$1 } from "igniteui-react-core";
import { Path } from "igniteui-react-core";
import { ScalerParams } from "./ScalerParams";
import { ChartSelection } from "./ChartSelection";
import { intDivide, isNaN_ } from "igniteui-react-core";
import { AnchoredCategorySeriesView } from "./AnchoredCategorySeriesView";
import { Defaults } from "./Defaults";
import { Color } from "igniteui-react-core";
/**
* @hidden
*/
var StepLineSeries = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(StepLineSeries, _super);
function StepLineSeries() {
var _this = _super.call(this) || this;
_this.acx = null;
_this.acx = new CategoryLineRasterizer();
_this.ab = StepLineSeries.$;
return _this;
}
StepLineSeries.prototype.bk = function () {
return new StepLineSeries();
};
StepLineSeries.prototype.get_fk = function () {
return true;
};
StepLineSeries.prototype.get_f1 = function () {
return true;
};
StepLineSeries.prototype.get_fl = function () {
return true;
};
StepLineSeries.prototype.ct = function () {
return new StepLineSeriesView(this);
};
StepLineSeries.prototype.zq = function () {
return true;
};
StepLineSeries.prototype.q1 = function (a) {
_super.prototype.q1.call(this, a);
this.acy = a;
};
StepLineSeries.prototype.ac = function () {
_super.prototype.ac.call(this);
};
StepLineSeries.prototype.preferredCategoryMode = function (a) {
return typeCast(ISortingAxis_$type, a) !== null ? 0 : 1;
};
StepLineSeries.prototype.get_ew = function () {
return true;
};
StepLineSeries.prototype.o5 = function (a, b) {
_super.prototype.o5.call(this, a, b);
var c = b;
c.dk();
};
StepLineSeries.prototype.b3 = function () {
if (this.b4 == 0) {
return 2;
}
else {
return _super.prototype.b3.call(this);
}
};
StepLineSeries.prototype.iv = function (a, b, c, d, e, f, g, h) {
var i = NaN;
if (c >= 0 && c < b.count) {
i = b.item(c);
}
var j = NaN;
if (d >= 0 && d < b.count) {
j = b.item(d);
}
if (f == 0) {
return j;
}
if (e == b.count - 1) {
return i;
}
if (isNaN_(j) && g != 0 && a <= 0.5 && !h) {
return i;
}
if (isNaN_(i) && g != 0 && a >= 0.5 && !h) {
return j;
}
if (a > 0.5) {
return j;
}
return i;
};
StepLineSeries.prototype.acz = function (a, b, c, d, e, f) {
var g;
if (b) {
if (f) {
g = (a & 1) == 0;
if (g || (intDivide(a, 2)) + 1 < 0) {
return c.h._inner[(intDivide(a, 2))][0];
}
if (c.h.count == (intDivide(a, 2)) + 1) {
return c.h._inner[(intDivide(a, 2))][0];
}
return c.h._inner[(intDivide(a, 2)) + 1][0];
}
g = (a & 1) == 0;
return c.h._inner[(intDivide(a, 2))][0] + (g ? d : -d);
}
if (f) {
g = (a & 1) == 0;
if (g || ((intDivide(a, 2)) + 1) >= c.h.count) {
return c.h._inner[(intDivide(a, 2))][0];
}
if (c.h.count == (intDivide(a, 2)) + 1) {
return c.h._inner[(intDivide(a, 2))][0];
}
return c.h._inner[(intDivide(a, 2)) + 1][0];
}
g = (a & 1) == 0;
return c.h._inner[(intDivide(a, 2))][0] + (g ? -d : d);
};
StepLineSeries.prototype.aam = function (a, b) {
_super.prototype.aam.call(this, a, b);
var c = b.b2;
var d = b.b1;
var e = this.getEffectiveViewport1(b);
var f = typeCast(ISortingAxis_$type, this.ace) != null;
var g = this.ace.ch;
var h = 0;
if (this.ace != null) {
h = 0.5 * this.ace.getCategorySize(c, d, e);
}
var i = a.h;
var j = 2 * i.count;
var k = new List$1(Array_$type, 2, j);
if (!this.ace.ch) {
for (var l = 0; l < j; l++) {
var m = new Array(4);
m[0] = this.acz(l, false, a, h, g, f);
m[1] = a.h._inner[(intDivide(l, 2))][1];
m[2] = this.acz(l, true, a, h, g, f);
m[3] = a.h._inner[(intDivide(l, 2))][2];
k.add(m);
}
}
else {
for (var n = 0; n < j; n++) {
var o = new Array(4);
o[0] = this.acz(n, true, a, h, g, f);
o[1] = a.h._inner[(intDivide(n, 2))][1];
o[2] = this.acz(n, true, a, h, g, f);
o[3] = a.h._inner[(intDivide(n, 2))][2];
k.add(o);
}
}
var p = typeCast(StepLineSeriesView.$, b);
var q = p.c0.d;
this.y4.a2(this, this.zo(), runOn(this, this.yo), this.zx(b), this.zy(b));
var r = false;
var s = this.y4.b;
if (s != null) {
r = true;
}
if (r) {
var t = new ScalerParams(0, b.b2, b.b1, this.ace.ch, e);
this.aai(i, -1, this.valueColumn.count, this.ace, t, b.r, -1);
}
var u = p.dr;
var v = p.ds;
var w = p.dq;
this.y4.ad(u, true, false, true, false);
this.y4.ad(v, true, false, true, false);
this.y4.ad(w, false, true, false, false);
w._opacity = 0.75 * this.y4.j;
if (b.c4(a)) {
p.dl(j, k, false, 1, this.aau(k, j - 1, b.b1, b.b2), q, this.id);
b.c7(a);
}
};
StepLineSeries.prototype.p4 = function (a, b, c) {
this.aae(a, b, c, this.yv, 0);
};
StepLineSeries.prototype.ak = function (a, b) {
var c = new List$1(ChartSelection.$, 0);
this.p4(a, c, b);
return c.toArray();
};
Object.defineProperty(StepLineSeries.prototype, "useHighMarkerFidelity", {
get: function () {
return this.zs;
},
enumerable: false,
configurable: true
});
StepLineSeries.$t = markType(StepLineSeries, 'StepLineSeries', HorizontalAnchoredCategorySeries.$);
return StepLineSeries;
}(HorizontalAnchoredCategorySeries));
export { StepLineSeries };
/**
* @hidden
*/
var StepLineSeriesView = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(StepLineSeriesView, _super);
function StepLineSeriesView(a) {
var _this = _super.call(this, a) || this;
_this.dj = null;
_this.du = new Path();
_this.dt = new Path();
_this.dv = new Path();
_this.dp = new Path();
_this.dn = new Path();
_this.dm = new Path();
_this.dj = a;
return _this;
}
StepLineSeriesView.prototype.ax = function () {
_super.prototype.ax.call(this);
if (!this.r) {
this.dj.xc = Defaults.c;
}
};
Object.defineProperty(StepLineSeriesView.prototype, "dr", {
get: function () {
return this.du;
},
enumerable: false,
configurable: true
});
Object.defineProperty(StepLineSeriesView.prototype, "ds", {
get: function () {
return this.dv;
},
enumerable: false,
configurable: true
});
Object.defineProperty(StepLineSeriesView.prototype, "dq", {
get: function () {
return this.dt;
},
enumerable: false,
configurable: true
});
StepLineSeriesView.prototype.dk = function () {
this.dt.an = null;
this.du.an = null;
this.dv.an = null;
this.av();
};
StepLineSeriesView.prototype.dl = function (a, b, c, d, e, f, g) {
this.dj.acx.a = typeCast(ISortingAxis_$type, this.c2.fetchXAxis()) !== null ? true : false;
this.dj.acx.m(this.du, this.dt, this.dv, a, b, c, d, e, f, g);
this.av();
};
StepLineSeriesView.prototype.bi = function () {
_super.prototype.bi.call(this);
this.dn.an = this.du.an;
this.dp.an = this.dv.an;
this.dm.an = this.dt.an;
var a = this.bv();
this.dn._stroke = a;
this.dn.ad = this.f.ie + 3;
this.dp._stroke = a;
this.dp.ad = this.f.ie + 3;
this.dm._fill = a;
this.dm._opacity = 1;
};
StepLineSeriesView.prototype.bc = function (a, b) {
_super.prototype.bc.call(this, a, b);
if (a.d) {
if (b) {
a.t(this.dm);
a.t(this.dn);
a.t(this.dp);
}
else {
a.t(this.dt);
a.t(this.du);
a.t(this.dv);
}
}
};
StepLineSeriesView.prototype.aq = function (a) {
_super.prototype.aq.call(this, a);
this.f.bc.exportPathData(a, this.du, "lowerShape", ["Lower", "Main"]);
this.f.bc.exportPathData(a, this.dv, "upperShape", ["Upper"]);
this.f.bc.exportPathData(a, this.dt, "translucentShape", ["Translucent"]);
};
StepLineSeriesView.prototype.ai = function () {
var a = new Color();
a.colorString = "rgba(95,95,95,0.5)";
this.f.v3 = a;
this.f.jm = 3;
this.f.jn = 1;
this.f.jo = 4;
this.f.hc = false;
};
StepLineSeriesView.$t = markType(StepLineSeriesView, 'StepLineSeriesView', AnchoredCategorySeriesView.$);
return StepLineSeriesView;
}(AnchoredCategorySeriesView));
export { StepLineSeriesView };