import * as tslib_1 from "tslib";
import { IgrSeries } from "./igr-series";
import { Visibility_$type } from "igniteui-react-core";
import { IgrAnnotationLayer } from "./igr-annotation-layer";
import { CrosshairLayer } from "./CrosshairLayer";
import { brushToString, stringToBrush, ensureBool, ensureEnum } from "igniteui-react-core";
/**
 * Represents an annotation layer that displays crosshair lines that cross through the closest value of the target series under the cursor.
*/
var IgrCrosshairLayer = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(IgrCrosshairLayer, _super);
    function IgrCrosshairLayer(props) {
        return _super.call(this, props) || this;
    }
    IgrCrosshairLayer.prototype.createImplementation = function () {
        return new CrosshairLayer();
    };
    Object.defineProperty(IgrCrosshairLayer.prototype, "i", {
        /**
                                     * @hidden
                                     */
        get: function () {
            return this._implementation;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.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.pk);
        },
        set: function (v) {
            this.i.pk = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "verticalLineStroke", {
        /**
         * Gets or sets the color to use for vertical line. Leave null for an automatic value.
        */
        get: function () {
            return brushToString(this.i.pl);
        },
        set: function (v) {
            this.i.pl = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "targetSeries", {
        /**
         * Gets or sets the series to target this annotation to. If null, this annotation targets all series simultaneously.
        */
        get: function () {
            if (this.i.nh == null) {
                return null;
            }
            if (!this.i.nh.externalObject) {
                var e = IgrSeries._createFromInternal(this.i.nh);
                if (e) {
                    e._implementation = this.i.nh;
                }
                this.i.nh.externalObject = e;
            }
            return this.i.nh.externalObject;
        },
        set: function (v) {
            if (v != null && this._stylingContainer && v._styling)
                v._styling(this._stylingContainer, this, this);
            v == null ? this.i.nh = null : this.i.nh = v.i;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.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.nm;
        },
        set: function (v) {
            this.i.nm = ensureBool(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "isAxisAnnotationEnabled", {
        /**
         * Gets or sets whether to draw annotations over the axes where the crosshair meets with them.
        */
        get: function () {
            return this.i.nk;
        },
        set: function (v) {
            this.i.nk = ensureBool(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.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.po);
        },
        set: function (v) {
            this.i.po = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.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.pm);
        },
        set: function (v) {
            this.i.pm = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "xAxisAnnotationInterpolatedValuePrecision", {
        /**
         * Gets or sets the precision to use displaying values for interpolated crosshair positions.
        */
        get: function () {
            return this.i.nz;
        },
        set: function (v) {
            this.i.nz = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.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.pn);
        },
        set: function (v) {
            this.i.pn = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.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.nq;
        },
        set: function (v) {
            this.i.nq = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.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.ns;
        },
        set: function (v) {
            this.i.ns = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.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.nr;
        },
        set: function (v) {
            this.i.nr = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.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.np;
        },
        set: function (v) {
            this.i.np = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.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.nv;
        },
        set: function (v) {
            this.i.nv = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.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.nx;
        },
        set: function (v) {
            this.i.nx = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.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.nw;
        },
        set: function (v) {
            this.i.nw = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.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.nu;
        },
        set: function (v) {
            this.i.nu = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.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.nt;
        },
        set: function (v) {
            this.i.nt = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.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.pr);
        },
        set: function (v) {
            this.i.pr = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.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.pp);
        },
        set: function (v) {
            this.i.pp = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "yAxisAnnotationInterpolatedValuePrecision", {
        /**
         * Gets or sets the precision to use displaying values for interpolated crosshair positions.
        */
        get: function () {
            return this.i.n0;
        },
        set: function (v) {
            this.i.n0 = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.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.pq);
        },
        set: function (v) {
            this.i.pq = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.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.ny;
        },
        set: function (v) {
            this.i.ny = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "verticalLineVisibility", {
        /**
         * Gets or sets whether to display the vertical line.
        */
        get: function () {
            return this.i.pv;
        },
        set: function (v) {
            this.i.pv = ensureEnum(Visibility_$type, v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "horizontalLineVisibility", {
        /**
         * Gets or sets whether to display the horizontal line.
        */
        get: function () {
            return this.i.pu;
        },
        set: function (v) {
            this.i.pu = ensureEnum(Visibility_$type, v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCrosshairLayer.prototype, "skipUnknownValues", {
        /**
         * Gets or sets whether to skip unknown values when searching for series values.
        */
        get: function () {
            return this.i.nl;
        },
        set: function (v) {
            this.i.nl = ensureBool(v);
        },
        enumerable: true,
        configurable: true
    });
    IgrCrosshairLayer.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;
    };
    IgrCrosshairLayer.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;
    };
    return IgrCrosshairLayer;
}(IgrAnnotationLayer));
export { IgrCrosshairLayer };
//# sourceMappingURL=igr-crosshair-layer.js.map
