UNPKG

igniteui-angular-charts

Version:

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

455 lines (454 loc) 16.2 kB
import { Component, Input } from '@angular/core'; import { DataAnnotationDisplayMode, DataAnnotationDisplayMode_$type } from "./DataAnnotationDisplayMode"; import { AnnotationAppearanceMode, AnnotationAppearanceMode_$type } from "./AnnotationAppearanceMode"; import { IgxAxisComponent } from "./igx-axis-component"; import { DataAnnotationTargetMode, 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. */ export class IgxDataAnnotationAxisLayerComponent extends IgxAnnotationLayerComponent { /** * @hidden */ get i() { return this._implementation; } constructor() { super(); } /** * Gets whether the series is a data annotation layer that support binding to data source */ get isAnnotationDataLayer() { return this.i.es; } /** * Gets or sets display mode of label on axis annotation. */ get annotationLabelDisplayMode() { return this.i.aay; } set annotationLabelDisplayMode(v) { this.i.aay = ensureEnum(DataAnnotationDisplayMode_$type, v); } /** * Gets or sets whether to show all annotations over target axis */ get annotationLabelVisible() { return this.i.aa4; } set annotationLabelVisible(v) { this.i.aa4 = ensureBool(v); } /** * Gets or sets the text color used in the axis annotation. */ get annotationTextColor() { return brushToString(this.i.ada); } set annotationTextColor(v) { this.i.ada = stringToBrush(v); } /** * Gets or sets the mode used for shifting the text color in axis annotation. */ get annotationTextColorMode() { return this.i.aaw; } set annotationTextColorMode(v) { this.i.aaw = ensureEnum(AnnotationAppearanceMode_$type, v); } /** * 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 annotationTextColorShift() { return this.i.abf; } set annotationTextColorShift(v) { this.i.abf = +v; } /** * Gets or sets whether the annotation text color matches brush of the layer */ get annotationTextColorMatchLayer() { return this.i.aa5; } set annotationTextColorMatchLayer(v) { this.i.aa5 = ensureBool(v); } /** * Gets or sets the color used for backing of the axis annotation. */ get annotationBackground() { return brushToString(this.i.ac6); } set annotationBackground(v) { this.i.ac6 = stringToBrush(v); } /** * Gets or sets the border radius used for displaying the axis annotation. */ get annotationBorderRadius() { return this.i.abc; } set annotationBorderRadius(v) { this.i.abc = +v; } /** * Gets or sets the mode used for shifting the background of axis annotation. */ get annotationBackgroundMode() { return this.i.aau; } set annotationBackgroundMode(v) { this.i.aau = ensureEnum(AnnotationAppearanceMode_$type, v); } /** * 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 annotationBackgroundShift() { return this.i.aa7; } set annotationBackgroundShift(v) { this.i.aa7 = +v; } /** * Gets or sets whether the annotation background matches brush of the layer */ get annotationBackgroundMatchLayer() { return this.i.aa1; } set annotationBackgroundMatchLayer(v) { this.i.aa1 = ensureBool(v); } /** * Gets or sets whether the annotation border matches outline of the layer (if it has a fill visual) otherwise brush of the layer */ get annotationBorderMatchLayer() { return this.i.aa3; } set annotationBorderMatchLayer(v) { this.i.aa3 = ensureBool(v); } /** * Gets or sets the color used for border color of the axis annotation. */ get annotationBorderColor() { return brushToString(this.i.ac9); } set annotationBorderColor(v) { this.i.ac9 = stringToBrush(v); } /** * Gets or sets the mode used for shifting border color of the axis annotation. */ get annotationBorderMode() { return this.i.aav; } set annotationBorderMode(v) { this.i.aav = ensureEnum(AnnotationAppearanceMode_$type, v); } /** * 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 annotationBorderShift() { return this.i.abd; } set annotationBorderShift(v) { this.i.abd = +v; } get annotationPaddingBottom() { return this.i.adb ? this.i.adb.bottom : NaN; } set annotationPaddingBottom(v) { this.ensureAnnotationPadding(); const __nv = +v; if (this.i.adb.bottom === __nv) { return; } const __copy = new Thickness(2); __copy.bottom = __nv; __copy.left = this.i.adb.left; __copy.right = this.i.adb.right; __copy.top = this.i.adb.top; this.i.adb = __copy; } get annotationPaddingLeft() { return this.i.adb ? this.i.adb.left : NaN; } set annotationPaddingLeft(v) { this.ensureAnnotationPadding(); const __nv = +v; if (this.i.adb.left === __nv) { return; } const __copy = new Thickness(2); __copy.left = __nv; __copy.bottom = this.i.adb.bottom; __copy.right = this.i.adb.right; __copy.top = this.i.adb.top; this.i.adb = __copy; } get annotationPaddingRight() { return this.i.adb ? this.i.adb.right : NaN; } set annotationPaddingRight(v) { this.ensureAnnotationPadding(); const __nv = +v; if (this.i.adb.right === __nv) { return; } const __copy = new Thickness(2); __copy.right = __nv; __copy.bottom = this.i.adb.bottom; __copy.left = this.i.adb.left; __copy.top = this.i.adb.top; this.i.adb = __copy; } get annotationPaddingTop() { return this.i.adb ? this.i.adb.top : NaN; } set annotationPaddingTop(v) { this.ensureAnnotationPadding(); const __nv = +v; if (this.i.adb.top === __nv) { return; } const __copy = new Thickness(2); __copy.top = __nv; __copy.bottom = this.i.adb.bottom; __copy.left = this.i.adb.left; __copy.right = this.i.adb.right; this.i.adb = __copy; } ensureAnnotationPadding() { if (this.i.adb) { return; } this.i.adb = new Thickness(2); } /** * Gets or sets border thickness of the axis annotations. */ get annotationBorderThickness() { return this.i.abe; } set annotationBorderThickness(v) { this.i.abe = +v; } /** * Gets or sets maximum precision for displaying values on axis annotation. */ get annotationValueMaxPrecision() { return this.i.abg; } set annotationValueMaxPrecision(v) { this.i.abg = +v; } /** * Gets or sets minimum precision for displaying values on axis annotation. */ get annotationValueMinPrecision() { return this.i.abh; } set annotationValueMinPrecision(v) { this.i.abh = +v; } /** * Gets or sets the target axis for this annotation. If null, this annotation will use TargetMode to determine target axis. */ get targetAxis() { const r = this.i.aax; if (r == null) { return null; } if (!r.externalObject) { let e = IgxAxisComponent._createFromInternal(r); if (e) { e._implementation = r; } Object.defineProperty(r, 'externalObject', { value: e, enumerable: false, configurable: true, writable: true }); } return r.externalObject; } set targetAxis(v) { if (v != null && this._stylingContainer && v._styling) v._styling(this._stylingContainer, this, this); v == null ? this.i.aax = null : this.i.aax = v.i; } /** * Gets or sets the mode for targeting axes present in the chart. Defaults to targeting all category-axes present in the chart */ get targetMode() { return this.i.aaz; } set targetMode(v) { this.i.aaz = ensureEnum(DataAnnotationTargetMode_$type, v); } /** * Gets or sets whether the badge are rendered in annotations. */ get annotationBadgeEnabled() { return this.i.aa2; } set annotationBadgeEnabled(v) { this.i.aa2 = ensureBool(v); } /** * Gets or sets background of the badge annotations. */ get annotationBadgeBackground() { return brushToString(this.i.ac7); } set annotationBadgeBackground(v) { this.i.ac7 = stringToBrush(v); } /** * Gets or sets border outline of the badge annotations. */ get annotationBadgeOutline() { return brushToString(this.i.ac8); } set annotationBadgeOutline(v) { this.i.ac8 = stringToBrush(v); } /** * Gets or sets border thickness of the badge annotations. */ get annotationBadgeOutlineThickness() { return this.i.aba; } set annotationBadgeOutlineThickness(v) { this.i.aba = +v; } /** * Gets or sets border radius of the badge annotations. */ get annotationBadgeCornerRadius() { return this.i.aa8; } set annotationBadgeCornerRadius(v) { this.i.aa8 = +v; } /** * Gets or sets a member path for displaying an image in the badge annotations. */ get annotationBadgeImagePath() { return this.i.abp; } set annotationBadgeImagePath(v) { this.i.abp = v; } /** * Gets or sets size of the badge annotations. */ get annotationBadgeSize() { return this.i.abb; } set annotationBadgeSize(v) { this.i.abb = +v; } /** * Gets or sets margin of the badge annotations. */ get annotationBadgeMargin() { return this.i.aa9; } set annotationBadgeMargin(v) { this.i.aa9 = +v; } findByName(name) { var baseResult = super.findByName(name); if (baseResult) { return baseResult; } if (this.targetAxis && this.targetAxis.name && this.targetAxis.name == name) { return this.targetAxis; } return null; } _styling(container, component, parent) { super._styling(container, component, parent); this._inStyling = true; if (this.targetAxis && this.targetAxis._styling) { this.targetAxis._styling(container, component, this); } this._inStyling = false; } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0-rc.1", ngImport: i0, type: IgxDataAnnotationAxisLayerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); } static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.0-rc.1", type: IgxDataAnnotationAxisLayerComponent, isStandalone: true, 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 }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0-rc.1", ngImport: i0, type: IgxDataAnnotationAxisLayerComponent, decorators: [{ type: Component, args: [{ template: ``, }] }], ctorParameters: () => [], 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 }] } });