igniteui-angular-charts
Version:
Ignite UI Angular charting components for building rich data visualizations for modern web apps.
109 lines (108 loc) • 3.88 kB
JavaScript
import { __extends } from "tslib";
import { IgxAxisComponent } from "./igx-axis-component";
import { IgxAxisMatcher } from "./igx-axis-matcher";
import { IgxUserBaseAnnotation } from "./igx-user-base-annotation";
import { UserAxisAnnotation as UserAxisAnnotation_internal } from "./UserAxisAnnotation";
/**
* Represents an user annotation for rendering annotation of axis label
*/
var IgxUserAxisAnnotation = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgxUserAxisAnnotation, _super);
function IgxUserAxisAnnotation() {
return _super.call(this) || this;
}
IgxUserAxisAnnotation.prototype.createImplementation = function () {
return new UserAxisAnnotation_internal();
};
Object.defineProperty(IgxUserAxisAnnotation.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxUserAxisAnnotation.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 = IgxAxisComponent._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(IgxUserAxisAnnotation.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 IgxAxisMatcher();
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(IgxUserAxisAnnotation.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
});
IgxUserAxisAnnotation.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 IgxUserAxisAnnotation;
}(IgxUserBaseAnnotation));
export { IgxUserAxisAnnotation };