igniteui-angular-charts
Version:
Ignite UI Angular charting components for building rich data visualizations for modern web apps.
120 lines (119 loc) • 5.66 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 { CategoryFramePreparer } from "./CategoryFramePreparer";
import { ISupportsMarkers_$type } from "./ISupportsMarkers";
import { IProvidesViewport_$type } from "./IProvidesViewport";
import { ISupportsErrorBars_$type } from "./ISupportsErrorBars";
import { IBucketizer_$type } from "./IBucketizer";
import { DefaultCategoryTrendlineHost } from "./DefaultCategoryTrendlineHost";
import { IHasCategoryTrendline_$type } from "./IHasCategoryTrendline";
import { DefaultSingleValueProvider } from "./DefaultSingleValueProvider";
import { IHasSingleValueCategory_$type } from "./IHasSingleValueCategory";
import { Rect } from "igniteui-angular-core";
import { typeCast, Point_$type, markType } from "igniteui-angular-core";
import { TrendResolutionParams } from "./TrendResolutionParams";
import { ScalerParams } from "./ScalerParams";
import { SafeSortedReadOnlyDoubleCollection } from "./SafeSortedReadOnlyDoubleCollection";
import { isNaN_, isInfinity } from "igniteui-angular-core";
/**
* @hidden
*/
var BarFramePreparer = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(BarFramePreparer, _super);
function BarFramePreparer(a) {
var _rest = [];
for (var _i = 1; _i < arguments.length; _i++) {
_rest[_i - 1] = arguments[_i];
}
var _this = this;
a = (a == void 0) ? 0 : a;
switch (a) {
case 0:
{
var c = _rest[0];
var d = [c, typeCast(ISupportsMarkers_$type, c), typeCast(IProvidesViewport_$type, c), typeCast(ISupportsErrorBars_$type, c), typeCast(IBucketizer_$type, c)];
{
var f = d[0];
var g = d[1];
var h = d[2];
var i = d[3];
var j = d[4];
_this = _super.call(this, 1, f, g, h, i, j) || this;
_this.ac = new DefaultCategoryTrendlineHost();
if (typeCast(IHasCategoryTrendline_$type, f) !== null) {
_this.ac = typeCast(IHasCategoryTrendline_$type, f);
}
_this.ad = new DefaultSingleValueProvider();
if (typeCast(IHasSingleValueCategory_$type, f) !== null) {
_this.ad = typeCast(IHasSingleValueCategory_$type, f);
}
}
}
break;
case 1:
{
var c = _rest[0];
var d = _rest[1];
var e = _rest[2];
var f = _rest[3];
var g = _rest[4];
_this = _super.call(this, 1, c, d, e, f, g) || this;
_this.ac = new DefaultCategoryTrendlineHost();
if (typeCast(IHasCategoryTrendline_$type, c) !== null) {
_this.ac = typeCast(IHasCategoryTrendline_$type, c);
}
_this.ad = new DefaultSingleValueProvider();
if (typeCast(IHasSingleValueCategory_$type, c) !== null) {
_this.ad = typeCast(IHasSingleValueCategory_$type, c);
}
}
break;
}
return _this;
}
BarFramePreparer.prototype.l = function (a, b, c, d, e, f) {
var g = b[1];
var h = b[0];
var i = new Rect(0, g - 5, h - 5, 11, 11);
if (!isNaN_(g) && !isNaN_(h) && !isInfinity(g) && !isInfinity(h) && c.tryAdd(i)) {
a.n.add({ $type: Point_$type, x: g, y: h });
this.c.updateMarkerTemplate(e, d, f);
return true;
}
return false;
};
BarFramePreparer.prototype.w = function (a, b, c) {
if (this.ac.trendLineType == 0 || this.ac.trendlinePreparer == null || this.ac.trendLinePeriod < 1) {
return;
}
var d = a.n;
var e = new ScalerParams(0, a.p, a.o, a.b.j$b, d);
var f = new ScalerParams(0, a.p, a.o, a.c.j$b, d);
var g = b.f;
if (a.d != null && a.d.i$b != null) {
g = new SafeSortedReadOnlyDoubleCollection(0, g, a.d.i$b);
}
var h = ((function () {
var $ret = new TrendResolutionParams();
$ret.e = a.j;
$ret.f = a.k;
$ret.g = a.l;
$ret.a = c;
$ret.d = a.i;
$ret.i = a.o;
$ret.h = a.n;
return $ret;
})());
if (this.ac.trendLineType != 0) {
this.ac.trendlinePreparer.prepareLineCore(a.a.q, this.ac.trendLineType, g, this.ac.trendLinePeriod, function (i) { return a.c.j$c(i, f); }, function (i) { return a.b.j$c(i, e); }, h);
}
};
BarFramePreparer.$t = markType(BarFramePreparer, 'BarFramePreparer', CategoryFramePreparer.$);
return BarFramePreparer;
}(CategoryFramePreparer));
export { BarFramePreparer };