igniteui-angular-charts
Version:
Ignite UI Angular charting components for building rich data visualizations for modern web apps.
612 lines (611 loc) • 24.6 kB
JavaScript
import { __extends } from "tslib";
import { Component, forwardRef, Input, ChangeDetectionStrategy } from '@angular/core';
import { ValueLayerValueMode_$type } from "./ValueLayerValueMode";
import { IgxSeriesComponent } from "./igx-series-component";
import { IgxAxisComponent } from "./igx-axis-component";
import { IgxAnnotationLayerComponent } from "./igx-annotation-layer-component";
import { ValueLayer } from "./ValueLayer";
import { ensureBool, ensureEnum, brushToString, stringToBrush, toPoint } 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 IgxValueLayerComponent = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgxValueLayerComponent, _super);
function IgxValueLayerComponent() {
return _super.call(this) || this;
}
IgxValueLayerComponent.prototype.createImplementation = function () {
return new ValueLayer();
};
Object.defineProperty(IgxValueLayerComponent.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxValueLayerComponent.prototype, "isAnnotationValueLayer", {
/**
* Gets whether the series is an crosshair annotation layer.
*/
get: function () {
return this.i.et;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxValueLayerComponent.prototype, "valueMode", {
/**
* Gets or sets the value mode for the overlay.
*/
get: function () {
return this.i.z4;
},
set: function (v) {
this.i.z4 = ensureEnum(ValueLayerValueMode_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxValueLayerComponent.prototype, "horizontalLineStroke", {
/**
* Gets or sets the color to use for the horizontal line. Leave null for an automatic value.
*/
get: function () {
return brushToString(this.i.acw);
},
set: function (v) {
this.i.acw = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxValueLayerComponent.prototype, "verticalLineStroke", {
/**
* Gets or sets the color to use for vertical line. Leave null for an automatic value.
*/
get: function () {
return brushToString(this.i.acx);
},
set: function (v) {
this.i.acx = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxValueLayerComponent.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.aay;
},
set: function (v) {
this.i.aay = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxValueLayerComponent.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.z2;
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.z2 = null : this.i.z2 = v.i;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxValueLayerComponent.prototype, "targetAxisName", {
/**
* Gets or sets the name of the axis to target this annotation to. If null, this annotation targets all axis simultaneously.
*/
get: function () {
return this.i.aav;
},
set: function (v) {
this.i.aav = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxValueLayerComponent.prototype, "targetAxis", {
/**
* Gets or sets the axis to target this annotation to. If null, this annotation targets all value axis simultaneously.
*/
get: function () {
var r = this.i.zx;
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.zx = null : this.i.zx = v.i;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxValueLayerComponent.prototype, "useInterpolation", {
/**
* Gets or sets whether to use value interpolation when drawing a line through the best value for the cursor position.
*/
get: function () {
return this.i.z9;
},
set: function (v) {
this.i.z9 = ensureBool(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxValueLayerComponent.prototype, "isAxisAnnotationEnabled", {
/**
* Gets or sets whether to draw annotations over the axes where the crosshair meets with them.
*/
get: function () {
return this.i.z6;
},
set: function (v) {
this.i.z6 = ensureBool(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxValueLayerComponent.prototype, "xAxisAnnotationFormatLabel", {
/**
* Sets or gets a function which takes an object that produces a formatted label for the x axis annotation.
*/
get: function () {
return this.i.zy;
},
set: function (v) {
this.i.zy = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxValueLayerComponent.prototype, "yAxisAnnotationFormatLabel", {
/**
* Sets or gets a function which takes an object that produces a formatted label for the y axis annotation.
*/
get: function () {
return this.i.zz;
},
set: function (v) {
this.i.zz = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxValueLayerComponent.prototype, "xAxisAnnotationTextColor", {
/**
* Gets or sets the color to use for the x axis annotation text. Leave unset for an automatic value.
*/
get: function () {
return brushToString(this.i.ac0);
},
set: function (v) {
this.i.ac0 = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxValueLayerComponent.prototype, "xAxisAnnotationBackground", {
/**
* Gets or sets the color to use for the x axis annotation backing. Leave unset for an automatic value.
*/
get: function () {
return brushToString(this.i.acy);
},
set: function (v) {
this.i.acy = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxValueLayerComponent.prototype, "xAxisAnnotationBackgroundCornerRadius", {
/**
* Gets or sets the corner radius to use for the x axis annotation backing. Leave unset for an automatic value.
*/
get: function () {
return this.i.aac;
},
set: function (v) {
this.i.aac = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxValueLayerComponent.prototype, "xAxisAnnotationInterpolatedValuePrecision", {
/**
* Gets or sets the precision to use displaying values for interpolated crosshair positions.
*/
get: function () {
return this.i.aao;
},
set: function (v) {
this.i.aao = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxValueLayerComponent.prototype, "xAxisAnnotationOutline", {
/**
* Gets or sets the color to use for the x axis annotation outline. Leave unset for an automatic value.
*/
get: function () {
return brushToString(this.i.acz);
},
set: function (v) {
this.i.acz = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxValueLayerComponent.prototype, "xAxisAnnotationPaddingLeft", {
/**
* 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.aae;
},
set: function (v) {
this.i.aae = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxValueLayerComponent.prototype, "xAxisAnnotationPaddingTop", {
/**
* 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.aag;
},
set: function (v) {
this.i.aag = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxValueLayerComponent.prototype, "xAxisAnnotationPaddingRight", {
/**
* 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.aaf;
},
set: function (v) {
this.i.aaf = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxValueLayerComponent.prototype, "xAxisAnnotationPaddingBottom", {
/**
* 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.aad;
},
set: function (v) {
this.i.aad = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxValueLayerComponent.prototype, "yAxisAnnotationPaddingLeft", {
/**
* 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(IgxValueLayerComponent.prototype, "yAxisAnnotationPaddingTop", {
/**
* 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.aam;
},
set: function (v) {
this.i.aam = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxValueLayerComponent.prototype, "yAxisAnnotationPaddingRight", {
/**
* 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(IgxValueLayerComponent.prototype, "yAxisAnnotationPaddingBottom", {
/**
* 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.aaj;
},
set: function (v) {
this.i.aaj = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxValueLayerComponent.prototype, "xAxisAnnotationStrokeThickness", {
/**
* Gets or sets the stroke thickness for the x 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(IgxValueLayerComponent.prototype, "yAxisAnnotationTextColor", {
/**
* Gets or sets the color to use for the y axis annotation text. Leave unset for an automatic value.
*/
get: function () {
return brushToString(this.i.ac3);
},
set: function (v) {
this.i.ac3 = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxValueLayerComponent.prototype, "yAxisAnnotationBackground", {
/**
* Gets or sets the color to use for the y axis annotation backing. Leave unset for an automatic value.
*/
get: function () {
return brushToString(this.i.ac1);
},
set: function (v) {
this.i.ac1 = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxValueLayerComponent.prototype, "yAxisAnnotationBackgroundCornerRadius", {
/**
* Gets or sets the corner radius to use for the y axis annotation backing. Leave unset for an automatic value.
*/
get: function () {
return this.i.aai;
},
set: function (v) {
this.i.aai = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxValueLayerComponent.prototype, "yAxisAnnotationInterpolatedValuePrecision", {
/**
* Gets or sets the precision to use displaying values for interpolated crosshair positions.
*/
get: function () {
return this.i.aap;
},
set: function (v) {
this.i.aap = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxValueLayerComponent.prototype, "yAxisAnnotationOutline", {
/**
* Gets or sets the color to use for the y axis annotation outline. Leave unset for an automatic value.
*/
get: function () {
return brushToString(this.i.ac2);
},
set: function (v) {
this.i.ac2 = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxValueLayerComponent.prototype, "yAxisAnnotationStrokeThickness", {
/**
* Gets or sets the stroke thickness for the y axis annotation backing. Leave unset for an automatic value.
*/
get: function () {
return this.i.aan;
},
set: function (v) {
this.i.aan = +v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxValueLayerComponent.prototype, "skipUnknownValues", {
/**
* Gets or sets whether to skip unknown values when searching for series values.
*/
get: function () {
return this.i.z8;
},
set: function (v) {
this.i.z8 = ensureBool(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxValueLayerComponent.prototype, "actualValueLayerBrush", {
/**
* Gets the effective brush for the current value layer. Can be null for value
* modes that target multiple series.
*/
get: function () {
return brushToString(this.i.acv);
},
set: function (v) {
this.i.acv = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxValueLayerComponent.prototype, "isSummarizationSupported", {
get: function () {
return this.i.isSummarizationSupported;
},
enumerable: false,
configurable: true
});
IgxValueLayerComponent.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;
}
if (this.targetAxis && this.targetAxis.name && this.targetAxis.name == name) {
return this.targetAxis;
}
return null;
};
IgxValueLayerComponent.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);
}
if (this.targetAxis && this.targetAxis._styling) {
this.targetAxis._styling(container, component, this);
}
this._inStyling = false;
};
IgxValueLayerComponent.prototype.getSeriesValue = function (world, useInterpolation, skipUnknowns) {
var iv = this.i.i4(toPoint(world), useInterpolation, skipUnknowns);
return (iv);
};
IgxValueLayerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxValueLayerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
IgxValueLayerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: IgxValueLayerComponent, selector: "igx-value-layer", inputs: { valueMode: "valueMode", horizontalLineStroke: "horizontalLineStroke", verticalLineStroke: "verticalLineStroke", targetSeriesName: "targetSeriesName", targetSeries: "targetSeries", targetAxisName: "targetAxisName", targetAxis: "targetAxis", useInterpolation: "useInterpolation", isAxisAnnotationEnabled: "isAxisAnnotationEnabled", xAxisAnnotationFormatLabel: "xAxisAnnotationFormatLabel", yAxisAnnotationFormatLabel: "yAxisAnnotationFormatLabel", xAxisAnnotationTextColor: "xAxisAnnotationTextColor", xAxisAnnotationBackground: "xAxisAnnotationBackground", xAxisAnnotationBackgroundCornerRadius: "xAxisAnnotationBackgroundCornerRadius", xAxisAnnotationInterpolatedValuePrecision: "xAxisAnnotationInterpolatedValuePrecision", xAxisAnnotationOutline: "xAxisAnnotationOutline", xAxisAnnotationPaddingLeft: "xAxisAnnotationPaddingLeft", xAxisAnnotationPaddingTop: "xAxisAnnotationPaddingTop", xAxisAnnotationPaddingRight: "xAxisAnnotationPaddingRight", xAxisAnnotationPaddingBottom: "xAxisAnnotationPaddingBottom", yAxisAnnotationPaddingLeft: "yAxisAnnotationPaddingLeft", yAxisAnnotationPaddingTop: "yAxisAnnotationPaddingTop", yAxisAnnotationPaddingRight: "yAxisAnnotationPaddingRight", yAxisAnnotationPaddingBottom: "yAxisAnnotationPaddingBottom", xAxisAnnotationStrokeThickness: "xAxisAnnotationStrokeThickness", yAxisAnnotationTextColor: "yAxisAnnotationTextColor", yAxisAnnotationBackground: "yAxisAnnotationBackground", yAxisAnnotationBackgroundCornerRadius: "yAxisAnnotationBackgroundCornerRadius", yAxisAnnotationInterpolatedValuePrecision: "yAxisAnnotationInterpolatedValuePrecision", yAxisAnnotationOutline: "yAxisAnnotationOutline", yAxisAnnotationStrokeThickness: "yAxisAnnotationStrokeThickness", skipUnknownValues: "skipUnknownValues", actualValueLayerBrush: "actualValueLayerBrush" }, providers: [{ provide: IgxAnnotationLayerComponent, useExisting: forwardRef(function () { return IgxValueLayerComponent; }) }, { provide: IgxSeriesComponent, useExisting: forwardRef(function () { return IgxValueLayerComponent; }) }], usesInheritance: true, ngImport: i0, template: "", isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
return IgxValueLayerComponent;
}(IgxAnnotationLayerComponent));
export { IgxValueLayerComponent };
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxValueLayerComponent, decorators: [{
type: Component,
args: [{
selector: 'igx-value-layer',
template: "",
providers: [{ provide: IgxAnnotationLayerComponent, useExisting: forwardRef(function () { return IgxValueLayerComponent; }) }, { provide: IgxSeriesComponent, useExisting: forwardRef(function () { return IgxValueLayerComponent; }) }],
changeDetection: ChangeDetectionStrategy.OnPush
}]
}], ctorParameters: function () { return []; }, propDecorators: { valueMode: [{
type: Input
}], horizontalLineStroke: [{
type: Input
}], verticalLineStroke: [{
type: Input
}], targetSeriesName: [{
type: Input
}], targetSeries: [{
type: Input
}], targetAxisName: [{
type: Input
}], targetAxis: [{
type: Input
}], useInterpolation: [{
type: Input
}], isAxisAnnotationEnabled: [{
type: Input
}], xAxisAnnotationFormatLabel: [{
type: Input
}], yAxisAnnotationFormatLabel: [{
type: Input
}], xAxisAnnotationTextColor: [{
type: Input
}], xAxisAnnotationBackground: [{
type: Input
}], xAxisAnnotationBackgroundCornerRadius: [{
type: Input
}], xAxisAnnotationInterpolatedValuePrecision: [{
type: Input
}], xAxisAnnotationOutline: [{
type: Input
}], xAxisAnnotationPaddingLeft: [{
type: Input
}], xAxisAnnotationPaddingTop: [{
type: Input
}], xAxisAnnotationPaddingRight: [{
type: Input
}], xAxisAnnotationPaddingBottom: [{
type: Input
}], yAxisAnnotationPaddingLeft: [{
type: Input
}], yAxisAnnotationPaddingTop: [{
type: Input
}], yAxisAnnotationPaddingRight: [{
type: Input
}], yAxisAnnotationPaddingBottom: [{
type: Input
}], xAxisAnnotationStrokeThickness: [{
type: Input
}], yAxisAnnotationTextColor: [{
type: Input
}], yAxisAnnotationBackground: [{
type: Input
}], yAxisAnnotationBackgroundCornerRadius: [{
type: Input
}], yAxisAnnotationInterpolatedValuePrecision: [{
type: Input
}], yAxisAnnotationOutline: [{
type: Input
}], yAxisAnnotationStrokeThickness: [{
type: Input
}], skipUnknownValues: [{
type: Input
}], actualValueLayerBrush: [{
type: Input
}] } });