UNPKG

igniteui-react-charts

Version:

Ignite UI React charting components for building rich data visualizations using TypeScript APIs.

133 lines (132 loc) 4.57 kB
import { __extends } from "tslib"; import { IgrAxis } from "./igr-axis"; import { IgrAxisMatcher } from "./igr-axis-matcher"; import { IgrUserBaseAnnotation } from "./igr-user-base-annotation"; import { UserAxisAnnotation as UserAxisAnnotation_internal } from "./UserAxisAnnotation"; /** * Represents an user annotation for rendering annotation of axis label */ var IgrUserAxisAnnotation = /** @class */ /*@__PURE__*/ (function (_super) { __extends(IgrUserAxisAnnotation, _super); function IgrUserAxisAnnotation() { var _this = _super.call(this) || this; _this._targetAxisName = null; return _this; } IgrUserAxisAnnotation.prototype.createImplementation = function () { return new UserAxisAnnotation_internal(); }; Object.defineProperty(IgrUserAxisAnnotation.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; }, enumerable: false, configurable: true }); Object.defineProperty(IgrUserAxisAnnotation.prototype, "targetAxis", { /** * Gets or sets the target axis that will display the annotation. */ get: function () { var r = this.i.targetAxis; if (r == null) { return null; } if (!r.externalObject) { var e = IgrAxis._createFromInternal(r); if (e) { e._implementation = r; } r.externalObject = e; } return r.externalObject; }, set: function (v) { v == null ? this.i.targetAxis = null : this.i.targetAxis = v.i; }, enumerable: false, configurable: true }); Object.defineProperty(IgrUserAxisAnnotation.prototype, "targetAxisName", { /** * Gets or sets the name to use to resolve targetAxis from markup. */ get: function () { return this._targetAxisName; }, set: function (v) { this._targetAxisName = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrUserAxisAnnotation.prototype, "targetAxisMatcher", { /** * Gets or sets a matcher for matching an axis that will display the annotation. */ get: function () { var r = this.i.targetAxisMatcher; if (r == null) { return null; } if (!r.externalObject) { var e = new IgrAxisMatcher(); 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.targetAxisMatcher = null : this.i.targetAxisMatcher = v.i; }, enumerable: false, configurable: true }); Object.defineProperty(IgrUserAxisAnnotation.prototype, "value", { /** * Gets or sets the value that determines location of annotation on axis. */ get: function () { return this.i.value; }, set: function (v) { this.i.value = +v; }, enumerable: false, configurable: true }); IgrUserAxisAnnotation.prototype.bindAxes = function (axes) { _super.prototype.bindAxes.call(this, axes); for (var i = 0; i < axes.length; i++) { if (this.targetAxisName && this.targetAxisName.length > 0 && axes[i].name == this.targetAxisName) { this.targetAxis = axes[i]; } } }; IgrUserAxisAnnotation.prototype.findByName = function (name) { var baseResult = _super.prototype.findByName.call(this, name); if (baseResult) { return baseResult; } if (this.targetAxis && this.targetAxis.name && this.targetAxis.name == name) { return this.targetAxis; } if (this.targetAxisMatcher && this.targetAxisMatcher.name && this.targetAxisMatcher.name == name) { return this.targetAxisMatcher; } return null; }; return IgrUserAxisAnnotation; }(IgrUserBaseAnnotation)); export { IgrUserAxisAnnotation };