igniteui-angular-charts
Version:
Ignite UI Angular charting components for building rich data visualizations for modern web apps.
219 lines (218 loc) • 9.8 kB
JavaScript
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.
*/
export let IgxFinalValueLayerComponent = /*@__PURE__*/ (() => {
class IgxFinalValueLayerComponent extends IgxAnnotationLayerComponent {
constructor() {
super();
}
createImplementation() {
return new FinalValueLayer();
}
/**
* @hidden
*/
get i() {
return this._implementation;
}
/**
* Gets whether the series is final value annotation layer.
*/
get isAnnotationFinalValue() {
return this.i.et;
}
/**
* Gets or sets the name of the series to target this annotation to. If null, this annotation targets all series simultaneously.
*/
get targetSeriesName() {
return this.i.abh;
}
set targetSeriesName(v) {
this.i.abh = v;
}
/**
* Gets or sets the series to target this annotation to. If null, this annotation targets all series simultaneously.
*/
get targetSeries() {
const r = this.i.aav;
if (r == null) {
return null;
}
if (!r.externalObject) {
let e = IgxSeriesComponent._createFromInternal(r);
if (e) {
e._implementation = r;
}
r.externalObject = e;
}
return r.externalObject;
}
set targetSeries(v) {
if (v != null && this._stylingContainer && v._styling)
v._styling(this._stylingContainer, this, this);
v == null ? this.i.aav = null : this.i.aav = v.i;
}
/**
* Gets or sets how to select the final value to annotate.
*/
get finalValueSelectionMode() {
return this.i.aau;
}
set finalValueSelectionMode(v) {
this.i.aau = ensureEnum(FinalValueSelectionMode_$type, v);
}
/**
* Gets or sets the color to use for the axis annotation text. Leave unset for an automatic value.
*/
get axisAnnotationTextColor() {
return brushToString(this.i.ab1);
}
set axisAnnotationTextColor(v) {
this.i.ab1 = stringToBrush(v);
}
/**
* Gets or sets the color to use for the axis annotation backing. Leave unset for an automatic value.
*/
get axisAnnotationBackground() {
return brushToString(this.i.abz);
}
set axisAnnotationBackground(v) {
this.i.abz = stringToBrush(v);
}
/**
* Gets or sets the corner radius to use for the axis annotation backing. Leave unset for an automatic value.
*/
get axisAnnotationBackgroundCornerRadius() {
return this.i.aaz;
}
set axisAnnotationBackgroundCornerRadius(v) {
this.i.aaz = +v;
}
/**
* Gets or sets the precision to use displaying values for interpolated crosshair positions.
*/
get axisAnnotationInterpolatedValuePrecision() {
return this.i.aa5;
}
set axisAnnotationInterpolatedValuePrecision(v) {
this.i.aa5 = +v;
}
/**
* Gets or sets the color to use for the axis annotation outline. Leave unset for an automatic value.
*/
get axisAnnotationOutline() {
return brushToString(this.i.ab0);
}
set axisAnnotationOutline(v) {
this.i.ab0 = stringToBrush(v);
}
/**
* 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 axisAnnotationPaddingLeft() {
return this.i.aa1;
}
set axisAnnotationPaddingLeft(v) {
this.i.aa1 = +v;
}
/**
* 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 axisAnnotationPaddingTop() {
return this.i.aa3;
}
set axisAnnotationPaddingTop(v) {
this.i.aa3 = +v;
}
/**
* 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 axisAnnotationPaddingRight() {
return this.i.aa2;
}
set axisAnnotationPaddingRight(v) {
this.i.aa2 = +v;
}
/**
* 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 axisAnnotationPaddingBottom() {
return this.i.aa0;
}
set axisAnnotationPaddingBottom(v) {
this.i.aa0 = +v;
}
/**
* Gets or sets the stroke thickness for the axis annotation backing. Leave unset for an automatic value.
*/
get axisAnnotationStrokeThickness() {
return this.i.aa4;
}
set axisAnnotationStrokeThickness(v) {
this.i.aa4 = +v;
}
findByName(name) {
var baseResult = super.findByName(name);
if (baseResult) {
return baseResult;
}
if (this.targetSeries && this.targetSeries.name && this.targetSeries.name == name) {
return this.targetSeries;
}
return null;
}
_styling(container, component, parent) {
super._styling(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(() => IgxFinalValueLayerComponent) }, { provide: IgxSeriesComponent, useExisting: forwardRef(() => IgxFinalValueLayerComponent) }], usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
return 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(() => IgxFinalValueLayerComponent) }, { provide: IgxSeriesComponent, useExisting: forwardRef(() => 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
}] } });