UNPKG

igniteui-webcomponents-charts

Version:

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

331 lines (330 loc) 12.6 kB
import { DataAnnotationDisplayMode_$type } from "./DataAnnotationDisplayMode"; import { AnnotationAppearanceMode_$type } from "./AnnotationAppearanceMode"; import { IgcAxisComponent } from "./igc-axis-component"; import { DataAnnotationTargetMode_$type } from "./DataAnnotationTargetMode"; import { IgcAnnotationLayerComponent } from "./igc-annotation-layer-component"; import { getAllPropertyNames, toSpinal, ensureEnum, enumToString, ensureBool, brushToString, stringToBrush } from "igniteui-webcomponents-core"; import { Thickness } from "igniteui-webcomponents-core"; /** * Represents a base annotation layer that displays annotations over an axis. */ export let IgcDataAnnotationAxisLayerComponent = /*@__PURE__*/ (() => { class IgcDataAnnotationAxisLayerComponent extends IgcAnnotationLayerComponent { /** * @hidden */ get i() { return this._implementation; } constructor() { super(); } connectedCallback() { if (super["connectedCallback"]) { super["connectedCallback"](); } if (this.i.connectedCallback) { this.i.connectedCallback(); } if (!this._attached) { this._attached = true; this._flushQueuedAttributes(); } } disconnectedCallback() { if (super["disconnectedCallback"]) { super["disconnectedCallback"](); } if (this.i.disconnectedCallback) { this.i.disconnectedCallback(); } if (this._attached) { this._attached = false; } } static get observedAttributes() { if (IgcDataAnnotationAxisLayerComponent._observedAttributesIgcDataAnnotationAxisLayerComponent == null) { let names = getAllPropertyNames(IgcDataAnnotationAxisLayerComponent); for (let i = 0; i < names.length; i++) { names[i] = toSpinal(names[i]); } IgcDataAnnotationAxisLayerComponent._observedAttributesIgcDataAnnotationAxisLayerComponent = names; } return IgcDataAnnotationAxisLayerComponent._observedAttributesIgcDataAnnotationAxisLayerComponent; } /** * Gets or sets display mode of label on axis annotation. */ get annotationLabelDisplayMode() { return this.i.aae; } set annotationLabelDisplayMode(v) { this.i.aae = ensureEnum(DataAnnotationDisplayMode_$type, v); this._a("annotationLabelDisplayMode", enumToString(DataAnnotationDisplayMode_$type, this.i.aae)); } /** * Gets or sets whether to show all annotations over target axis */ get annotationLabelVisible() { return this.i.aaj; } set annotationLabelVisible(v) { this.i.aaj = ensureBool(v); this._a("annotationLabelVisible", this.i.aaj); } /** * Gets or sets the text color used in the axis annotation. */ get annotationTextColor() { return brushToString(this.i.ab2); } set annotationTextColor(v) { this.i.ab2 = stringToBrush(v); this._a("annotationTextColor", brushToString(this.i.ab2)); } /** * Gets or sets the mode used for shifting the text color in axis annotation. */ get annotationTextColorMode() { return this.i.aac; } set annotationTextColorMode(v) { this.i.aac = ensureEnum(AnnotationAppearanceMode_$type, v); this._a("annotationTextColorMode", enumToString(AnnotationAppearanceMode_$type, this.i.aac)); } /** * 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.aaq; } set annotationTextColorShift(v) { this.i.aaq = +v; this._a("annotationTextColorShift", this.i.aaq); } /** * Gets or sets whether the annotation text color matches brush of the layer */ get annotationTextColorMatchLayer() { return this.i.aak; } set annotationTextColorMatchLayer(v) { this.i.aak = ensureBool(v); this._a("annotationTextColorMatchLayer", this.i.aak); } /** * Gets or sets the color used for backing of the axis annotation. */ get annotationBackground() { return brushToString(this.i.ab0); } set annotationBackground(v) { this.i.ab0 = stringToBrush(v); this._a("annotationBackground", brushToString(this.i.ab0)); } /** * Gets or sets the border radius used for displaying the axis annotation. */ get annotationBorderRadius() { return this.i.aan; } set annotationBorderRadius(v) { this.i.aan = +v; this._a("annotationBorderRadius", this.i.aan); } /** * Gets or sets the mode used for shifting the background of axis annotation. */ get annotationBackgroundMode() { return this.i.aaa; } set annotationBackgroundMode(v) { this.i.aaa = ensureEnum(AnnotationAppearanceMode_$type, v); this._a("annotationBackgroundMode", enumToString(AnnotationAppearanceMode_$type, this.i.aaa)); } /** * 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.aam; } set annotationBackgroundShift(v) { this.i.aam = +v; this._a("annotationBackgroundShift", this.i.aam); } /** * Gets or sets whether the annotation background matches brush of the layer */ get annotationBackgroundMatchLayer() { return this.i.aah; } set annotationBackgroundMatchLayer(v) { this.i.aah = ensureBool(v); this._a("annotationBackgroundMatchLayer", this.i.aah); } /** * 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.aai; } set annotationBorderMatchLayer(v) { this.i.aai = ensureBool(v); this._a("annotationBorderMatchLayer", this.i.aai); } /** * Gets or sets the color used for border color of the axis annotation. */ get annotationBorderColor() { return brushToString(this.i.ab1); } set annotationBorderColor(v) { this.i.ab1 = stringToBrush(v); this._a("annotationBorderColor", brushToString(this.i.ab1)); } /** * Gets or sets the mode used for shifting border color of the axis annotation. */ get annotationBorderMode() { return this.i.aab; } set annotationBorderMode(v) { this.i.aab = ensureEnum(AnnotationAppearanceMode_$type, v); this._a("annotationBorderMode", enumToString(AnnotationAppearanceMode_$type, this.i.aab)); } /** * 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.aao; } set annotationBorderShift(v) { this.i.aao = +v; this._a("annotationBorderShift", this.i.aao); } get annotationPaddingBottom() { return this.i.ab3 ? this.i.ab3.bottom : NaN; } set annotationPaddingBottom(v) { this.ensureAnnotationPadding(); this.i.ab3.bottom = +v; this._a("annotationPaddingBottom", this.i.ab3.bottom); this.i.ab3 = this.i.ab3; } get annotationPaddingLeft() { return this.i.ab3 ? this.i.ab3.left : NaN; } set annotationPaddingLeft(v) { this.ensureAnnotationPadding(); this.i.ab3.left = +v; this._a("annotationPaddingLeft", this.i.ab3.left); this.i.ab3 = this.i.ab3; } get annotationPaddingRight() { return this.i.ab3 ? this.i.ab3.right : NaN; } set annotationPaddingRight(v) { this.ensureAnnotationPadding(); this.i.ab3.right = +v; this._a("annotationPaddingRight", this.i.ab3.right); this.i.ab3 = this.i.ab3; } get annotationPaddingTop() { return this.i.ab3 ? this.i.ab3.top : NaN; } set annotationPaddingTop(v) { this.ensureAnnotationPadding(); this.i.ab3.top = +v; this._a("annotationPaddingTop", this.i.ab3.top); this.i.ab3 = this.i.ab3; } ensureAnnotationPadding() { if (this.i.ab3) { return; } this.i.ab3 = new Thickness(2); } /** * Gets or sets border thickness of the axis annotations. */ get annotationBorderThickness() { return this.i.aap; } set annotationBorderThickness(v) { this.i.aap = +v; this._a("annotationBorderThickness", this.i.aap); } /** * Gets or sets maximum precision for displaying values on axis annotation. */ get annotationValueMaxPrecision() { return this.i.aar; } set annotationValueMaxPrecision(v) { this.i.aar = +v; this._a("annotationValueMaxPrecision", this.i.aar); } /** * Gets or sets minimum precision for displaying values on axis annotation. */ get annotationValueMinPrecision() { return this.i.aas; } set annotationValueMinPrecision(v) { this.i.aas = +v; this._a("annotationValueMinPrecision", this.i.aas); } /** * 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.aad; if (r == null) { return null; } if (!r.externalObject) { let e = IgcAxisComponent._createFromInternal(r); if (e) { e._implementation = r; } r.externalObject = e; } return r.externalObject; } set targetAxis(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; } /** * 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.aaf; } set targetMode(v) { this.i.aaf = ensureEnum(DataAnnotationTargetMode_$type, v); this._a("targetMode", enumToString(DataAnnotationTargetMode_$type, this.i.aaf)); } 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; } } IgcDataAnnotationAxisLayerComponent._observedAttributesIgcDataAnnotationAxisLayerComponent = null; return IgcDataAnnotationAxisLayerComponent; })();