igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
146 lines (145 loc) • 5.11 kB
JavaScript
import { __extends } from "tslib";
import { IgrSeries } from "./igr-series";
import { IgrSeriesMatcher } from "./igr-series-matcher";
import { IgrUserBaseAnnotation } from "./igr-user-base-annotation";
import { UserPointAnnotation as UserPointAnnotation_internal } from "./UserPointAnnotation";
/**
* Represents an user annotation for rendering data point annotation on a series
*/
var IgrUserPointAnnotation = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgrUserPointAnnotation, _super);
function IgrUserPointAnnotation() {
var _this = _super.call(this) || this;
_this._targetSeriesName = null;
return _this;
}
IgrUserPointAnnotation.prototype.createImplementation = function () {
return new UserPointAnnotation_internal();
};
Object.defineProperty(IgrUserPointAnnotation.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrUserPointAnnotation.prototype, "targetSeries", {
/**
* Gets or sets the target series that will display the annotation.
*/
get: function () {
var r = this.i.targetSeries;
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) {
v == null ? this.i.targetSeries = null : this.i.targetSeries = v.i;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrUserPointAnnotation.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(IgrUserPointAnnotation.prototype, "targetSeriesMatcher", {
/**
* Gets or sets a matcher for matching a series that will display the annotation.
*/
get: function () {
var r = this.i.targetSeriesMatcher;
if (r == null) {
return null;
}
if (!r.externalObject) {
var e = new IgrSeriesMatcher();
if (r.$type) {
e._implementation = r;
}
else {
if (e.i.setNativeElement) {
e.i.setNativeElement(r);
}
}
r.externalObject = e;
}
return r.externalObject;
},
set: function (v) {
v == null ? this.i.targetSeriesMatcher = null : this.i.targetSeriesMatcher = v.i;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrUserPointAnnotation.prototype, "xValue", {
/**
* Gets or sets the value that determines location of the annotation in the coordinates of x-axis.
*/
get: function () {
return this.i.xValue;
},
set: function (v) {
this.i.xValue = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrUserPointAnnotation.prototype, "yValue", {
/**
* Gets or sets the value that determines location of the annotation in the coordinates of y-axis.
*/
get: function () {
return this.i.yValue;
},
set: function (v) {
this.i.yValue = +v;
},
enumerable: false,
configurable: true
});
IgrUserPointAnnotation.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];
}
}
};
IgrUserPointAnnotation.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.targetSeriesMatcher && this.targetSeriesMatcher.name && this.targetSeriesMatcher.name == name) {
return this.targetSeriesMatcher;
}
return null;
};
return IgrUserPointAnnotation;
}(IgrUserBaseAnnotation));
export { IgrUserPointAnnotation };