UNPKG

igniteui-angular-charts

Version:

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

591 lines (584 loc) 23.4 kB
import { __extends } from "tslib"; import { EventEmitter, Output, Component, Input } from '@angular/core'; import { delegateCombine } from "igniteui-angular-core"; import { OverlayTextLocation_$type } from "./OverlayTextLocation"; import { AnnotationAppearanceMode_$type } from "./AnnotationAppearanceMode"; import { IgxOverlayTextUpdatingEventArgs } from "./igx-overlay-text-updating-event-args"; import { IgxDataAnnotationItem } from "./igx-data-annotation-item"; import { IgxDataAnnotationInfo } from "./igx-data-annotation-info"; import { IgxDataAnnotationAxisLayerComponent } from "./igx-data-annotation-axis-layer-component"; import { ensureBool, ensureEnum, brushToString, stringToBrush, toPoint, fromPoint } from "igniteui-angular-core"; import { FontInfo } from "igniteui-angular-core"; import * as i0 from "@angular/core"; /** * Represents a base annotation layer that renders shapes defined by derived data annotation, e.g. line, strip, slice, rect, band */ var IgxDataAnnotationShapeLayerComponent = /** @class */ /*@__PURE__*/ (function (_super) { __extends(IgxDataAnnotationShapeLayerComponent, _super); function IgxDataAnnotationShapeLayerComponent() { var _this = _super.call(this) || this; _this._stylingOverlayText = null; _this._stylingShapeAnnotation = null; _this._stylingAxisAnnotation = null; return _this; } Object.defineProperty(IgxDataAnnotationShapeLayerComponent.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationShapeLayerComponent.prototype, "annotationShapeVisible", { /** * Gets or sets whether to draw shape of annotations in the plot area */ get: function () { return this.i.acl; }, set: function (v) { this.i.acl = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationShapeLayerComponent.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.acp; }, set: function (v) { this.i.acp = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationShapeLayerComponent.prototype, "overlayTextLocation", { /** * Gets or sets location of the overlay text in relation to shape of data annotation. */ get: function () { return this.i.acd; }, set: function (v) { this.i.acd = ensureEnum(OverlayTextLocation_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationShapeLayerComponent.prototype, "overlayTextHorizontalMargin", { /** * Gets or sets the horizontal margin of the overlay text in relation to shape of data annotation. */ get: function () { return this.i.ac9; }, set: function (v) { this.i.ac9 = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationShapeLayerComponent.prototype, "overlayTextVerticalMargin", { /** * Gets or sets the vertical margin of the overlay text in relation to shape of data annotation. */ get: function () { return this.i.adb; }, set: function (v) { this.i.adb = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationShapeLayerComponent.prototype, "overlayTextHorizontalPadding", { /** * Gets or sets the horizontal padding of the overlay text in relation to shape of data annotation. */ get: function () { return this.i.ada; }, set: function (v) { this.i.ada = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationShapeLayerComponent.prototype, "overlayTextVerticalPadding", { /** * Gets or sets the vertical padding of the overlay text in relation to shape of data annotation. */ get: function () { return this.i.adc; }, set: function (v) { this.i.adc = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationShapeLayerComponent.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.ac3; }, set: function (v) { this.i.ac3 = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationShapeLayerComponent.prototype, "overlayTextColor", { /** * Gets or sets the color the overlay text. */ get: function () { return brushToString(this.i.afd); }, set: function (v) { this.i.afd = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationShapeLayerComponent.prototype, "overlayTextBackground", { /** * Gets or sets the background the overlay text. */ get: function () { return brushToString(this.i.afb); }, set: function (v) { this.i.afb = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationShapeLayerComponent.prototype, "overlayTextBorderColor", { /** * Gets or sets the border stroke of the overlay text. */ get: function () { return brushToString(this.i.afc); }, set: function (v) { this.i.afc = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationShapeLayerComponent.prototype, "overlayTextBorderRadius", { /** * Gets or sets the border corner of the overlay text. */ get: function () { return this.i.ac5; }, set: function (v) { this.i.ac5 = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationShapeLayerComponent.prototype, "overlayTextBorderThickness", { /** * Gets or sets the border thickness of the overlay text. */ get: function () { return this.i.ac7; }, set: function (v) { this.i.ac7 = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationShapeLayerComponent.prototype, "overlayTextVisible", { /** * Gets or sets whether the overlay text is visible in shape of data annotation */ get: function () { return this.i.act; }, set: function (v) { this.i.act = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationShapeLayerComponent.prototype, "overlayTextMemberPath", { /** * Gets or sets name of data column with text that will be displayed as overlay text. */ get: function () { return this.i.ad5; }, set: function (v) { this.i.ad5 = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationShapeLayerComponent.prototype, "overlayText", { /** * Gets or sets the text that will be displayed as the overlay annotation. */ get: function () { return this.i.adl; }, set: function (v) { this.i.adl = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationShapeLayerComponent.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.ac8; }, set: function (v) { this.i.ac8 = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationShapeLayerComponent.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.ab6; }, set: function (v) { this.i.ab6 = ensureEnum(AnnotationAppearanceMode_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationShapeLayerComponent.prototype, "overlayTextColorMatchLayer", { /** * Gets or sets whether the overlay text color matches brush of the layer */ get: function () { return this.i.acs; }, set: function (v) { this.i.acs = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationShapeLayerComponent.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.ac4; }, set: function (v) { this.i.ac4 = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationShapeLayerComponent.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.ab4; }, set: function (v) { this.i.ab4 = ensureEnum(AnnotationAppearanceMode_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationShapeLayerComponent.prototype, "overlayTextBackgroundMatchLayer", { /** * Gets or sets whether the overlay text background matches brush of the layer */ get: function () { return this.i.acq; }, set: function (v) { this.i.acq = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationShapeLayerComponent.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.ac6; }, set: function (v) { this.i.ac6 = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationShapeLayerComponent.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.ab5; }, set: function (v) { this.i.ab5 = ensureEnum(AnnotationAppearanceMode_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationShapeLayerComponent.prototype, "overlayTextBorderMatchLayer", { /** * Gets or sets whether the overlay text border matches brush of the layer */ get: function () { return this.i.acr; }, set: function (v) { this.i.acr = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationShapeLayerComponent.prototype, "overlayTextStyle", { /** * Gets or Sets the style to use for the display text. */ get: function () { if (this.i.aci == null) { return null; } return this.i.aci.fontString; }, set: function (v) { var fi = new FontInfo(); fi.fontString = v; this.i.aci = fi; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationShapeLayerComponent.prototype, "isTargetingHorizontalAxis", { /** * Gets whether the annotation layer is currently targeting horizontal axis. */ get: function () { return this.i.acm; }, set: function (v) { this.i.acm = ensureBool(v); }, enumerable: false, configurable: true }); /** * Converts world coordinate (0.0 - 1.0) to pixel coordinate that is relative to component's size */ IgxDataAnnotationShapeLayerComponent.prototype.fromWorld = function (world) { var iv = this.i.aff(toPoint(world)); return fromPoint(iv); }; /** * Converts world X coordinate (0.0 - 1.0) to pixel coordinate that is relative to component's width */ IgxDataAnnotationShapeLayerComponent.prototype.fromWorldX = function (x) { var iv = this.i.ac0(x); return (iv); }; /** * Converts world Y coordinate (0.0 - 1.0) to pixel coordinate that is relative to component's height */ IgxDataAnnotationShapeLayerComponent.prototype.fromWorldY = function (y) { var iv = this.i.ac1(y); return (iv); }; /** * Converts pixel coordinate (relative to component's size) to world coordinate (0.0 - 1.0) */ IgxDataAnnotationShapeLayerComponent.prototype.toWorld = function (pixel) { var iv = this.i.afi(toPoint(pixel)); return fromPoint(iv); }; /** * Converts pixel X coordinate (relative to component's width) to world coordinate (0.0 - 1.0) */ IgxDataAnnotationShapeLayerComponent.prototype.toWorldX = function (x) { var iv = this.i.add(x); return (iv); }; /** * Converts pixel Y coordinate (relative to component's height) to world coordinate (0.0 - 1.0) */ IgxDataAnnotationShapeLayerComponent.prototype.toWorldY = function (y) { var iv = this.i.ade(y); return (iv); }; Object.defineProperty(IgxDataAnnotationShapeLayerComponent.prototype, "stylingOverlayText", { /** * Event raised when updating style of overlay text */ get: function () { var _this = this; if (this._stylingOverlayText == null) { this._stylingOverlayText = new EventEmitter(); this.i.stylingOverlayText = delegateCombine(this.i.stylingOverlayText, function (o, e) { _this._runInZone(function () { var outerArgs = new IgxOverlayTextUpdatingEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeStylingOverlayText) { _this.beforeStylingOverlayText(_this, outerArgs); } _this._stylingOverlayText.emit({ sender: _this, args: outerArgs }); }); }); } return this._stylingOverlayText; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationShapeLayerComponent.prototype, "stylingShapeAnnotation", { /** * Event raised when updating style of annotation */ get: function () { var _this = this; if (this._stylingShapeAnnotation == null) { this._stylingShapeAnnotation = new EventEmitter(); this.i.stylingShapeAnnotation = delegateCombine(this.i.stylingShapeAnnotation, function (o, e) { _this._runInZone(function () { var outerArgs = new IgxDataAnnotationItem(); outerArgs._provideImplementation(e); if (_this.beforeStylingShapeAnnotation) { _this.beforeStylingShapeAnnotation(_this, outerArgs); } _this._stylingShapeAnnotation.emit({ sender: _this, args: outerArgs }); }); }); } return this._stylingShapeAnnotation; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataAnnotationShapeLayerComponent.prototype, "stylingAxisAnnotation", { /** * Event raised when updating style of annotation */ get: function () { var _this = this; if (this._stylingAxisAnnotation == null) { this._stylingAxisAnnotation = new EventEmitter(); this.i.stylingAxisAnnotation = delegateCombine(this.i.stylingAxisAnnotation, function (o, e) { _this._runInZone(function () { var outerArgs = new IgxDataAnnotationInfo(); outerArgs._provideImplementation(e); if (_this.beforeStylingAxisAnnotation) { _this.beforeStylingAxisAnnotation(_this, outerArgs); } _this._stylingAxisAnnotation.emit({ sender: _this, args: outerArgs }); }); }); } return this._stylingAxisAnnotation; }, enumerable: false, configurable: true }); IgxDataAnnotationShapeLayerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxDataAnnotationShapeLayerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); IgxDataAnnotationShapeLayerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: IgxDataAnnotationShapeLayerComponent, selector: "ng-component", inputs: { annotationShapeVisible: "annotationShapeVisible", itemsUseWorldCoordinates: "itemsUseWorldCoordinates", overlayTextLocation: "overlayTextLocation", overlayTextHorizontalMargin: "overlayTextHorizontalMargin", overlayTextVerticalMargin: "overlayTextVerticalMargin", overlayTextHorizontalPadding: "overlayTextHorizontalPadding", overlayTextVerticalPadding: "overlayTextVerticalPadding", overlayTextAngle: "overlayTextAngle", overlayTextColor: "overlayTextColor", overlayTextBackground: "overlayTextBackground", overlayTextBorderColor: "overlayTextBorderColor", overlayTextBorderRadius: "overlayTextBorderRadius", overlayTextBorderThickness: "overlayTextBorderThickness", overlayTextVisible: "overlayTextVisible", overlayTextMemberPath: "overlayTextMemberPath", overlayText: "overlayText", overlayTextColorShift: "overlayTextColorShift", overlayTextColorMode: "overlayTextColorMode", overlayTextColorMatchLayer: "overlayTextColorMatchLayer", overlayTextBackgroundShift: "overlayTextBackgroundShift", overlayTextBackgroundMode: "overlayTextBackgroundMode", overlayTextBackgroundMatchLayer: "overlayTextBackgroundMatchLayer", overlayTextBorderShift: "overlayTextBorderShift", overlayTextBorderMode: "overlayTextBorderMode", overlayTextBorderMatchLayer: "overlayTextBorderMatchLayer", overlayTextStyle: "overlayTextStyle", isTargetingHorizontalAxis: "isTargetingHorizontalAxis" }, outputs: { stylingOverlayText: "stylingOverlayText", stylingShapeAnnotation: "stylingShapeAnnotation", stylingAxisAnnotation: "stylingAxisAnnotation" }, usesInheritance: true, ngImport: i0, template: "", isInline: true }); return IgxDataAnnotationShapeLayerComponent; }(IgxDataAnnotationAxisLayerComponent)); export { IgxDataAnnotationShapeLayerComponent }; i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxDataAnnotationShapeLayerComponent, decorators: [{ type: Component, args: [{ template: "", }] }], ctorParameters: function () { return []; }, propDecorators: { annotationShapeVisible: [{ type: Input }], itemsUseWorldCoordinates: [{ type: Input }], overlayTextLocation: [{ type: Input }], overlayTextHorizontalMargin: [{ type: Input }], overlayTextVerticalMargin: [{ type: Input }], overlayTextHorizontalPadding: [{ type: Input }], overlayTextVerticalPadding: [{ type: Input }], overlayTextAngle: [{ type: Input }], overlayTextColor: [{ type: Input }], overlayTextBackground: [{ type: Input }], overlayTextBorderColor: [{ type: Input }], overlayTextBorderRadius: [{ type: Input }], overlayTextBorderThickness: [{ type: Input }], overlayTextVisible: [{ type: Input }], overlayTextMemberPath: [{ type: Input }], overlayText: [{ type: Input }], overlayTextColorShift: [{ type: Input }], overlayTextColorMode: [{ type: Input }], overlayTextColorMatchLayer: [{ type: Input }], overlayTextBackgroundShift: [{ type: Input }], overlayTextBackgroundMode: [{ type: Input }], overlayTextBackgroundMatchLayer: [{ type: Input }], overlayTextBorderShift: [{ type: Input }], overlayTextBorderMode: [{ type: Input }], overlayTextBorderMatchLayer: [{ type: Input }], overlayTextStyle: [{ type: Input }], isTargetingHorizontalAxis: [{ type: Input }], stylingOverlayText: [{ type: Output }], stylingShapeAnnotation: [{ type: Output }], stylingAxisAnnotation: [{ type: Output }] } });