igniteui-angular-charts
Version:
Ignite UI Angular charting components for building rich data visualizations for modern web apps.
200 lines (198 loc) • 8.57 kB
JavaScript
import { __extends } from "tslib";
import { Component, forwardRef, Input, ChangeDetectionStrategy } from '@angular/core';
import { IgxAxisComponent } from "./igx-axis-component";
import { CategoryTooltipLayerPosition_$type } from "./CategoryTooltipLayerPosition";
import { IgxAnnotationLayerComponent } from "./igx-annotation-layer-component";
import { IgxSeriesComponent } from "./igx-series-component";
import { CategoryToolTipLayer } from "./CategoryToolTipLayer";
import { ensureBool, ensureEnum, brushToString, stringToBrush } from "igniteui-angular-core";
import * as i0 from "@angular/core";
/**
* Represents an annotation layer that displays grouped tooltips for series that use a category axis.
*/
var IgxCategoryToolTipLayerComponent = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgxCategoryToolTipLayerComponent, _super);
function IgxCategoryToolTipLayerComponent() {
return _super.call(this) || this;
}
IgxCategoryToolTipLayerComponent.prototype.createImplementation = function () {
return new CategoryToolTipLayer();
};
Object.defineProperty(IgxCategoryToolTipLayerComponent.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxCategoryToolTipLayerComponent.prototype, "isToolTipLayer", {
get: function () {
return this.i.f7;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxCategoryToolTipLayerComponent.prototype, "isAnnotationHoverLayer", {
/**
* Gets whether the series is an annotation layer displayed only when hovering over the chart.
*/
get: function () {
return this.i.eu;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxCategoryToolTipLayerComponent.prototype, "isDefaultTooltipBehaviorDisabled", {
/**
* Gets whether the default tooltip behaviors for the chart are disabled if this layer is present.
*/
get: function () {
return this.i.e5;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxCategoryToolTipLayerComponent.prototype, "targetAxis", {
/**
* Gets or sets the Axis to target this annotation to. If null, this annotation layer will not render content.
*/
get: function () {
var r = this.i.aas;
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.aas = null : this.i.aas = v.i;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxCategoryToolTipLayerComponent.prototype, "useInterpolation", {
/**
* Gets or sets whether to use value interpolation when drawing the tooltips.
*/
get: function () {
return this.i.aaw;
},
set: function (v) {
this.i.aaw = ensureBool(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxCategoryToolTipLayerComponent.prototype, "toolTipPosition", {
/**
* Gets or sets the Position to apply to the tooltip containers.
*/
get: function () {
return this.i.aat;
},
set: function (v) {
this.i.aat = ensureEnum(CategoryTooltipLayerPosition_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxCategoryToolTipLayerComponent.prototype, "toolTipBackground", {
/**
* Gets or sets the background of the tooltip containers.
*/
get: function () {
return brushToString(this.i.abc);
},
set: function (v) {
this.i.abc = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxCategoryToolTipLayerComponent.prototype, "toolTipBorderBrush", {
/**
* Gets or sets the border color of the tooltip containers.
*/
get: function () {
return brushToString(this.i.abd);
},
set: function (v) {
this.i.abd = stringToBrush(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxCategoryToolTipLayerComponent.prototype, "toolTipBorderThickness", {
/**
* Gets or sets the border thickness of the tooltip containers.
*/
get: function () {
return this.i.aax;
},
set: function (v) {
this.i.aax = +v;
},
enumerable: false,
configurable: true
});
IgxCategoryToolTipLayerComponent.prototype.findByName = function (name) {
var baseResult = _super.prototype.findByName.call(this, name);
if (baseResult) {
return baseResult;
}
if (this.targetAxis && this.targetAxis.name && this.targetAxis.name == name) {
return this.targetAxis;
}
return null;
};
IgxCategoryToolTipLayerComponent.prototype._styling = function (container, component, parent) {
_super.prototype._styling.call(this, container, component, parent);
this._inStyling = true;
if (this.targetAxis && this.targetAxis._styling) {
this.targetAxis._styling(container, component, this);
}
this._inStyling = false;
};
/**
* Hides any tooltips presented by the layer, if any.
*/
IgxCategoryToolTipLayerComponent.prototype.hideToolTips = function () {
this.i.ql();
};
IgxCategoryToolTipLayerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxCategoryToolTipLayerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
IgxCategoryToolTipLayerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: IgxCategoryToolTipLayerComponent, selector: "igx-category-tool-tip-layer", inputs: { targetAxis: "targetAxis", useInterpolation: "useInterpolation", toolTipPosition: "toolTipPosition", toolTipBackground: "toolTipBackground", toolTipBorderBrush: "toolTipBorderBrush", toolTipBorderThickness: "toolTipBorderThickness" }, providers: [{ provide: IgxAnnotationLayerComponent, useExisting: forwardRef(function () { return IgxCategoryToolTipLayerComponent; }) }, { provide: IgxSeriesComponent, useExisting: forwardRef(function () { return IgxCategoryToolTipLayerComponent; }) }], usesInheritance: true, ngImport: i0, template: "", isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
return IgxCategoryToolTipLayerComponent;
}(IgxAnnotationLayerComponent));
export { IgxCategoryToolTipLayerComponent };
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxCategoryToolTipLayerComponent, decorators: [{
type: Component,
args: [{
selector: 'igx-category-tool-tip-layer',
template: "",
providers: [{ provide: IgxAnnotationLayerComponent, useExisting: forwardRef(function () { return IgxCategoryToolTipLayerComponent; }) }, { provide: IgxSeriesComponent, useExisting: forwardRef(function () { return IgxCategoryToolTipLayerComponent; }) }],
changeDetection: ChangeDetectionStrategy.OnPush
}]
}], ctorParameters: function () { return []; }, propDecorators: { targetAxis: [{
type: Input
}], useInterpolation: [{
type: Input
}], toolTipPosition: [{
type: Input
}], toolTipBackground: [{
type: Input
}], toolTipBorderBrush: [{
type: Input
}], toolTipBorderThickness: [{
type: Input
}] } });