UNPKG

igniteui-angular-charts

Version:

Ignite UI Angular charting components for building rich data visualizations for modern web apps.

563 lines (562 loc) 21.6 kB
import { __extends } from "tslib"; import { Component, Input } from '@angular/core'; import { DataAnnotationDisplayMode_$type } from "./DataAnnotationDisplayMode"; import { AnnotationAppearanceMode_$type } from "./AnnotationAppearanceMode"; import { IgxAxisComponent } from "./igx-axis-component"; import { DataAnnotationTargetMode_$type } from "./DataAnnotationTargetMode"; import { IgxAnnotationLayerComponent } from "./igx-annotation-layer-component"; import { ensureBool, ensureEnum, brushToString, stringToBrush } from "igniteui-angular-core"; import { Thickness } from "igniteui-angular-core"; import * as i0 from "@angular/core"; /** * Represents a base annotation layer that displays annotations over an axis. */ var IgxDataAnnotationAxisLayerComponent = /** @class */ /*@__PURE__*/ (function (_super) { __extends(IgxDataAnnotationAxisLayerComponent, _super); function IgxDataAnnotationAxisLayerComponent() { return _super.call(this) || this; } Object.defineProperty(IgxDataAnnotationAxisLayerComponent.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationAxisLayerComponent.prototype, "isAnnotationDataLayer", { /** * Gets whether the series is a data annotation layer that support binding to data source */ get: function () { return this.i.es; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationAxisLayerComponent.prototype, "annotationLabelDisplayMode", { /** * Gets or sets display mode of label on axis annotation. */ get: function () { return this.i.aaw; }, set: function (v) { this.i.aaw = ensureEnum(DataAnnotationDisplayMode_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationAxisLayerComponent.prototype, "annotationLabelVisible", { /** * Gets or sets whether to show all annotations over target axis */ get: function () { return this.i.aa2; }, set: function (v) { this.i.aa2 = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationAxisLayerComponent.prototype, "annotationTextColor", { /** * Gets or sets the text color used in the axis annotation. */ get: function () { return brushToString(this.i.ac8); }, set: function (v) { this.i.ac8 = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationAxisLayerComponent.prototype, "annotationTextColorMode", { /** * Gets or sets the mode used for shifting the text color in axis annotation. */ get: function () { return this.i.aau; }, set: function (v) { this.i.aau = ensureEnum(AnnotationAppearanceMode_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationAxisLayerComponent.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.abd; }, set: function (v) { this.i.abd = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationAxisLayerComponent.prototype, "annotationTextColorMatchLayer", { /** * Gets or sets whether the annotation text color matches brush of the layer */ get: function () { return this.i.aa3; }, set: function (v) { this.i.aa3 = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationAxisLayerComponent.prototype, "annotationBackground", { /** * Gets or sets the color used for backing of the axis annotation. */ get: function () { return brushToString(this.i.ac4); }, set: function (v) { this.i.ac4 = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationAxisLayerComponent.prototype, "annotationBorderRadius", { /** * Gets or sets the border radius used for displaying the axis annotation. */ get: function () { return this.i.aba; }, set: function (v) { this.i.aba = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationAxisLayerComponent.prototype, "annotationBackgroundMode", { /** * Gets or sets the mode used for shifting the background of axis annotation. */ get: function () { return this.i.aas; }, set: function (v) { this.i.aas = ensureEnum(AnnotationAppearanceMode_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationAxisLayerComponent.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.aa5; }, set: function (v) { this.i.aa5 = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationAxisLayerComponent.prototype, "annotationBackgroundMatchLayer", { /** * Gets or sets whether the annotation background matches brush of the layer */ get: function () { return this.i.aaz; }, set: function (v) { this.i.aaz = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationAxisLayerComponent.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.aa1; }, set: function (v) { this.i.aa1 = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationAxisLayerComponent.prototype, "annotationBorderColor", { /** * Gets or sets the color used for border color of the axis annotation. */ get: function () { return brushToString(this.i.ac7); }, set: function (v) { this.i.ac7 = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationAxisLayerComponent.prototype, "annotationBorderMode", { /** * Gets or sets the mode used for shifting border color of the axis annotation. */ get: function () { return this.i.aat; }, set: function (v) { this.i.aat = ensureEnum(AnnotationAppearanceMode_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationAxisLayerComponent.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.abb; }, set: function (v) { this.i.abb = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationAxisLayerComponent.prototype, "annotationPaddingBottom", { get: function () { return this.i.ac9 ? this.i.ac9.bottom : NaN; }, set: function (v) { this.ensureAnnotationPadding(); this.i.ac9.bottom = +v; this.i.ac9 = this.i.ac9; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationAxisLayerComponent.prototype, "annotationPaddingLeft", { get: function () { return this.i.ac9 ? this.i.ac9.left : NaN; }, set: function (v) { this.ensureAnnotationPadding(); this.i.ac9.left = +v; this.i.ac9 = this.i.ac9; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationAxisLayerComponent.prototype, "annotationPaddingRight", { get: function () { return this.i.ac9 ? this.i.ac9.right : NaN; }, set: function (v) { this.ensureAnnotationPadding(); this.i.ac9.right = +v; this.i.ac9 = this.i.ac9; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationAxisLayerComponent.prototype, "annotationPaddingTop", { get: function () { return this.i.ac9 ? this.i.ac9.top : NaN; }, set: function (v) { this.ensureAnnotationPadding(); this.i.ac9.top = +v; this.i.ac9 = this.i.ac9; }, enumerable: false, configurable: true }); IgxDataAnnotationAxisLayerComponent.prototype.ensureAnnotationPadding = function () { if (this.i.ac9) { return; } this.i.ac9 = new Thickness(2); }; Object.defineProperty(IgxDataAnnotationAxisLayerComponent.prototype, "annotationBorderThickness", { /** * Gets or sets border thickness of the axis annotations. */ get: function () { return this.i.abc; }, set: function (v) { this.i.abc = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationAxisLayerComponent.prototype, "annotationValueMaxPrecision", { /** * Gets or sets maximum precision for displaying values on axis annotation. */ get: function () { return this.i.abe; }, set: function (v) { this.i.abe = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationAxisLayerComponent.prototype, "annotationValueMinPrecision", { /** * Gets or sets minimum precision for displaying values on axis annotation. */ get: function () { return this.i.abf; }, set: function (v) { this.i.abf = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationAxisLayerComponent.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.aav; 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) { if (v != null && this._stylingContainer && v._styling) v._styling(this._stylingContainer, this, this); v == null ? this.i.aav = null : this.i.aav = v.i; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationAxisLayerComponent.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.aax; }, set: function (v) { this.i.aax = ensureEnum(DataAnnotationTargetMode_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationAxisLayerComponent.prototype, "annotationBadgeEnabled", { /** * Gets or sets whether the badge are rendered in annotations. */ get: function () { return this.i.aa0; }, set: function (v) { this.i.aa0 = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationAxisLayerComponent.prototype, "annotationBadgeBackground", { /** * Gets or sets background of the badge annotations. */ get: function () { return brushToString(this.i.ac5); }, set: function (v) { this.i.ac5 = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationAxisLayerComponent.prototype, "annotationBadgeOutline", { /** * Gets or sets border outline of the badge annotations. */ get: function () { return brushToString(this.i.ac6); }, set: function (v) { this.i.ac6 = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationAxisLayerComponent.prototype, "annotationBadgeOutlineThickness", { /** * Gets or sets border thickness of the badge annotations. */ get: function () { return this.i.aa8; }, set: function (v) { this.i.aa8 = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationAxisLayerComponent.prototype, "annotationBadgeCornerRadius", { /** * Gets or sets border radius of the badge annotations. */ get: function () { return this.i.aa6; }, set: function (v) { this.i.aa6 = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationAxisLayerComponent.prototype, "annotationBadgeImagePath", { /** * Gets or sets a member path for displaying an image in the badge annotations. */ get: function () { return this.i.abn; }, set: function (v) { this.i.abn = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationAxisLayerComponent.prototype, "annotationBadgeSize", { /** * Gets or sets size of the badge annotations. */ get: function () { return this.i.aa9; }, set: function (v) { this.i.aa9 = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationAxisLayerComponent.prototype, "annotationBadgeMargin", { /** * Gets or sets margin of the badge annotations. */ get: function () { return this.i.aa7; }, set: function (v) { this.i.aa7 = +v; }, enumerable: false, configurable: true }); IgxDataAnnotationAxisLayerComponent.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; }; IgxDataAnnotationAxisLayerComponent.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; }; IgxDataAnnotationAxisLayerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxDataAnnotationAxisLayerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); IgxDataAnnotationAxisLayerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: IgxDataAnnotationAxisLayerComponent, selector: "ng-component", inputs: { annotationLabelDisplayMode: "annotationLabelDisplayMode", annotationLabelVisible: "annotationLabelVisible", annotationTextColor: "annotationTextColor", annotationTextColorMode: "annotationTextColorMode", annotationTextColorShift: "annotationTextColorShift", annotationTextColorMatchLayer: "annotationTextColorMatchLayer", annotationBackground: "annotationBackground", annotationBorderRadius: "annotationBorderRadius", annotationBackgroundMode: "annotationBackgroundMode", annotationBackgroundShift: "annotationBackgroundShift", annotationBackgroundMatchLayer: "annotationBackgroundMatchLayer", annotationBorderMatchLayer: "annotationBorderMatchLayer", annotationBorderColor: "annotationBorderColor", annotationBorderMode: "annotationBorderMode", annotationBorderShift: "annotationBorderShift", annotationPaddingBottom: "annotationPaddingBottom", annotationPaddingLeft: "annotationPaddingLeft", annotationPaddingRight: "annotationPaddingRight", annotationPaddingTop: "annotationPaddingTop", annotationBorderThickness: "annotationBorderThickness", annotationValueMaxPrecision: "annotationValueMaxPrecision", annotationValueMinPrecision: "annotationValueMinPrecision", targetAxis: "targetAxis", targetMode: "targetMode", annotationBadgeEnabled: "annotationBadgeEnabled", annotationBadgeBackground: "annotationBadgeBackground", annotationBadgeOutline: "annotationBadgeOutline", annotationBadgeOutlineThickness: "annotationBadgeOutlineThickness", annotationBadgeCornerRadius: "annotationBadgeCornerRadius", annotationBadgeImagePath: "annotationBadgeImagePath", annotationBadgeSize: "annotationBadgeSize", annotationBadgeMargin: "annotationBadgeMargin" }, usesInheritance: true, ngImport: i0, template: "", isInline: true }); return IgxDataAnnotationAxisLayerComponent; }(IgxAnnotationLayerComponent)); export { IgxDataAnnotationAxisLayerComponent }; i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxDataAnnotationAxisLayerComponent, decorators: [{ type: Component, args: [{ template: "", }] }], ctorParameters: function () { return []; }, propDecorators: { annotationLabelDisplayMode: [{ type: Input }], annotationLabelVisible: [{ type: Input }], annotationTextColor: [{ type: Input }], annotationTextColorMode: [{ type: Input }], annotationTextColorShift: [{ type: Input }], annotationTextColorMatchLayer: [{ type: Input }], annotationBackground: [{ type: Input }], annotationBorderRadius: [{ type: Input }], annotationBackgroundMode: [{ type: Input }], annotationBackgroundShift: [{ type: Input }], annotationBackgroundMatchLayer: [{ type: Input }], annotationBorderMatchLayer: [{ type: Input }], annotationBorderColor: [{ type: Input }], annotationBorderMode: [{ type: Input }], annotationBorderShift: [{ type: Input }], annotationPaddingBottom: [{ type: Input }], annotationPaddingLeft: [{ type: Input }], annotationPaddingRight: [{ type: Input }], annotationPaddingTop: [{ type: Input }], annotationBorderThickness: [{ type: Input }], annotationValueMaxPrecision: [{ type: Input }], annotationValueMinPrecision: [{ type: Input }], targetAxis: [{ type: Input }], targetMode: [{ type: Input }], annotationBadgeEnabled: [{ type: Input }], annotationBadgeBackground: [{ type: Input }], annotationBadgeOutline: [{ type: Input }], annotationBadgeOutlineThickness: [{ type: Input }], annotationBadgeCornerRadius: [{ type: Input }], annotationBadgeImagePath: [{ type: Input }], annotationBadgeSize: [{ type: Input }], annotationBadgeMargin: [{ type: Input }] } });