UNPKG

igniteui-webcomponents-charts

Version:

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

561 lines (560 loc) 21.4 kB
import { __extends } from "tslib"; import { IgcSeriesComponent } from "./igc-series-component"; import { Visibility_$type } from "igniteui-webcomponents-core"; import { IgcAnnotationLayerComponent } from "./igc-annotation-layer-component"; import { CrosshairLayer } from "./CrosshairLayer"; import { getAllPropertyNames, toSpinal, ensureBool, brushToString, stringToBrush, ensureEnum, enumToString } from "igniteui-webcomponents-core"; import { RegisterElementHelper } from "igniteui-webcomponents-core"; /** * Represents an annotation layer that displays crosshair lines that cross through the closest value of the target series under the cursor. */ var IgcCrosshairLayerComponent = /** @class */ /*@__PURE__*/ (function (_super) { __extends(IgcCrosshairLayerComponent, _super); function IgcCrosshairLayerComponent() { return _super.call(this) || this; } IgcCrosshairLayerComponent.prototype.createImplementation = function () { return new CrosshairLayer(); }; Object.defineProperty(IgcCrosshairLayerComponent.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; }, enumerable: false, configurable: true }); IgcCrosshairLayerComponent.prototype.connectedCallback = function () { if (_super.prototype["connectedCallback"]) { _super.prototype["connectedCallback"].call(this); } if (this.i.connectedCallback) { this.i.connectedCallback(); } if (!this._attached) { this._attached = true; this._flushQueuedAttributes(); } }; IgcCrosshairLayerComponent.prototype.disconnectedCallback = function () { if (_super.prototype["disconnectedCallback"]) { _super.prototype["disconnectedCallback"].call(this); } if (this.i.disconnectedCallback) { this.i.disconnectedCallback(); } if (this._attached) { this._attached = false; } }; Object.defineProperty(IgcCrosshairLayerComponent, "observedAttributes", { get: function () { if (IgcCrosshairLayerComponent._observedAttributesIgcCrosshairLayerComponent == null) { var names = getAllPropertyNames(IgcCrosshairLayerComponent); for (var i = 0; i < names.length; i++) { names[i] = toSpinal(names[i]); } IgcCrosshairLayerComponent._observedAttributesIgcCrosshairLayerComponent = names; } return IgcCrosshairLayerComponent._observedAttributesIgcCrosshairLayerComponent; }, enumerable: false, configurable: true }); IgcCrosshairLayerComponent.register = function () { if (!IgcCrosshairLayerComponent._isElementRegistered) { IgcCrosshairLayerComponent._isElementRegistered = true; RegisterElementHelper.registerElement(IgcCrosshairLayerComponent.htmlTagName, IgcCrosshairLayerComponent); } }; Object.defineProperty(IgcCrosshairLayerComponent.prototype, "isAnnotationHoverLayer", { /** * Gets whether the series is an annotation layer displayed only when hovering over the chart. */ get: function () { return this.i.et; }, enumerable: false, configurable: true }); Object.defineProperty(IgcCrosshairLayerComponent.prototype, "isAnnotationCrosshairLayer", { /** * Gets whether the series is an crosshair annotation layer. */ get: function () { return this.i.er; }, enumerable: false, configurable: true }); Object.defineProperty(IgcCrosshairLayerComponent.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.acv); }, set: function (v) { this.i.acv = stringToBrush(v); this._a("horizontalLineStroke", brushToString(this.i.acv)); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCrosshairLayerComponent.prototype, "verticalLineStroke", { /** * Gets or sets the color to use for vertical line. Leave null for an automatic value. */ get: function () { return brushToString(this.i.acw); }, set: function (v) { this.i.acw = stringToBrush(v); this._a("verticalLineStroke", brushToString(this.i.acw)); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCrosshairLayerComponent.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.aa7; }, set: function (v) { this.i.aa7 = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgcCrosshairLayerComponent.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.aad; if (r == null) { return null; } if (!r.externalObject) { var e = IgcSeriesComponent._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.aad = null : this.i.aad = v.i; }, enumerable: false, configurable: true }); Object.defineProperty(IgcCrosshairLayerComponent.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.aak; }, set: function (v) { this.i.aak = ensureBool(v); this._a("useInterpolation", this.i.aak); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCrosshairLayerComponent.prototype, "isAxisAnnotationEnabled", { /** * Gets or sets whether to draw annotations over the axes where the crosshair meets with them. */ get: function () { return this.i.aag; }, set: function (v) { this.i.aag = ensureBool(v); this._a("isAxisAnnotationEnabled", this.i.aag); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCrosshairLayerComponent.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.acz); }, set: function (v) { this.i.acz = stringToBrush(v); this._a("xAxisAnnotationTextColor", brushToString(this.i.acz)); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCrosshairLayerComponent.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.acx); }, set: function (v) { this.i.acx = stringToBrush(v); this._a("xAxisAnnotationBackground", brushToString(this.i.acx)); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCrosshairLayerComponent.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.aan; }, set: function (v) { this.i.aan = +v; this._a("xAxisAnnotationBackgroundCornerRadius", this.i.aan); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCrosshairLayerComponent.prototype, "xAxisAnnotationInterpolatedValuePrecision", { /** * Gets or sets the precision to use displaying values for interpolated crosshair positions. */ get: function () { return this.i.aaz; }, set: function (v) { this.i.aaz = +v; this._a("xAxisAnnotationInterpolatedValuePrecision", this.i.aaz); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCrosshairLayerComponent.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.acy); }, set: function (v) { this.i.acy = stringToBrush(v); this._a("xAxisAnnotationOutline", brushToString(this.i.acy)); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCrosshairLayerComponent.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.aap; }, set: function (v) { this.i.aap = +v; this._a("xAxisAnnotationPaddingLeft", this.i.aap); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCrosshairLayerComponent.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.aar; }, set: function (v) { this.i.aar = +v; this._a("xAxisAnnotationPaddingTop", this.i.aar); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCrosshairLayerComponent.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.aaq; }, set: function (v) { this.i.aaq = +v; this._a("xAxisAnnotationPaddingRight", this.i.aaq); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCrosshairLayerComponent.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.aao; }, set: function (v) { this.i.aao = +v; this._a("xAxisAnnotationPaddingBottom", this.i.aao); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCrosshairLayerComponent.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.aav; }, set: function (v) { this.i.aav = +v; this._a("yAxisAnnotationPaddingLeft", this.i.aav); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCrosshairLayerComponent.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.aax; }, set: function (v) { this.i.aax = +v; this._a("yAxisAnnotationPaddingTop", this.i.aax); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCrosshairLayerComponent.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.aaw; }, set: function (v) { this.i.aaw = +v; this._a("yAxisAnnotationPaddingRight", this.i.aaw); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCrosshairLayerComponent.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.aau; }, set: function (v) { this.i.aau = +v; this._a("yAxisAnnotationPaddingBottom", this.i.aau); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCrosshairLayerComponent.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.aas; }, set: function (v) { this.i.aas = +v; this._a("xAxisAnnotationStrokeThickness", this.i.aas); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCrosshairLayerComponent.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.ac2); }, set: function (v) { this.i.ac2 = stringToBrush(v); this._a("yAxisAnnotationTextColor", brushToString(this.i.ac2)); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCrosshairLayerComponent.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.ac0); }, set: function (v) { this.i.ac0 = stringToBrush(v); this._a("yAxisAnnotationBackground", brushToString(this.i.ac0)); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCrosshairLayerComponent.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.aat; }, set: function (v) { this.i.aat = +v; this._a("yAxisAnnotationBackgroundCornerRadius", this.i.aat); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCrosshairLayerComponent.prototype, "yAxisAnnotationInterpolatedValuePrecision", { /** * Gets or sets the precision to use displaying values for interpolated crosshair positions. */ get: function () { return this.i.aa0; }, set: function (v) { this.i.aa0 = +v; this._a("yAxisAnnotationInterpolatedValuePrecision", this.i.aa0); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCrosshairLayerComponent.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.ac1); }, set: function (v) { this.i.ac1 = stringToBrush(v); this._a("yAxisAnnotationOutline", brushToString(this.i.ac1)); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCrosshairLayerComponent.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.aay; }, set: function (v) { this.i.aay = +v; this._a("yAxisAnnotationStrokeThickness", this.i.aay); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCrosshairLayerComponent.prototype, "verticalLineVisibility", { /** * Gets or sets whether to display the vertical line. */ get: function () { return this.i.ac8; }, set: function (v) { this.i.ac8 = ensureEnum(Visibility_$type, v); this._a("verticalLineVisibility", enumToString(Visibility_$type, this.i.ac8)); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCrosshairLayerComponent.prototype, "horizontalLineVisibility", { /** * Gets or sets whether to display the horizontal line. */ get: function () { return this.i.ac7; }, set: function (v) { this.i.ac7 = ensureEnum(Visibility_$type, v); this._a("horizontalLineVisibility", enumToString(Visibility_$type, this.i.ac7)); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCrosshairLayerComponent.prototype, "skipUnknownValues", { /** * Gets or sets whether to skip unknown values when searching for series values. */ get: function () { return this.i.aaj; }, set: function (v) { this.i.aaj = ensureBool(v); this._a("skipUnknownValues", this.i.aaj); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCrosshairLayerComponent.prototype, "skipAxisAnnotationOnZeroValueFragments", { /** * Gets or sets whether axis annotation are skipped for zero-value fragments in a given position. */ get: function () { return this.i.aai; }, set: function (v) { this.i.aai = ensureBool(v); this._a("skipAxisAnnotationOnZeroValueFragments", this.i.aai); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCrosshairLayerComponent.prototype, "skipAxisAnnotationOnInvalidData", { /** * Gets or sets whether axis annotation are skipped for invalid data in a given position. */ get: function () { return this.i.aah; }, set: function (v) { this.i.aah = ensureBool(v); this._a("skipAxisAnnotationOnInvalidData", this.i.aah); }, enumerable: false, configurable: true }); IgcCrosshairLayerComponent.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; } return null; }; IgcCrosshairLayerComponent.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); } this._inStyling = false; }; IgcCrosshairLayerComponent._observedAttributesIgcCrosshairLayerComponent = null; IgcCrosshairLayerComponent.htmlTagName = "igc-crosshair-layer"; IgcCrosshairLayerComponent._isElementRegistered = false; return IgcCrosshairLayerComponent; }(IgcAnnotationLayerComponent)); export { IgcCrosshairLayerComponent };