UNPKG

igniteui-angular-charts

Version:

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

172 lines (169 loc) 6.54 kB
import { Component, forwardRef, Input, ChangeDetectionStrategy } from '@angular/core'; import { IgxSeriesComponent } from "./igx-series-component"; import { IgxAnnotationLayerComponent } from "./igx-annotation-layer-component"; import { ItemToolTipLayer } from "./ItemToolTipLayer"; import { ensureBool, brushToString, stringToBrush } from "igniteui-angular-core"; import * as i0 from "@angular/core"; /** * Represents an annotation layer that displays tooltips for all target series individually. */ export class IgxItemToolTipLayerComponent extends IgxAnnotationLayerComponent { createImplementation() { return new ItemToolTipLayer(); } /** * @hidden */ get i() { return this._implementation; } constructor() { super(); } /** * Gets whether the series is an annotation layer displayed only when hovering over the chart. */ get isAnnotationHoverLayer() { return this.i.eu; } get isToolTipLayer() { return this.i.f8; } /** * Gets whether the default tooltip behaviors for the chart are disabled if this layer is present. */ get isDefaultTooltipBehaviorDisabled() { return this.i.e5; } /** * Gets or sets the name of the series series to target this annotation to. If null, this annotation targets all series simultaneously. */ get targetSeriesName() { return this.i.aa2; } set targetSeriesName(v) { this.i.aa2 = 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; } Object.defineProperty(r, 'externalObject', { value: e, enumerable: false, configurable: true, writable: true }); } 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 whether to use value interpolation when drawing the tooltips. */ get useInterpolation() { return this.i.aay; } set useInterpolation(v) { this.i.aay = ensureBool(v); } /** * Gets or sets whether to skip past unknown values when searching for series values. */ get skipUnknownValues() { return this.i.aax; } set skipUnknownValues(v) { this.i.aax = ensureBool(v); } /** * Gets or sets the background of the tooltip containers. */ get toolTipBackground() { return brushToString(this.i.abi); } set toolTipBackground(v) { this.i.abi = stringToBrush(v); } /** * Gets or sets the border color of the tooltip containers. */ get toolTipBorderBrush() { return brushToString(this.i.abj); } set toolTipBorderBrush(v) { this.i.abj = stringToBrush(v); } /** * Gets or sets the border thickness of the tooltip containers. */ get toolTipBorderThickness() { return this.i.aaz; } set toolTipBorderThickness(v) { this.i.aaz = +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; } /** * Hides any tooltips presented by the layer, if any. */ hideToolTips() { this.i.qn(); } /** * Hides any tooltips presented by the layer, if any. */ hideToolTipsImmediate() { this.i.qo(); } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0-rc.1", ngImport: i0, type: IgxItemToolTipLayerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); } static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.0-rc.1", type: IgxItemToolTipLayerComponent, isStandalone: true, selector: "igx-item-tool-tip-layer", inputs: { targetSeriesName: "targetSeriesName", targetSeries: "targetSeries", useInterpolation: "useInterpolation", skipUnknownValues: "skipUnknownValues", toolTipBackground: "toolTipBackground", toolTipBorderBrush: "toolTipBorderBrush", toolTipBorderThickness: "toolTipBorderThickness" }, providers: [{ provide: IgxAnnotationLayerComponent, useExisting: forwardRef(() => IgxItemToolTipLayerComponent) }, { provide: IgxSeriesComponent, useExisting: forwardRef(() => IgxItemToolTipLayerComponent) }], usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0-rc.1", ngImport: i0, type: IgxItemToolTipLayerComponent, decorators: [{ type: Component, args: [{ selector: 'igx-item-tool-tip-layer', template: ``, providers: [{ provide: IgxAnnotationLayerComponent, useExisting: forwardRef(() => IgxItemToolTipLayerComponent) }, { provide: IgxSeriesComponent, useExisting: forwardRef(() => IgxItemToolTipLayerComponent) }], changeDetection: ChangeDetectionStrategy.OnPush }] }], ctorParameters: () => [], propDecorators: { targetSeriesName: [{ type: Input }], targetSeries: [{ type: Input }], useInterpolation: [{ type: Input }], skipUnknownValues: [{ type: Input }], toolTipBackground: [{ type: Input }], toolTipBorderBrush: [{ type: Input }], toolTipBorderThickness: [{ type: Input }] } });