UNPKG

igniteui-webcomponents-charts

Version:

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

598 lines (591 loc) 23.1 kB
import { __extends } from "tslib"; import { delegateCombine, delegateRemove } from "igniteui-webcomponents-core"; import { OverlayTextLocation_$type } from "./OverlayTextLocation"; import { AnnotationAppearanceMode_$type } from "./AnnotationAppearanceMode"; import { IgcOverlayTextUpdatingEventArgs } from "./igc-overlay-text-updating-event-args"; import { IgcDataAnnotationItem } from "./igc-data-annotation-item"; import { IgcDataAnnotationInfo } from "./igc-data-annotation-info"; import { IgcDataAnnotationAxisLayerComponent } from "./igc-data-annotation-axis-layer-component"; import { getAllPropertyNames, toSpinal, ensureBool, ensureEnum, enumToString, brushToString, stringToBrush, toPoint, fromPoint } from "igniteui-webcomponents-core"; import { FontInfo } from "igniteui-webcomponents-core"; /** * Represents a base annotation layer that renders shapes defined by derived data annotation, e.g. line, strip, slice, rect, band */ export var IgcDataAnnotationShapeLayerComponent = /** @class */ /*@__PURE__*/ (function (_super) { __extends(IgcDataAnnotationShapeLayerComponent, _super); function IgcDataAnnotationShapeLayerComponent() { var _this = _super.call(this) || this; _this._stylingOverlayText = null; _this._stylingOverlayText_wrapped = null; _this._stylingShapeAnnotation = null; _this._stylingShapeAnnotation_wrapped = null; _this._stylingAxisAnnotation = null; _this._stylingAxisAnnotation_wrapped = null; return _this; } Object.defineProperty(IgcDataAnnotationShapeLayerComponent.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; }, enumerable: false, configurable: true }); IgcDataAnnotationShapeLayerComponent.prototype.connectedCallback = function () { if (_super.prototype["connectedCallback"]) { _super.prototype["connectedCallback"].call(this); } if (this.i.connectedCallback) { this.i.connectedCallback(); } if (!this._attached) { this._attached = true; this._flushQueuedAttributes(); } }; IgcDataAnnotationShapeLayerComponent.prototype.disconnectedCallback = function () { if (_super.prototype["disconnectedCallback"]) { _super.prototype["disconnectedCallback"].call(this); } if (this.i.disconnectedCallback) { this.i.disconnectedCallback(); } if (this._attached) { this._attached = false; } }; Object.defineProperty(IgcDataAnnotationShapeLayerComponent, "observedAttributes", { get: function () { if (IgcDataAnnotationShapeLayerComponent._observedAttributesIgcDataAnnotationShapeLayerComponent == null) { var names = getAllPropertyNames(IgcDataAnnotationShapeLayerComponent); for (var i = 0; i < names.length; i++) { names[i] = toSpinal(names[i]); } IgcDataAnnotationShapeLayerComponent._observedAttributesIgcDataAnnotationShapeLayerComponent = names; } return IgcDataAnnotationShapeLayerComponent._observedAttributesIgcDataAnnotationShapeLayerComponent; }, enumerable: false, configurable: true }); Object.defineProperty(IgcDataAnnotationShapeLayerComponent.prototype, "annotationShapeVisible", { /** * Gets or sets whether to draw shape of annotations in the plot area */ get: function () { return this.i.ads; }, set: function (v) { this.i.ads = ensureBool(v); this._a("annotationShapeVisible", this.i.ads); }, enumerable: false, configurable: true }); Object.defineProperty(IgcDataAnnotationShapeLayerComponent.prototype, "itemsUseWorldCoordinates", { /** * Gets or sets whether the data items of the annotations use world coordinates (0.0 - 1.0) or they default to using axes coordinates (data indexes for category axis or data values for numeric axis). */ get: function () { return this.i.adx; }, set: function (v) { this.i.adx = ensureBool(v); this._a("itemsUseWorldCoordinates", this.i.adx); }, enumerable: false, configurable: true }); Object.defineProperty(IgcDataAnnotationShapeLayerComponent.prototype, "overlayTextLocation", { /** * Gets or sets location of the overlay text in relation to shape of data annotation. */ get: function () { return this.i.adj; }, set: function (v) { this.i.adj = ensureEnum(OverlayTextLocation_$type, v); this._a("overlayTextLocation", enumToString(OverlayTextLocation_$type, this.i.adj)); }, enumerable: false, configurable: true }); Object.defineProperty(IgcDataAnnotationShapeLayerComponent.prototype, "overlayTextHorizontalMargin", { /** * Gets or sets the horizontal margin of the overlay text in relation to shape of data annotation. */ get: function () { return this.i.aeh; }, set: function (v) { this.i.aeh = +v; this._a("overlayTextHorizontalMargin", this.i.aeh); }, enumerable: false, configurable: true }); Object.defineProperty(IgcDataAnnotationShapeLayerComponent.prototype, "overlayTextVerticalMargin", { /** * Gets or sets the vertical margin of the overlay text in relation to shape of data annotation. */ get: function () { return this.i.aej; }, set: function (v) { this.i.aej = +v; this._a("overlayTextVerticalMargin", this.i.aej); }, enumerable: false, configurable: true }); Object.defineProperty(IgcDataAnnotationShapeLayerComponent.prototype, "overlayTextHorizontalPadding", { /** * Gets or sets the horizontal padding of the overlay text in relation to shape of data annotation. */ get: function () { return this.i.aei; }, set: function (v) { this.i.aei = +v; this._a("overlayTextHorizontalPadding", this.i.aei); }, enumerable: false, configurable: true }); Object.defineProperty(IgcDataAnnotationShapeLayerComponent.prototype, "overlayTextVerticalPadding", { /** * Gets or sets the vertical padding of the overlay text in relation to shape of data annotation. */ get: function () { return this.i.aek; }, set: function (v) { this.i.aek = +v; this._a("overlayTextVerticalPadding", this.i.aek); }, enumerable: false, configurable: true }); Object.defineProperty(IgcDataAnnotationShapeLayerComponent.prototype, "overlayTextAngle", { /** * Gets or sets the angle rotation (in degrees) of the overlay text in relation to shape of data annotation. */ get: function () { return this.i.aeb; }, set: function (v) { this.i.aeb = +v; this._a("overlayTextAngle", this.i.aeb); }, enumerable: false, configurable: true }); Object.defineProperty(IgcDataAnnotationShapeLayerComponent.prototype, "overlayTextColor", { /** * Gets or sets the color the overlay text. */ get: function () { return brushToString(this.i.agq); }, set: function (v) { this.i.agq = stringToBrush(v); this._a("overlayTextColor", brushToString(this.i.agq)); }, enumerable: false, configurable: true }); Object.defineProperty(IgcDataAnnotationShapeLayerComponent.prototype, "overlayTextBackground", { /** * Gets or sets the background the overlay text. */ get: function () { return brushToString(this.i.ago); }, set: function (v) { this.i.ago = stringToBrush(v); this._a("overlayTextBackground", brushToString(this.i.ago)); }, enumerable: false, configurable: true }); Object.defineProperty(IgcDataAnnotationShapeLayerComponent.prototype, "overlayTextBorderColor", { /** * Gets or sets the border stroke of the overlay text. */ get: function () { return brushToString(this.i.agp); }, set: function (v) { this.i.agp = stringToBrush(v); this._a("overlayTextBorderColor", brushToString(this.i.agp)); }, enumerable: false, configurable: true }); Object.defineProperty(IgcDataAnnotationShapeLayerComponent.prototype, "overlayTextBorderRadius", { /** * Gets or sets the border corner of the overlay text. */ get: function () { return this.i.aed; }, set: function (v) { this.i.aed = +v; this._a("overlayTextBorderRadius", this.i.aed); }, enumerable: false, configurable: true }); Object.defineProperty(IgcDataAnnotationShapeLayerComponent.prototype, "overlayTextBorderThickness", { /** * Gets or sets the border thickness of the overlay text. */ get: function () { return this.i.aef; }, set: function (v) { this.i.aef = +v; this._a("overlayTextBorderThickness", this.i.aef); }, enumerable: false, configurable: true }); Object.defineProperty(IgcDataAnnotationShapeLayerComponent.prototype, "overlayTextVisible", { /** * Gets or sets whether the overlay text is visible in shape of data annotation */ get: function () { return this.i.ad1; }, set: function (v) { this.i.ad1 = ensureBool(v); this._a("overlayTextVisible", this.i.ad1); }, enumerable: false, configurable: true }); Object.defineProperty(IgcDataAnnotationShapeLayerComponent.prototype, "overlayTextMemberPath", { /** * Gets or sets name of data column with text that will be displayed as overlay text. */ get: function () { return this.i.aff; }, set: function (v) { this.i.aff = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgcDataAnnotationShapeLayerComponent.prototype, "overlayText", { /** * Gets or sets the text that will be displayed as the overlay annotation. */ get: function () { return this.i.aev; }, set: function (v) { this.i.aev = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgcDataAnnotationShapeLayerComponent.prototype, "overlayTextColorShift", { /** * Gets or sets the shift of the overlay text color based on OverlayTextColorMode. Value must range between -1.0 to 1.0, where 0 means no color shift. */ get: function () { return this.i.aeg; }, set: function (v) { this.i.aeg = +v; this._a("overlayTextColorShift", this.i.aeg); }, enumerable: false, configurable: true }); Object.defineProperty(IgcDataAnnotationShapeLayerComponent.prototype, "overlayTextColorMode", { /** * Gets or sets the mode used for shifting the background of overlay text based on the target series. */ get: function () { return this.i.adc; }, set: function (v) { this.i.adc = ensureEnum(AnnotationAppearanceMode_$type, v); this._a("overlayTextColorMode", enumToString(AnnotationAppearanceMode_$type, this.i.adc)); }, enumerable: false, configurable: true }); Object.defineProperty(IgcDataAnnotationShapeLayerComponent.prototype, "overlayTextColorMatchLayer", { /** * Gets or sets whether the overlay text color matches brush of the layer */ get: function () { return this.i.ad0; }, set: function (v) { this.i.ad0 = ensureBool(v); this._a("overlayTextColorMatchLayer", this.i.ad0); }, enumerable: false, configurable: true }); Object.defineProperty(IgcDataAnnotationShapeLayerComponent.prototype, "overlayTextBackgroundShift", { /** * Gets or sets the shift of the overlay background based on OverlayTextBackgroundMode. Value must range between -1.0 to 1.0, where 0 means no color shift. */ get: function () { return this.i.aec; }, set: function (v) { this.i.aec = +v; this._a("overlayTextBackgroundShift", this.i.aec); }, enumerable: false, configurable: true }); Object.defineProperty(IgcDataAnnotationShapeLayerComponent.prototype, "overlayTextBackgroundMode", { /** * Gets or sets the mode used for shifting the background of overlay text based on the target series. */ get: function () { return this.i.ada; }, set: function (v) { this.i.ada = ensureEnum(AnnotationAppearanceMode_$type, v); this._a("overlayTextBackgroundMode", enumToString(AnnotationAppearanceMode_$type, this.i.ada)); }, enumerable: false, configurable: true }); Object.defineProperty(IgcDataAnnotationShapeLayerComponent.prototype, "overlayTextBackgroundMatchLayer", { /** * Gets or sets whether the overlay text background matches brush of the layer */ get: function () { return this.i.ady; }, set: function (v) { this.i.ady = ensureBool(v); this._a("overlayTextBackgroundMatchLayer", this.i.ady); }, enumerable: false, configurable: true }); Object.defineProperty(IgcDataAnnotationShapeLayerComponent.prototype, "overlayTextBorderShift", { /** * Gets or sets the shift of the overlay border based on OverlayTextBorderMode. Value must range between -1.0 to 1.0, where 0 means no color shift. */ get: function () { return this.i.aee; }, set: function (v) { this.i.aee = +v; this._a("overlayTextBorderShift", this.i.aee); }, enumerable: false, configurable: true }); Object.defineProperty(IgcDataAnnotationShapeLayerComponent.prototype, "overlayTextBorderMode", { /** * Gets or sets the mode used for shifting the border of overlay text based on the target series. */ get: function () { return this.i.adb; }, set: function (v) { this.i.adb = ensureEnum(AnnotationAppearanceMode_$type, v); this._a("overlayTextBorderMode", enumToString(AnnotationAppearanceMode_$type, this.i.adb)); }, enumerable: false, configurable: true }); Object.defineProperty(IgcDataAnnotationShapeLayerComponent.prototype, "overlayTextBorderMatchLayer", { /** * Gets or sets whether the overlay text border matches brush of the layer */ get: function () { return this.i.adz; }, set: function (v) { this.i.adz = ensureBool(v); this._a("overlayTextBorderMatchLayer", this.i.adz); }, enumerable: false, configurable: true }); Object.defineProperty(IgcDataAnnotationShapeLayerComponent.prototype, "overlayTextStyle", { /** * Gets or Sets the style to use for the display text. */ get: function () { if (this.i.adp == null) { return null; } return this.i.adp.fontString; }, set: function (v) { var fi = new FontInfo(); fi.fontString = v; this.i.adp = fi; this._a("overlayTextStyle", this.i.adp != null ? this.i.adp.fontString : ""); }, enumerable: false, configurable: true }); Object.defineProperty(IgcDataAnnotationShapeLayerComponent.prototype, "isTargetingHorizontalAxis", { /** * Gets whether the annotation layer is currently targeting horizontal axis. */ get: function () { return this.i.adu; }, set: function (v) { this.i.adu = ensureBool(v); this._a("isTargetingHorizontalAxis", this.i.adu); }, enumerable: false, configurable: true }); /** * Converts world coordinate (0.0 - 1.0) to pixel coordinate that is relative to component's size */ IgcDataAnnotationShapeLayerComponent.prototype.fromWorld = function (world) { var iv = this.i.ags(toPoint(world)); return fromPoint(iv); }; /** * Converts world X coordinate (0.0 - 1.0) to pixel coordinate that is relative to component's width */ IgcDataAnnotationShapeLayerComponent.prototype.fromWorldX = function (x) { var iv = this.i.ad8(x); return (iv); }; /** * Converts world Y coordinate (0.0 - 1.0) to pixel coordinate that is relative to component's height */ IgcDataAnnotationShapeLayerComponent.prototype.fromWorldY = function (y) { var iv = this.i.ad9(y); return (iv); }; /** * Converts pixel coordinate (relative to component's size) to world coordinate (0.0 - 1.0) */ IgcDataAnnotationShapeLayerComponent.prototype.toWorld = function (pixel) { var iv = this.i.agv(toPoint(pixel)); return fromPoint(iv); }; /** * Converts pixel X coordinate (relative to component's width) to world coordinate (0.0 - 1.0) */ IgcDataAnnotationShapeLayerComponent.prototype.toWorldX = function (x) { var iv = this.i.aem(x); return (iv); }; /** * Converts pixel Y coordinate (relative to component's height) to world coordinate (0.0 - 1.0) */ IgcDataAnnotationShapeLayerComponent.prototype.toWorldY = function (y) { var iv = this.i.aen(y); return (iv); }; Object.defineProperty(IgcDataAnnotationShapeLayerComponent.prototype, "stylingOverlayText", { /** * Event raised when updating style of overlay text */ get: function () { return this._stylingOverlayText; }, set: function (ev) { var _this = this; if (this._stylingOverlayText_wrapped !== null) { this.i.stylingOverlayText = delegateRemove(this.i.stylingOverlayText, this._stylingOverlayText_wrapped); this._stylingOverlayText_wrapped = null; this._stylingOverlayText = null; } this._stylingOverlayText = ev; this._stylingOverlayText_wrapped = function (o, e) { var outerArgs = new IgcOverlayTextUpdatingEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeStylingOverlayText) { _this.beforeStylingOverlayText(_this, outerArgs); } if (_this._stylingOverlayText) { _this._stylingOverlayText(_this, outerArgs); } }; this.i.stylingOverlayText = delegateCombine(this.i.stylingOverlayText, this._stylingOverlayText_wrapped); ; }, enumerable: false, configurable: true }); Object.defineProperty(IgcDataAnnotationShapeLayerComponent.prototype, "stylingShapeAnnotation", { /** * Event raised when updating style of annotation */ get: function () { return this._stylingShapeAnnotation; }, set: function (ev) { var _this = this; if (this._stylingShapeAnnotation_wrapped !== null) { this.i.stylingShapeAnnotation = delegateRemove(this.i.stylingShapeAnnotation, this._stylingShapeAnnotation_wrapped); this._stylingShapeAnnotation_wrapped = null; this._stylingShapeAnnotation = null; } this._stylingShapeAnnotation = ev; this._stylingShapeAnnotation_wrapped = function (o, e) { var outerArgs = new IgcDataAnnotationItem(); outerArgs._provideImplementation(e); if (_this.beforeStylingShapeAnnotation) { _this.beforeStylingShapeAnnotation(_this, outerArgs); } if (_this._stylingShapeAnnotation) { _this._stylingShapeAnnotation(_this, outerArgs); } }; this.i.stylingShapeAnnotation = delegateCombine(this.i.stylingShapeAnnotation, this._stylingShapeAnnotation_wrapped); ; }, enumerable: false, configurable: true }); Object.defineProperty(IgcDataAnnotationShapeLayerComponent.prototype, "stylingAxisAnnotation", { /** * Event raised when updating style of annotation */ get: function () { return this._stylingAxisAnnotation; }, set: function (ev) { var _this = this; if (this._stylingAxisAnnotation_wrapped !== null) { this.i.stylingAxisAnnotation = delegateRemove(this.i.stylingAxisAnnotation, this._stylingAxisAnnotation_wrapped); this._stylingAxisAnnotation_wrapped = null; this._stylingAxisAnnotation = null; } this._stylingAxisAnnotation = ev; this._stylingAxisAnnotation_wrapped = function (o, e) { var outerArgs = new IgcDataAnnotationInfo(); outerArgs._provideImplementation(e); if (_this.beforeStylingAxisAnnotation) { _this.beforeStylingAxisAnnotation(_this, outerArgs); } if (_this._stylingAxisAnnotation) { _this._stylingAxisAnnotation(_this, outerArgs); } }; this.i.stylingAxisAnnotation = delegateCombine(this.i.stylingAxisAnnotation, this._stylingAxisAnnotation_wrapped); ; }, enumerable: false, configurable: true }); IgcDataAnnotationShapeLayerComponent._observedAttributesIgcDataAnnotationShapeLayerComponent = null; return IgcDataAnnotationShapeLayerComponent; }(IgcDataAnnotationAxisLayerComponent));