igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
300 lines (299 loc) • 10.3 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";
/**
* @hidden
*/
var StepAreaSeries = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(StepAreaSeries, _super);
function StepAreaSeries() {
var _this = _super.call(this) || this;
_this.ac9 = null;
_this.ac9 = new CategoryLineRasterizer();
_this.ab = StepAreaSeries.$;
return _this;
}
StepAreaSeries.prototype.bk = function () {
return new StepAreaSeries();
};
StepAreaSeries.prototype.ct = function () {
return new StepAreaSeriesView(this);
};
StepAreaSeries.prototype.q8 = function (a) {
_super.prototype.q8.call(this, a);
this.ada = a;
};
StepAreaSeries.prototype.get_ex = function () {
return true;
};
StepAreaSeries.prototype.get_ew = function () {
return true;
};
StepAreaSeries.prototype.get_f2 = function () {
return true;
};
StepAreaSeries.prototype.get_fm = function () {
return true;
};
StepAreaSeries.prototype.cz = function () {
if (this.c0 == 0) {
return 2;
}
return _super.prototype.cz.call(this);
};
StepAreaSeries.prototype.preferredCategoryMode = function (a) {
return typeCast(ISortingAxis_$type, a) !== null ? 0 : 1;
};
StepAreaSeries.prototype.pb = function (a, b) {
_super.prototype.pb.call(this, a, b);
var c = b;
c.du();
};
StepAreaSeries.prototype.adb = function (a, b, c, d, e) {
if (b) {
if (e) {
if ((a & 1) == 0 || ((intDivide(a, 2)) + 1) >= c.h.count) {
return c.h._inner[(intDivide(a, 2))][0];
}
return c.h._inner[(intDivide(a, 2)) + 1][0];
}
return c.h._inner[(intDivide(a, 2))][0] + ((a & 1) == 1 ? -d : d);
}
if (e) {
if ((a & 1) == 0 || ((intDivide(a, 2)) + 1) >= c.h.count) {
return c.h._inner[(intDivide(a, 2))][0];
}
return c.h._inner[(intDivide(a, 2)) + 1][0];
}
return c.h._inner[(intDivide(a, 2))][0] + ((a & 1) == 0 ? -d : d);
};
StepAreaSeries.prototype.zf = function () {
return 1;
};
StepAreaSeries.prototype.ix = 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;
};
StepAreaSeries.prototype.b3 = function () {
if (this.b4 == 0) {
return 2;
}
else {
return _super.prototype.b3.call(this);
}
};
StepAreaSeries.prototype.aay = function (a, b) {
var _this = this;
_super.prototype.aay.call(this, a, b);
var c = b.ca;
var d = b.b9;
var e = this.getEffectiveViewport1(b);
var f = typeCast(ISortingAxis_$type, this.acq) != null;
var g = this.acq != null ? 0.5 * this.acq.getCategorySize(c, d, e) : 0;
if (this.acq != null && this.acq.df) {
g = -g;
}
var h = a.h.count * 2;
var i = new List$1(Array_$type, 2, h);
this.zd.a2(this, this.zx(), runOn(this, this.yx), this.z6(b), this.z7(b));
var j = false;
var k = this.zd.b;
if (k != null) {
j = true;
}
for (var l = 0; l < h; l++) {
var m = new Array(4);
m[0] = this.adb(l, false, a, g, f);
m[1] = a.h._inner[(intDivide(l, 2))][1];
m[2] = this.adb(l, true, a, g, f);
m[3] = a.h._inner[(intDivide(l, 2))][2];
i.add(m);
}
var n = this.ze.c9.d;
if (j) {
var o = new ScalerParams(0, b.ca, b.b9, this.acq.df, e);
this.aau(i, -1, this.valueColumn.count, this.acq, o, b.t, -1);
}
var p = typeCast(StepAreaSeriesView.$, b);
var q = p.d7;
var r = p.d8;
var s = p.d5;
var t = p.d6;
this.zd.ad(q, true, false, true, true);
this.zd.ad(r, true, false, true, true);
this.zd.ad(s, false, true, false, false);
this.zd.ad(t, false, true, false, false);
if (b.dd(a)) {
p.dw(h, i, false, n, this.ie, function (u, v, w, x, y) { return _this.ab6(u, 2 * a.h.count, b); }, 1, this.aa7(i, i.count - 1, b.b9, b.ca, true));
b.dg(a);
}
var u = this.fetchYAxis();
p.d5._opacity = this.zd.j * this.ia;
p.d6._opacity = 0.5 * this.zd.j * this.ia;
};
StepAreaSeries.prototype.qa = function (a, b, c) {
this.aaq(a, b, c, this.y4, 1);
};
StepAreaSeries.prototype.ak = function (a, b) {
var c = new List$1(ChartSelection.$, 0);
this.qa(a, c, b);
return c.toArray();
};
Object.defineProperty(StepAreaSeries.prototype, "useHighMarkerFidelity", {
get: function () {
return this.z1;
},
enumerable: false,
configurable: true
});
StepAreaSeries.$t = markType(StepAreaSeries, 'StepAreaSeries', HorizontalAnchoredCategorySeries.$);
return StepAreaSeries;
}(HorizontalAnchoredCategorySeries));
export { StepAreaSeries };
/**
* @hidden
*/
var StepAreaSeriesView = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(StepAreaSeriesView, _super);
function StepAreaSeriesView(a) {
var _this = _super.call(this, a) || this;
_this.dt = null;
_this.d1 = new Path();
_this.d3 = new Path();
_this.d2 = new Path();
_this.d4 = new Path();
_this.dx = new Path();
_this.dz = new Path();
_this.dy = new Path();
_this.d0 = new Path();
_this.dt = a;
return _this;
}
StepAreaSeriesView.prototype.a4 = function () {
_super.prototype.a4.call(this);
if (!this.t) {
this.dt.xl = Defaults.c;
}
};
Object.defineProperty(StepAreaSeriesView.prototype, "d5", {
get: function () {
return this.d1;
},
enumerable: false,
configurable: true
});
Object.defineProperty(StepAreaSeriesView.prototype, "d7", {
get: function () {
return this.d3;
},
enumerable: false,
configurable: true
});
Object.defineProperty(StepAreaSeriesView.prototype, "d6", {
get: function () {
return this.d2;
},
enumerable: false,
configurable: true
});
Object.defineProperty(StepAreaSeriesView.prototype, "d8", {
get: function () {
return this.d4;
},
enumerable: false,
configurable: true
});
StepAreaSeriesView.prototype.du = function () {
this.d1.an = null;
this.d2.an = null;
this.d3.an = null;
this.d4.an = null;
this.a2();
};
StepAreaSeriesView.prototype.dv = function (a, b, c, d, e, f, g) {
this.dv(a, b, c, d, e, f, g);
};
StepAreaSeriesView.prototype.dw = function (a, b, c, d, e, f, g, h) {
this.dt.ac9.a = typeCast(ISortingAxis_$type, this.db.fetchXAxis()) !== null ? true : false;
this.dt.ac9.j(this.d1, this.d3, this.d2, this.d4, a, b, c, d, e, f, g, h);
this.a2();
};
StepAreaSeriesView.prototype.bq = function () {
_super.prototype.bq.call(this);
this.dx.an = this.d1.an;
this.dz.an = this.d3.an;
this.dy.an = this.d2.an;
this.d0.an = this.d4.an;
var a = this.b3();
this.dx._fill = a;
this.dx._opacity = 1;
this.dy._fill = a;
this.dy._opacity = 1;
this.dz._stroke = a;
this.dz.ad = this.f.ig + 3;
this.d0._stroke = a;
this.d0.ad = this.f.ig + 3;
};
StepAreaSeriesView.prototype.bj = function (a, b) {
_super.prototype.bj.call(this, a, b);
if (b) {
a.t(this.dx);
a.t(this.dy);
a.t(this.dz);
a.t(this.d0);
}
else {
a.t(this.d1);
a.t(this.d2);
a.t(this.d3);
a.t(this.d4);
}
};
StepAreaSeriesView.prototype.ax = function (a) {
_super.prototype.ax.call(this, a);
this.f.bc.exportPathData(a, this.d3, "lowerShape", ["Lower"]);
this.f.bc.exportPathData(a, this.d4, "upperShape", ["Upper", "Main"]);
this.f.bc.exportPathData(a, this.d2, "translucentShape", ["Translucent"]);
this.f.bc.exportPathData(a, this.d1, "fillShape", ["Fill"]);
};
StepAreaSeriesView.$t = markType(StepAreaSeriesView, 'StepAreaSeriesView', AnchoredCategorySeriesView.$);
return StepAreaSeriesView;
}(AnchoredCategorySeriesView));
export { StepAreaSeriesView };