import { __extends } from "tslib";
import { IgrAxis } from "./igr-axis";
import { IgrSeries } from "./igr-series";
import { ValueOverlay } from "./ValueOverlay";
import { ensureBool, brushToString, stringToBrush, toPoint, fromPoint } from "igniteui-react-core";
/**
 * Represents the class of the value overlay. The value overlay is a line or circle representing a value on an axis.
*/
var IgrValueOverlay = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(IgrValueOverlay, _super);
    function IgrValueOverlay(props) {
        var _this = _super.call(this, props) || this;
        _this._axisName = null;
        return _this;
    }
    IgrValueOverlay.prototype.createImplementation = function () {
        return new ValueOverlay();
    };
    Object.defineProperty(IgrValueOverlay.prototype, "i", {
        /**
                                     * @hidden
                                     */
        get: function () {
            return this._implementation;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueOverlay.prototype, "axis", {
        /**
         * Gets or sets the axis used by the value overlay.
        */
        get: function () {
            var r = this.i.t3;
            if (r == null) {
                return null;
            }
            if (!r.externalObject) {
                var e = IgrAxis._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.t3 = null : this.i.t3 = v.i;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueOverlay.prototype, "axisName", {
        /**
        * Gets or sets the name to use to resolve axis from markup.
        */
        get: function () {
            return this._axisName;
        },
        set: function (v) {
            this._axisName = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueOverlay.prototype, "value", {
        /**
         * Gets or sets the value of the overlay.
        */
        get: function () {
            return this.i.um;
        },
        set: function (v) {
            this.i.um = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueOverlay.prototype, "isAxisAnnotationEnabled", {
        /**
         * Gets or sets whether to draw annotations over the axes where the crosshair meets with them.
        */
        get: function () {
            return this.i.t7;
        },
        set: function (v) {
            this.i.t7 = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueOverlay.prototype, "axisAnnotationFormatLabel", {
        /**
         * Sets or gets a function which takes an object that produces a formatted label for the axis annotation.
        */
        get: function () {
            return this.i.t5;
        },
        set: function (v) {
            this.i.t5 = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueOverlay.prototype, "axisAnnotationTextColor", {
        /**
         * Gets or sets the color to use for the axis annotation text. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.vm);
        },
        set: function (v) {
            this.i.vm = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueOverlay.prototype, "axisAnnotationBackground", {
        /**
         * Gets or sets the color to use for the axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.vk);
        },
        set: function (v) {
            this.i.vk = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueOverlay.prototype, "axisAnnotationBackgroundCornerRadius", {
        /**
         * Gets or sets the corner radius to use for the axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return this.i.ub;
        },
        set: function (v) {
            this.i.ub = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueOverlay.prototype, "axisAnnotationInterpolatedValuePrecision", {
        /**
         * Gets or sets the precision to use displaying values for interpolated positions.
        */
        get: function () {
            return this.i.un;
        },
        set: function (v) {
            this.i.un = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueOverlay.prototype, "axisAnnotationOutline", {
        /**
         * Gets or sets the color to use for the axis annotation outline. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.vl);
        },
        set: function (v) {
            this.i.vl = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueOverlay.prototype, "axisAnnotationPaddingLeft", {
        /**
         * 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.ud;
        },
        set: function (v) {
            this.i.ud = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueOverlay.prototype, "axisAnnotationPaddingTop", {
        /**
         * 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.uf;
        },
        set: function (v) {
            this.i.uf = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueOverlay.prototype, "axisAnnotationPaddingRight", {
        /**
         * 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.ue;
        },
        set: function (v) {
            this.i.ue = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueOverlay.prototype, "axisAnnotationPaddingBottom", {
        /**
         * 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.uc;
        },
        set: function (v) {
            this.i.uc = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueOverlay.prototype, "axisAnnotationStrokeThickness", {
        /**
         * Gets or sets the stroke thickness for the axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return this.i.ug;
        },
        set: function (v) {
            this.i.ug = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueOverlay.prototype, "isValueOverlay", {
        /**
         * Gets whether the series is a value overlay.
        */
        get: function () {
            return this.i.isValueOverlay;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueOverlay.prototype, "labelResolved", {
        get: function () {
            return this.i.u2;
        },
        enumerable: false,
        configurable: true
    });
    IgrValueOverlay.prototype.bindAxes = function (axes) {
        _super.prototype.bindAxes.call(this, axes);
        for (var i = 0; i < axes.length; i++) {
            if (this.axisName && this.axisName.length > 0 &&
                axes[i].name == this.axisName) {
                this.axis = axes[i];
            }
        }
    };
    IgrValueOverlay.prototype.findByName = function (name) {
        var baseResult = _super.prototype.findByName.call(this, name);
        if (baseResult) {
            return baseResult;
        }
        if (this.axis && this.axis.name && this.axis.name == name) {
            return this.axis;
        }
        return null;
    };
    IgrValueOverlay.prototype._styling = function (container, component, parent) {
        _super.prototype._styling.call(this, container, component, parent);
        this._inStyling = true;
        if (this.axis && this.axis._styling) {
            this.axis._styling(container, component, this);
        }
        this._inStyling = false;
    };
    IgrValueOverlay.prototype.getSeriesValue = function (world, useInterpolation, skipUnknowns) {
        var iv = this.i.ia(toPoint(world), useInterpolation, skipUnknowns);
        return (iv);
    };
    IgrValueOverlay.prototype.getSeriesValuePosition = function (world, useInterpolation, skipUnknowns) {
        var iv = this.i.tj(toPoint(world), useInterpolation, skipUnknowns);
        return fromPoint(iv);
    };
    /**
     * Gets the item index associated with the specified world position
    
    * @param world
    */
    IgrValueOverlay.prototype.getItemIndex = function (world) {
        var iv = this.i.i9(toPoint(world));
        return (iv);
    };
    /**
     * Gets the item that is the best match for the specified world coordinates.
    
    * @param world  * The world coordinates to use.
    */
    IgrValueOverlay.prototype.getItem = function (world) {
        var iv = this.i.js(toPoint(world));
        return (iv);
    };
    /**
     * Requests that the provided item should be brought into view if possible.
    
    * @param item  * The item to attempt to bring into view.
    */
    IgrValueOverlay.prototype.scrollIntoView = function (item) {
        var iv = this.i.fp(item);
        return (iv);
    };
    /**
     * Gets the label for a data item.
    
    * @param value  * The unscaled value to get a label for.
    */
    IgrValueOverlay.prototype.getLabel = function (value) {
        var iv = this.i.u0(value);
        return (iv);
    };
    return IgrValueOverlay;
}(IgrSeries));
export { IgrValueOverlay };
