UNPKG

igniteui-angular-charts

Version:

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

746 lines (741 loc) 28.5 kB
import { __extends } from "tslib"; import { EventEmitter, Output, Component, forwardRef, Input, ChangeDetectionStrategy } from '@angular/core'; import { delegateCombine } from "igniteui-angular-core"; import { IgxAxisComponent } from "./igx-axis-component"; import { OverlayTextLocation_$type } from "./OverlayTextLocation"; import { AnnotationAppearanceMode_$type } from "./AnnotationAppearanceMode"; import { IgxOverlayTextUpdatingEventArgs } from "./igx-overlay-text-updating-event-args"; import { IgxSeriesComponent } from "./igx-series-component"; import { ValueOverlay } from "./ValueOverlay"; import { ensureBool, brushToString, stringToBrush, ensureEnum, toPoint, fromPoint } from "igniteui-angular-core"; import { FontInfo } from "igniteui-angular-core"; import * as i0 from "@angular/core"; /** * Represents the class of the value overlay. The value overlay is a line or circle representing a value on an axis. */ var IgxValueOverlayComponent = /** @class */ /*@__PURE__*/ (function (_super) { __extends(IgxValueOverlayComponent, _super); function IgxValueOverlayComponent() { var _this = _super.call(this) || this; _this._stylingOverlayText = null; return _this; } IgxValueOverlayComponent.prototype.createImplementation = function () { return new ValueOverlay(); }; Object.defineProperty(IgxValueOverlayComponent.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.prototype, "axis", { /** * Gets or sets the axis used by the value overlay. */ get: function () { var r = this.i.xm; 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.xm = null : this.i.xm = v.i; }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.prototype, "value", { /** * Gets or sets the value of the overlay. */ get: function () { return this.i.yp; }, set: function (v) { this.i.yp = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.prototype, "dateValue", { /** * Gets or sets the value of the overlay as a date. If this is set to something other than the minimum date, then it will be preferred over the Value property. */ get: function () { return this.i.x2; }, set: function (v) { this.i.x2 = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.prototype, "isAxisAnnotationEnabled", { /** * Gets or sets whether to draw annotations over the axes where the crosshair meets with them. */ get: function () { return this.i.xu; }, set: function (v) { this.i.xu = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.prototype, "axisAnnotationFormatLabel", { /** * Sets or gets a function which takes an object that produces a formatted label for the axis annotation. */ get: function () { return this.i.xo; }, set: function (v) { this.i.xo = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.prototype, "axisAnnotationTextColor", { /** * Gets or sets the color to use for the axis annotation text. Leave unset for an automatic value. */ get: function () { return brushToString(this.i.aa2); }, set: function (v) { this.i.aa2 = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.prototype, "axisAnnotationBackground", { /** * Gets or sets the color to use for the axis annotation backing. Leave unset for an automatic value. */ get: function () { return brushToString(this.i.aa0); }, set: function (v) { this.i.aa0 = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.prototype, "axisAnnotationBackgroundCornerRadius", { /** * Gets or sets the corner radius to use for the axis annotation backing. Leave unset for an automatic value. */ get: function () { return this.i.x3; }, set: function (v) { this.i.x3 = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.prototype, "axisAnnotationInterpolatedValuePrecision", { /** * Gets or sets the precision to use displaying values for interpolated positions. */ get: function () { return this.i.yq; }, set: function (v) { this.i.yq = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.prototype, "axisAnnotationOutline", { /** * Gets or sets the color to use for the axis annotation outline. Leave unset for an automatic value. */ get: function () { return brushToString(this.i.aa1); }, set: function (v) { this.i.aa1 = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.prototype, "axisAnnotationPaddingLeft", { /** * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins. */ get: function () { return this.i.x5; }, set: function (v) { this.i.x5 = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.prototype, "axisAnnotationPaddingTop", { /** * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins. */ get: function () { return this.i.x7; }, set: function (v) { this.i.x7 = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.prototype, "axisAnnotationPaddingRight", { /** * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins. */ get: function () { return this.i.x6; }, set: function (v) { this.i.x6 = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.prototype, "axisAnnotationPaddingBottom", { /** * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins. */ get: function () { return this.i.x4; }, set: function (v) { this.i.x4 = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.prototype, "axisAnnotationStrokeThickness", { /** * Gets or sets the stroke thickness for the axis annotation backing. Leave unset for an automatic value. */ get: function () { return this.i.x8; }, set: function (v) { this.i.x8 = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.prototype, "isValueOverlay", { /** * Gets whether the series is a value overlay. */ get: function () { return this.i.isValueOverlay; }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.prototype, "labelResolved", { get: function () { return this.i.y6; }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayTextLocation", { /** * Gets or sets location of the overlay text in relation to shape of data annotation. */ get: function () { return this.i.xp; }, set: function (v) { this.i.xp = ensureEnum(OverlayTextLocation_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayTextHorizontalMargin", { /** * Gets or sets the horizontal margin of the overlay text in relation to shape of data annotation. */ get: function () { return this.i.yh; }, set: function (v) { this.i.yh = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayTextVerticalMargin", { /** * Gets or sets the vertical margin of the overlay text in relation to shape of data annotation. */ get: function () { return this.i.yj; }, set: function (v) { this.i.yj = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayTextHorizontalPadding", { /** * Gets or sets the horizontal padding of the overlay text in relation to shape of data annotation. */ get: function () { return this.i.yi; }, set: function (v) { this.i.yi = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayTextVerticalPadding", { /** * Gets or sets the vertical padding of the overlay text in relation to shape of data annotation. */ get: function () { return this.i.yk; }, set: function (v) { this.i.yk = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.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.yb; }, set: function (v) { this.i.yb = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayTextColor", { /** * Gets or sets the color the overlay text. */ get: function () { return brushToString(this.i.aa5); }, set: function (v) { this.i.aa5 = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayTextBackground", { /** * Gets or sets the background the overlay text. */ get: function () { return brushToString(this.i.aa3); }, set: function (v) { this.i.aa3 = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayTextBorderColor", { /** * Gets or sets the border stroke of the overlay text. */ get: function () { return brushToString(this.i.aa4); }, set: function (v) { this.i.aa4 = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayTextBorderRadius", { /** * Gets or sets the border corner of the overlay text. */ get: function () { return this.i.yd; }, set: function (v) { this.i.yd = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayTextBorderThickness", { /** * Gets or sets the border thickness of the overlay text. */ get: function () { return this.i.yf; }, set: function (v) { this.i.yf = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayTextVisible", { /** * Gets or sets whether the overlay text is visible in shape of data annotation */ get: function () { return this.i.xy; }, set: function (v) { this.i.xy = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayText", { /** * Gets or sets the text that will be displayed as the overlay annotation. */ get: function () { return this.i.y7; }, set: function (v) { this.i.y7 = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.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.yg; }, set: function (v) { this.i.yg = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.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.xl; }, set: function (v) { this.i.xl = ensureEnum(AnnotationAppearanceMode_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayTextColorMatchLayer", { /** * Gets or sets whether the overlay text color matches brush of the layer */ get: function () { return this.i.xx; }, set: function (v) { this.i.xx = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.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.yc; }, set: function (v) { this.i.yc = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.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.xj; }, set: function (v) { this.i.xj = ensureEnum(AnnotationAppearanceMode_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayTextBackgroundMatchLayer", { /** * Gets or sets whether the overlay text background matches brush of the layer */ get: function () { return this.i.xv; }, set: function (v) { this.i.xv = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.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.ye; }, set: function (v) { this.i.ye = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.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.xk; }, set: function (v) { this.i.xk = ensureEnum(AnnotationAppearanceMode_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayTextBorderMatchLayer", { /** * Gets or sets whether the overlay text border matches brush of the layer */ get: function () { return this.i.xw; }, set: function (v) { this.i.xw = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxValueOverlayComponent.prototype, "overlayTextStyle", { /** * Gets or Sets the style to use for the display text. */ get: function () { if (this.i.xt == null) { return null; } return this.i.xt.fontString; }, set: function (v) { var fi = new FontInfo(); fi.fontString = v; this.i.xt = fi; }, enumerable: false, configurable: true }); IgxValueOverlayComponent.prototype.findByName = function (name) { var baseResult = _super.prototype.findByName.call(this, name); if (baseResult) { return baseResult; } if (this.axis && this.axis.name && this.axis.name == name) { return this.axis; } return null; }; IgxValueOverlayComponent.prototype._styling = function (container, component, parent) { _super.prototype._styling.call(this, container, component, parent); this._inStyling = true; if (this.axis && this.axis._styling) { this.axis._styling(container, component, this); } this._inStyling = false; }; IgxValueOverlayComponent.prototype.getSeriesValue = function (world, useInterpolation, skipUnknowns) { var iv = this.i.jd(toPoint(world), useInterpolation, skipUnknowns); return (iv); }; IgxValueOverlayComponent.prototype.getSeriesValuePosition = function (world, useInterpolation, skipUnknowns) { var iv = this.i.ww(toPoint(world), useInterpolation, skipUnknowns); return fromPoint(iv); }; /** * Gets the item index associated with the specified world position * @param world */ IgxValueOverlayComponent.prototype.getItemIndex = function (world) { var iv = this.i.kc(toPoint(world)); return (iv); }; /** * Gets the item that is the best match for the specified world coordinates. * @param world * The world coordinates to use. */ IgxValueOverlayComponent.prototype.getItem = function (world) { var iv = this.i.kw(toPoint(world)); return (iv); }; /** * Requests that the provided item should be brought into view if possible. * @param item * The item to attempt to bring into view. */ IgxValueOverlayComponent.prototype.scrollIntoView = function (item) { var iv = this.i.gj(item); return (iv); }; /** * Gets the label for a data item. * @param value * The unscaled value to get a label for. */ IgxValueOverlayComponent.prototype.getLabel = function (value) { var iv = this.i.y4(value); return (iv); }; Object.defineProperty(IgxValueOverlayComponent.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 }); IgxValueOverlayComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxValueOverlayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); IgxValueOverlayComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: IgxValueOverlayComponent, selector: "igx-value-overlay", inputs: { axis: "axis", value: "value", dateValue: "dateValue", isAxisAnnotationEnabled: "isAxisAnnotationEnabled", axisAnnotationFormatLabel: "axisAnnotationFormatLabel", axisAnnotationTextColor: "axisAnnotationTextColor", axisAnnotationBackground: "axisAnnotationBackground", axisAnnotationBackgroundCornerRadius: "axisAnnotationBackgroundCornerRadius", axisAnnotationInterpolatedValuePrecision: "axisAnnotationInterpolatedValuePrecision", axisAnnotationOutline: "axisAnnotationOutline", axisAnnotationPaddingLeft: "axisAnnotationPaddingLeft", axisAnnotationPaddingTop: "axisAnnotationPaddingTop", axisAnnotationPaddingRight: "axisAnnotationPaddingRight", axisAnnotationPaddingBottom: "axisAnnotationPaddingBottom", axisAnnotationStrokeThickness: "axisAnnotationStrokeThickness", overlayTextLocation: "overlayTextLocation", overlayTextHorizontalMargin: "overlayTextHorizontalMargin", overlayTextVerticalMargin: "overlayTextVerticalMargin", overlayTextHorizontalPadding: "overlayTextHorizontalPadding", overlayTextVerticalPadding: "overlayTextVerticalPadding", overlayTextAngle: "overlayTextAngle", overlayTextColor: "overlayTextColor", overlayTextBackground: "overlayTextBackground", overlayTextBorderColor: "overlayTextBorderColor", overlayTextBorderRadius: "overlayTextBorderRadius", overlayTextBorderThickness: "overlayTextBorderThickness", overlayTextVisible: "overlayTextVisible", overlayText: "overlayText", overlayTextColorShift: "overlayTextColorShift", overlayTextColorMode: "overlayTextColorMode", overlayTextColorMatchLayer: "overlayTextColorMatchLayer", overlayTextBackgroundShift: "overlayTextBackgroundShift", overlayTextBackgroundMode: "overlayTextBackgroundMode", overlayTextBackgroundMatchLayer: "overlayTextBackgroundMatchLayer", overlayTextBorderShift: "overlayTextBorderShift", overlayTextBorderMode: "overlayTextBorderMode", overlayTextBorderMatchLayer: "overlayTextBorderMatchLayer", overlayTextStyle: "overlayTextStyle" }, outputs: { stylingOverlayText: "stylingOverlayText" }, providers: [{ provide: IgxSeriesComponent, useExisting: forwardRef(function () { return IgxValueOverlayComponent; }) }], usesInheritance: true, ngImport: i0, template: "", isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); return IgxValueOverlayComponent; }(IgxSeriesComponent)); export { IgxValueOverlayComponent }; i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxValueOverlayComponent, decorators: [{ type: Component, args: [{ selector: 'igx-value-overlay', template: "", providers: [{ provide: IgxSeriesComponent, useExisting: forwardRef(function () { return IgxValueOverlayComponent; }) }], changeDetection: ChangeDetectionStrategy.OnPush }] }], ctorParameters: function () { return []; }, propDecorators: { axis: [{ type: Input }], value: [{ type: Input }], dateValue: [{ type: Input }], isAxisAnnotationEnabled: [{ type: Input }], axisAnnotationFormatLabel: [{ type: Input }], axisAnnotationTextColor: [{ type: Input }], axisAnnotationBackground: [{ type: Input }], axisAnnotationBackgroundCornerRadius: [{ type: Input }], axisAnnotationInterpolatedValuePrecision: [{ type: Input }], axisAnnotationOutline: [{ type: Input }], axisAnnotationPaddingLeft: [{ type: Input }], axisAnnotationPaddingTop: [{ type: Input }], axisAnnotationPaddingRight: [{ type: Input }], axisAnnotationPaddingBottom: [{ type: Input }], axisAnnotationStrokeThickness: [{ 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 }], 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 }], stylingOverlayText: [{ type: Output }] } });