igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
186 lines (185 loc) • 6.48 kB
JavaScript
import { __extends } from "tslib";
import { IgrSeries } from "./igr-series";
import { TrendLineType_$type } from "igniteui-react-core";
import { IgrAnnotationLayer } from "./igr-annotation-layer";
import { TrendLineLayer } from "./TrendLineLayer";
import { ensureEnum } from "igniteui-react-core";
/**
* Represents the class of the value overlay. The value overlay is a line or circle representing a value on an axis.
*/
var IgrTrendLineLayer = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgrTrendLineLayer, _super);
function IgrTrendLineLayer(props) {
var _this = _super.call(this, props) || this;
_this._targetSeriesName = null;
return _this;
}
IgrTrendLineLayer.prototype.createImplementation = function () {
return new TrendLineLayer();
};
Object.defineProperty(IgrTrendLineLayer.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTrendLineLayer.prototype, "isAnnotationLayer", {
get: function () {
return this.i.eu;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTrendLineLayer.prototype, "isLineOnly", {
get: function () {
return this.i.fl;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTrendLineLayer.prototype, "targetSeries", {
/**
* Gets or sets the series to target this annotation to.
*/
get: function () {
var r = this.i.aah;
if (r == null) {
return null;
}
if (!r.externalObject) {
var e = IgrSeries._createFromInternal(r);
if (e) {
e._implementation = r;
}
r.externalObject = e;
}
return r.externalObject;
},
set: function (v) {
if (v != null && this._stylingContainer && v._styling)
v._styling(this._stylingContainer, this, this);
v == null ? this.i.aah = null : this.i.aah = v.i;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTrendLineLayer.prototype, "targetSeriesName", {
/**
* Gets or sets the name to use to resolve targetSeries from markup.
*/
get: function () {
return this._targetSeriesName;
},
set: function (v) {
this._targetSeriesName = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTrendLineLayer.prototype, "actualTargetSeries", {
/**
* Gets the actual series being targeted by this annotation.
*/
get: function () {
var r = this.i.aag;
if (r == null) {
return null;
}
if (!r.externalObject) {
var e = IgrSeries._createFromInternal(r);
if (e) {
e._implementation = r;
}
r.externalObject = e;
}
return r.externalObject;
},
set: function (v) {
if (v != null && this._stylingContainer && v._styling)
v._styling(this._stylingContainer, this, this);
v == null ? this.i.aag = null : this.i.aag = v.i;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTrendLineLayer.prototype, "trendLineType", {
/**
* Gets or sets the trend type for the current series object.
*/
get: function () {
return this.i.aaj;
},
set: function (v) {
this.i.aaj = ensureEnum(TrendLineType_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTrendLineLayer.prototype, "trendLinePeriod", {
/**
* Gets or sets the trend line period for the target series.
* The typical, and initial, value for trend line period is 7.
*/
get: function () {
return this.i.aak;
},
set: function (v) {
this.i.aak = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrTrendLineLayer.prototype, "isUsableInLegend", {
get: function () {
return this.i.isUsableInLegend;
},
enumerable: false,
configurable: true
});
IgrTrendLineLayer.prototype.bindSeries = function (series) {
_super.prototype.bindSeries.call(this, series);
for (var i = 0; i < series.length; i++) {
if (this.targetSeriesName && this.targetSeriesName.length > 0 &&
series[i].name == this.targetSeriesName) {
this.targetSeries = series[i];
}
}
};
IgrTrendLineLayer.prototype.findByName = function (name) {
var baseResult = _super.prototype.findByName.call(this, name);
if (baseResult) {
return baseResult;
}
if (this.targetSeries && this.targetSeries.name && this.targetSeries.name == name) {
return this.targetSeries;
}
if (this.actualTargetSeries && this.actualTargetSeries.name && this.actualTargetSeries.name == name) {
return this.actualTargetSeries;
}
return null;
};
IgrTrendLineLayer.prototype._styling = function (container, component, parent) {
_super.prototype._styling.call(this, container, component, parent);
this._inStyling = true;
if (this.targetSeries && this.targetSeries._styling) {
this.targetSeries._styling(container, component, this);
}
if (this.actualTargetSeries && this.actualTargetSeries._styling) {
this.actualTargetSeries._styling(container, component, this);
}
this._inStyling = false;
};
IgrTrendLineLayer.prototype.onApplyTemplate = function () {
this.i.ac();
};
IgrTrendLineLayer.prototype.getManagerIdentifier = function () {
var iv = this.i.aam();
return (iv);
};
return IgrTrendLineLayer;
}(IgrAnnotationLayer));
export { IgrTrendLineLayer };