igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
375 lines (374 loc) • 12.9 kB
JavaScript
import { __extends } from "tslib";
import { DataAnnotationDisplayMode_$type } from "./DataAnnotationDisplayMode";
import { AnnotationAppearanceMode_$type } from "./AnnotationAppearanceMode";
import { IgrAxis } from "./igr-axis";
import { DataAnnotationTargetMode_$type } from "./DataAnnotationTargetMode";
import { IgrAnnotationLayer } from "./igr-annotation-layer";
import { ensureEnum, ensureBool, brushToString, stringToBrush } from "igniteui-react-core";
import { Thickness } from "igniteui-react-core";
/**
* Represents a base annotation layer that displays annotations over an axis.
*/
var IgrDataAnnotationAxisLayer = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgrDataAnnotationAxisLayer, _super);
function IgrDataAnnotationAxisLayer(props) {
return _super.call(this, props) || this;
}
Object.defineProperty(IgrDataAnnotationAxisLayer.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDataAnnotationAxisLayer.prototype, "annotationLabelDisplayMode", {
/**
* Gets or sets display mode of label on axis annotation.
*/
get: function () {
return this.i.aae;
},
set: function (v) {
this.i.aae = ensureEnum(DataAnnotationDisplayMode_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDataAnnotationAxisLayer.prototype, "annotationLabelVisible", {
/**
* Gets or sets whether to show all annotations over target axis
*/
get: function () {
return this.i.aaj;
},
set: function (v) {
this.i.aaj = ensureBool(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDataAnnotationAxisLayer.prototype, "annotationTextColor", {
/**
* Gets or sets the text color used in the axis annotation.
*/
get: function () {
return brushToString(this.i.ab2);
},
set: function (v) {
this.i.ab2 = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDataAnnotationAxisLayer.prototype, "annotationTextColorMode", {
/**
* Gets or sets the mode used for shifting the text color in axis annotation.
*/
get: function () {
return this.i.aac;
},
set: function (v) {
this.i.aac = ensureEnum(AnnotationAppearanceMode_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDataAnnotationAxisLayer.prototype, "annotationTextColorShift", {
/**
* Gets or sets the percentage used to shift AnnotationTextColor. Value must range between -1.0 to 1.0, where 0 means no color shift.
*/
get: function () {
return this.i.aaq;
},
set: function (v) {
this.i.aaq = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDataAnnotationAxisLayer.prototype, "annotationTextColorMatchLayer", {
/**
* Gets or sets whether the annotation text color matches brush of the layer
*/
get: function () {
return this.i.aak;
},
set: function (v) {
this.i.aak = ensureBool(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDataAnnotationAxisLayer.prototype, "annotationBackground", {
/**
* Gets or sets the color used for backing of the axis annotation.
*/
get: function () {
return brushToString(this.i.ab0);
},
set: function (v) {
this.i.ab0 = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDataAnnotationAxisLayer.prototype, "annotationBorderRadius", {
/**
* Gets or sets the border radius used for displaying the axis annotation.
*/
get: function () {
return this.i.aan;
},
set: function (v) {
this.i.aan = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDataAnnotationAxisLayer.prototype, "annotationBackgroundMode", {
/**
* Gets or sets the mode used for shifting the background of axis annotation.
*/
get: function () {
return this.i.aaa;
},
set: function (v) {
this.i.aaa = ensureEnum(AnnotationAppearanceMode_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDataAnnotationAxisLayer.prototype, "annotationBackgroundShift", {
/**
* Gets or sets the percentage used to shift AnnotationBackground. Value must range between -1.0 to 1.0, where 0 means no color shift.
*/
get: function () {
return this.i.aam;
},
set: function (v) {
this.i.aam = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDataAnnotationAxisLayer.prototype, "annotationBackgroundMatchLayer", {
/**
* Gets or sets whether the annotation background matches brush of the layer
*/
get: function () {
return this.i.aah;
},
set: function (v) {
this.i.aah = ensureBool(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDataAnnotationAxisLayer.prototype, "annotationBorderMatchLayer", {
/**
* Gets or sets whether the annotation border matches outline of the layer (if it has a fill visual) otherwise brush of the layer
*/
get: function () {
return this.i.aai;
},
set: function (v) {
this.i.aai = ensureBool(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDataAnnotationAxisLayer.prototype, "annotationBorderColor", {
/**
* Gets or sets the color used for border color of the axis annotation.
*/
get: function () {
return brushToString(this.i.ab1);
},
set: function (v) {
this.i.ab1 = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDataAnnotationAxisLayer.prototype, "annotationBorderMode", {
/**
* Gets or sets the mode used for shifting border color of the axis annotation.
*/
get: function () {
return this.i.aab;
},
set: function (v) {
this.i.aab = ensureEnum(AnnotationAppearanceMode_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDataAnnotationAxisLayer.prototype, "annotationBorderShift", {
/**
* Gets or sets the percentage amount used to shift AnnotationBorderColor. Value must range between -1.0 to 1.0, where 0 means no color shift.
*/
get: function () {
return this.i.aao;
},
set: function (v) {
this.i.aao = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDataAnnotationAxisLayer.prototype, "annotationPaddingBottom", {
get: function () {
return this.i.ab3 ? this.i.ab3.bottom : NaN;
},
set: function (v) {
this.ensureAnnotationPadding();
this.i.ab3.bottom = +v;
this.i.ab3 = this.i.ab3;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDataAnnotationAxisLayer.prototype, "annotationPaddingLeft", {
get: function () {
return this.i.ab3 ? this.i.ab3.left : NaN;
},
set: function (v) {
this.ensureAnnotationPadding();
this.i.ab3.left = +v;
this.i.ab3 = this.i.ab3;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDataAnnotationAxisLayer.prototype, "annotationPaddingRight", {
get: function () {
return this.i.ab3 ? this.i.ab3.right : NaN;
},
set: function (v) {
this.ensureAnnotationPadding();
this.i.ab3.right = +v;
this.i.ab3 = this.i.ab3;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDataAnnotationAxisLayer.prototype, "annotationPaddingTop", {
get: function () {
return this.i.ab3 ? this.i.ab3.top : NaN;
},
set: function (v) {
this.ensureAnnotationPadding();
this.i.ab3.top = +v;
this.i.ab3 = this.i.ab3;
},
enumerable: false,
configurable: true
});
IgrDataAnnotationAxisLayer.prototype.ensureAnnotationPadding = function () {
if (this.i.ab3) {
return;
}
this.i.ab3 = new Thickness(2);
};
Object.defineProperty(IgrDataAnnotationAxisLayer.prototype, "annotationBorderThickness", {
/**
* Gets or sets border thickness of the axis annotations.
*/
get: function () {
return this.i.aap;
},
set: function (v) {
this.i.aap = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDataAnnotationAxisLayer.prototype, "annotationValueMaxPrecision", {
/**
* Gets or sets maximum precision for displaying values on axis annotation.
*/
get: function () {
return this.i.aar;
},
set: function (v) {
this.i.aar = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDataAnnotationAxisLayer.prototype, "annotationValueMinPrecision", {
/**
* Gets or sets minimum precision for displaying values on axis annotation.
*/
get: function () {
return this.i.aas;
},
set: function (v) {
this.i.aas = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDataAnnotationAxisLayer.prototype, "targetAxis", {
/**
* Gets or sets the target axis for this annotation. If null, this annotation will use TargetMode to determine target axis.
*/
get: function () {
var r = this.i.aad;
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) {
if (v != null && this._stylingContainer && v._styling)
v._styling(this._stylingContainer, this, this);
v == null ? this.i.aad = null : this.i.aad = v.i;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrDataAnnotationAxisLayer.prototype, "targetMode", {
/**
* Gets or sets the mode for targeting axes present in the chart. Defaults to targeting all category-axes present in the chart
*/
get: function () {
return this.i.aaf;
},
set: function (v) {
this.i.aaf = ensureEnum(DataAnnotationTargetMode_$type, v);
},
enumerable: false,
configurable: true
});
IgrDataAnnotationAxisLayer.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;
}
return null;
};
IgrDataAnnotationAxisLayer.prototype._styling = function (container, component, parent) {
_super.prototype._styling.call(this, container, component, parent);
this._inStyling = true;
if (this.targetAxis && this.targetAxis._styling) {
this.targetAxis._styling(container, component, this);
}
this._inStyling = false;
};
return IgrDataAnnotationAxisLayer;
}(IgrAnnotationLayer));
export { IgrDataAnnotationAxisLayer };