UNPKG

igniteui-webcomponents-charts

Version:

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

560 lines (559 loc) 21.3 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. */ export 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.eu; }, 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.add); }, set: function (v) { this.i.add = stringToBrush(v); this._a("horizontalLineStroke", brushToString(this.i.add)); }, 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.ade); }, set: function (v) { this.i.ade = stringToBrush(v); this._a("verticalLineStroke", brushToString(this.i.ade)); }, 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.abp; }, set: function (v) { this.i.abp = 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.aav; 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.aav = null : this.i.aav = 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.aa2; }, set: function (v) { this.i.aa2 = ensureBool(v); this._a("useInterpolation", this.i.aa2); }, 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.aay; }, set: function (v) { this.i.aay = ensureBool(v); this._a("isAxisAnnotationEnabled", this.i.aay); }, 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.adh); }, set: function (v) { this.i.adh = stringToBrush(v); this._a("xAxisAnnotationTextColor", brushToString(this.i.adh)); }, 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.adf); }, set: function (v) { this.i.adf = stringToBrush(v); this._a("xAxisAnnotationBackground", brushToString(this.i.adf)); }, 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.aa5; }, set: function (v) { this.i.aa5 = +v; this._a("xAxisAnnotationBackgroundCornerRadius", this.i.aa5); }, 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.abh; }, set: function (v) { this.i.abh = +v; this._a("xAxisAnnotationInterpolatedValuePrecision", this.i.abh); }, 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.adg); }, set: function (v) { this.i.adg = stringToBrush(v); this._a("xAxisAnnotationOutline", brushToString(this.i.adg)); }, 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.aa7; }, set: function (v) { this.i.aa7 = +v; this._a("xAxisAnnotationPaddingLeft", this.i.aa7); }, 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.aa9; }, set: function (v) { this.i.aa9 = +v; this._a("xAxisAnnotationPaddingTop", this.i.aa9); }, 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.aa8; }, set: function (v) { this.i.aa8 = +v; this._a("xAxisAnnotationPaddingRight", this.i.aa8); }, 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.aa6; }, set: function (v) { this.i.aa6 = +v; this._a("xAxisAnnotationPaddingBottom", this.i.aa6); }, 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.abd; }, set: function (v) { this.i.abd = +v; this._a("yAxisAnnotationPaddingLeft", this.i.abd); }, 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.abf; }, set: function (v) { this.i.abf = +v; this._a("yAxisAnnotationPaddingTop", this.i.abf); }, 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.abe; }, set: function (v) { this.i.abe = +v; this._a("yAxisAnnotationPaddingRight", this.i.abe); }, 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.abc; }, set: function (v) { this.i.abc = +v; this._a("yAxisAnnotationPaddingBottom", this.i.abc); }, 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.aba; }, set: function (v) { this.i.aba = +v; this._a("xAxisAnnotationStrokeThickness", this.i.aba); }, 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.adk); }, set: function (v) { this.i.adk = stringToBrush(v); this._a("yAxisAnnotationTextColor", brushToString(this.i.adk)); }, 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.adi); }, set: function (v) { this.i.adi = stringToBrush(v); this._a("yAxisAnnotationBackground", brushToString(this.i.adi)); }, 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.abb; }, set: function (v) { this.i.abb = +v; this._a("yAxisAnnotationBackgroundCornerRadius", this.i.abb); }, 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.abi; }, set: function (v) { this.i.abi = +v; this._a("yAxisAnnotationInterpolatedValuePrecision", this.i.abi); }, 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.adj); }, set: function (v) { this.i.adj = stringToBrush(v); this._a("yAxisAnnotationOutline", brushToString(this.i.adj)); }, 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.abg; }, set: function (v) { this.i.abg = +v; this._a("yAxisAnnotationStrokeThickness", this.i.abg); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCrosshairLayerComponent.prototype, "verticalLineVisibility", { /** * Gets or sets whether to display the vertical line. */ get: function () { return this.i.adq; }, set: function (v) { this.i.adq = ensureEnum(Visibility_$type, v); this._a("verticalLineVisibility", enumToString(Visibility_$type, this.i.adq)); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCrosshairLayerComponent.prototype, "horizontalLineVisibility", { /** * Gets or sets whether to display the horizontal line. */ get: function () { return this.i.adp; }, set: function (v) { this.i.adp = ensureEnum(Visibility_$type, v); this._a("horizontalLineVisibility", enumToString(Visibility_$type, this.i.adp)); }, 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.aa1; }, set: function (v) { this.i.aa1 = ensureBool(v); this._a("skipUnknownValues", this.i.aa1); }, 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.aa0; }, set: function (v) { this.i.aa0 = ensureBool(v); this._a("skipAxisAnnotationOnZeroValueFragments", this.i.aa0); }, 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.aaz; }, set: function (v) { this.i.aaz = ensureBool(v); this._a("skipAxisAnnotationOnInvalidData", this.i.aaz); }, 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));