UNPKG

igniteui-webcomponents-charts

Version:

Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.

198 lines (196 loc) 7.43 kB
import { IgcAxisComponent } from "./igc-axis-component"; import { CategoryTooltipLayerPosition_$type } from "./CategoryTooltipLayerPosition"; import { IgcAnnotationLayerComponent } from "./igc-annotation-layer-component"; import { CategoryToolTipLayer } from "./CategoryToolTipLayer"; import { getAllPropertyNames, toSpinal, ensureBool, ensureEnum, enumToString, brushToString, stringToBrush } from "igniteui-webcomponents-core"; import { RegisterElementHelper } from "igniteui-webcomponents-core"; let IgcCategoryToolTipLayerComponent = /*@__PURE__*/ (() => { class IgcCategoryToolTipLayerComponent extends IgcAnnotationLayerComponent { createImplementation() { return new CategoryToolTipLayer(); } /** * @hidden */ get i() { return this._implementation; } constructor() { super(); this._targetAxisName = null; } connectedCallback() { if (super["connectedCallback"]) { super["connectedCallback"](); } if (this.i.connectedCallback) { this.i.connectedCallback(); } if (!this._attached) { this._attached = true; this._flushQueuedAttributes(); } } disconnectedCallback() { if (super["disconnectedCallback"]) { super["disconnectedCallback"](); } if (this.i.disconnectedCallback) { this.i.disconnectedCallback(); } if (this._attached) { this._attached = false; } } static get observedAttributes() { if (IgcCategoryToolTipLayerComponent._observedAttributesIgcCategoryToolTipLayerComponent == null) { let names = getAllPropertyNames(IgcCategoryToolTipLayerComponent); for (let i = 0; i < names.length; i++) { names[i] = toSpinal(names[i]); } IgcCategoryToolTipLayerComponent._observedAttributesIgcCategoryToolTipLayerComponent = names; } return IgcCategoryToolTipLayerComponent._observedAttributesIgcCategoryToolTipLayerComponent; } static register() { if (!IgcCategoryToolTipLayerComponent._isElementRegistered) { IgcCategoryToolTipLayerComponent._isElementRegistered = true; RegisterElementHelper.registerElement(IgcCategoryToolTipLayerComponent.htmlTagName, IgcCategoryToolTipLayerComponent); } } get isToolTipLayer() { return this.i.f7; } /** * Gets whether the series is an annotation layer displayed only when hovering over the chart. */ get isAnnotationHoverLayer() { return this.i.eu; } /** * 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 Axis to target this annotation to. If null, this annotation layer will not render content. */ get targetAxis() { const r = this.i.aas; if (r == null) { return null; } if (!r.externalObject) { let e = IgcAxisComponent._createFromInternal(r); if (e) { e._implementation = r; } r.externalObject = e; } return r.externalObject; } set targetAxis(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; } /** * Gets or sets the name to use to resolve targetAxis from markup. */ get targetAxisName() { return this._targetAxisName; } set targetAxisName(v) { this._targetAxisName = v; } /** * Gets or sets whether to use value interpolation when drawing the tooltips. */ get useInterpolation() { return this.i.aaw; } set useInterpolation(v) { this.i.aaw = ensureBool(v); this._a("useInterpolation", this.i.aaw); } /** * Gets or sets the Position to apply to the tooltip containers. */ get toolTipPosition() { return this.i.aat; } set toolTipPosition(v) { this.i.aat = ensureEnum(CategoryTooltipLayerPosition_$type, v); this._a("toolTipPosition", enumToString(CategoryTooltipLayerPosition_$type, this.i.aat)); } /** * Gets or sets the background of the tooltip containers. */ get toolTipBackground() { return brushToString(this.i.abc); } set toolTipBackground(v) { this.i.abc = stringToBrush(v); this._a("toolTipBackground", brushToString(this.i.abc)); } /** * Gets or sets the border color of the tooltip containers. */ get toolTipBorderBrush() { return brushToString(this.i.abd); } set toolTipBorderBrush(v) { this.i.abd = stringToBrush(v); this._a("toolTipBorderBrush", brushToString(this.i.abd)); } /** * Gets or sets the border thickness of the tooltip containers. */ get toolTipBorderThickness() { return this.i.aax; } set toolTipBorderThickness(v) { this.i.aax = +v; this._a("toolTipBorderThickness", this.i.aax); } bindAxes(axes) { super.bindAxes(axes); for (let i = 0; i < axes.length; i++) { if (this.targetAxisName && this.targetAxisName.length > 0 && axes[i].name == this.targetAxisName) { this.targetAxis = axes[i]; } } } findByName(name) { var baseResult = super.findByName(name); if (baseResult) { return baseResult; } if (this.targetAxis && this.targetAxis.name && this.targetAxis.name == name) { return this.targetAxis; } return null; } _styling(container, component, parent) { super._styling(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. */ hideToolTips() { this.i.ql(); } } IgcCategoryToolTipLayerComponent._observedAttributesIgcCategoryToolTipLayerComponent = null; IgcCategoryToolTipLayerComponent.htmlTagName = "igc-category-tool-tip-layer"; IgcCategoryToolTipLayerComponent._isElementRegistered = false; return IgcCategoryToolTipLayerComponent; })(); export { IgcCategoryToolTipLayerComponent };