igniteui-angular-charts
Version:
Ignite UI Angular charting components for building rich data visualizations for modern web apps.
280 lines (279 loc) • 12.1 kB
JavaScript
import { __extends } from "tslib";
import { Component, forwardRef, Input, ChangeDetectionStrategy } from '@angular/core';
import { IgxSeriesComponent } from "./igx-series-component";
import { FinalValueSelectionMode_$type } from "./FinalValueSelectionMode";
import { IgxAnnotationLayerComponent } from "./igx-annotation-layer-component";
import { FinalValueLayer } from "./FinalValueLayer";
import { ensureEnum, brushToString, stringToBrush } from "igniteui-angular-core";
import * as i0 from "@angular/core";
/**
* Represents an annotation layer that displays crosshair lines that cross through the closest value of the target series under the cursor.
*/
var IgxFinalValueLayerComponent = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgxFinalValueLayerComponent, _super);
function IgxFinalValueLayerComponent() {
return _super.call(this) || this;
}
IgxFinalValueLayerComponent.prototype.createImplementation = function () {
return new FinalValueLayer();
};
Object.defineProperty(IgxFinalValueLayerComponent.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxFinalValueLayerComponent.prototype, "isAnnotationFinalValue", {
/**
* Gets whether the series is final value annotation layer.
*/
get: function () {
return this.i.es;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxFinalValueLayerComponent.prototype, "targetSeriesName", {
/**
* Gets or sets the name of the series to target this annotation to. If null, this annotation targets all series simultaneously.
*/
get: function () {
return this.i.aaz;
},
set: function (v) {
this.i.aaz = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxFinalValueLayerComponent.prototype, "targetSeries", {
/**
* Gets or sets the series to target this annotation to. If null, this annotation targets all series simultaneously.
*/
get: function () {
var r = this.i.aad;
if (r == null) {
return null;
}
if (!r.externalObject) {
var e = IgxSeriesComponent._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.aad = null : this.i.aad = v.i;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxFinalValueLayerComponent.prototype, "finalValueSelectionMode", {
/**
* Gets or sets how to select the final value to annotate.
*/
get: function () {
return this.i.aac;
},
set: function (v) {
this.i.aac = ensureEnum(FinalValueSelectionMode_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxFinalValueLayerComponent.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.abj);
},
set: function (v) {
this.i.abj = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxFinalValueLayerComponent.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.abh);
},
set: function (v) {
this.i.abh = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxFinalValueLayerComponent.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.aah;
},
set: function (v) {
this.i.aah = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxFinalValueLayerComponent.prototype, "axisAnnotationInterpolatedValuePrecision", {
/**
* Gets or sets the precision to use displaying values for interpolated crosshair positions.
*/
get: function () {
return this.i.aan;
},
set: function (v) {
this.i.aan = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxFinalValueLayerComponent.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.abi);
},
set: function (v) {
this.i.abi = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxFinalValueLayerComponent.prototype, "axisAnnotationPaddingLeft", {
/**
* Gets or sets the left 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.aaj;
},
set: function (v) {
this.i.aaj = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxFinalValueLayerComponent.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.aal;
},
set: function (v) {
this.i.aal = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxFinalValueLayerComponent.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.aak;
},
set: function (v) {
this.i.aak = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxFinalValueLayerComponent.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.aai;
},
set: function (v) {
this.i.aai = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxFinalValueLayerComponent.prototype, "axisAnnotationStrokeThickness", {
/**
* Gets or sets the stroke thickness for the axis annotation backing. Leave unset for an automatic value.
*/
get: function () {
return this.i.aam;
},
set: function (v) {
this.i.aam = +v;
},
enumerable: false,
configurable: true
});
IgxFinalValueLayerComponent.prototype.findByName = function (name) {
var baseResult = _super.prototype.findByName.call(this, name);
if (baseResult) {
return baseResult;
}
if (this.targetSeries && this.targetSeries.name && this.targetSeries.name == name) {
return this.targetSeries;
}
return null;
};
IgxFinalValueLayerComponent.prototype._styling = function (container, component, parent) {
_super.prototype._styling.call(this, container, component, parent);
this._inStyling = true;
if (this.targetSeries && this.targetSeries._styling) {
this.targetSeries._styling(container, component, this);
}
this._inStyling = false;
};
IgxFinalValueLayerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxFinalValueLayerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
IgxFinalValueLayerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: IgxFinalValueLayerComponent, selector: "igx-final-value-layer", inputs: { targetSeriesName: "targetSeriesName", targetSeries: "targetSeries", finalValueSelectionMode: "finalValueSelectionMode", axisAnnotationTextColor: "axisAnnotationTextColor", axisAnnotationBackground: "axisAnnotationBackground", axisAnnotationBackgroundCornerRadius: "axisAnnotationBackgroundCornerRadius", axisAnnotationInterpolatedValuePrecision: "axisAnnotationInterpolatedValuePrecision", axisAnnotationOutline: "axisAnnotationOutline", axisAnnotationPaddingLeft: "axisAnnotationPaddingLeft", axisAnnotationPaddingTop: "axisAnnotationPaddingTop", axisAnnotationPaddingRight: "axisAnnotationPaddingRight", axisAnnotationPaddingBottom: "axisAnnotationPaddingBottom", axisAnnotationStrokeThickness: "axisAnnotationStrokeThickness" }, providers: [{ provide: IgxAnnotationLayerComponent, useExisting: forwardRef(function () { return IgxFinalValueLayerComponent; }) }, { provide: IgxSeriesComponent, useExisting: forwardRef(function () { return IgxFinalValueLayerComponent; }) }], usesInheritance: true, ngImport: i0, template: "", isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
return IgxFinalValueLayerComponent;
}(IgxAnnotationLayerComponent));
export { IgxFinalValueLayerComponent };
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxFinalValueLayerComponent, decorators: [{
type: Component,
args: [{
selector: 'igx-final-value-layer',
template: "",
providers: [{ provide: IgxAnnotationLayerComponent, useExisting: forwardRef(function () { return IgxFinalValueLayerComponent; }) }, { provide: IgxSeriesComponent, useExisting: forwardRef(function () { return IgxFinalValueLayerComponent; }) }],
changeDetection: ChangeDetectionStrategy.OnPush
}]
}], ctorParameters: function () { return []; }, propDecorators: { targetSeriesName: [{
type: Input
}], targetSeries: [{
type: Input
}], finalValueSelectionMode: [{
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
}] } });