import * as tslib_1 from "tslib";
import { IgrCategoryAngleAxis } from "./igr-category-angle-axis";
import { IgrNumericRadiusAxis } from "./igr-numeric-radius-axis";
import { IgrMarkerSeries } from "./igr-marker-series";
import { ensureBool, toPoint } from "igniteui-react-core";
/**
 * Represents the base class for all IgxDataChartComponent radial series
*/
var IgrRadialBase = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(IgrRadialBase, _super);
    function IgrRadialBase(props) {
        var _this = _super.call(this, props) || this;
        _this._angleAxisName = null;
        _this._valueAxisName = null;
        return _this;
    }
    Object.defineProperty(IgrRadialBase.prototype, "i", {
        /**
                                     * @hidden
                                     */
        get: function () {
            return this._implementation;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrRadialBase.prototype, "isRadial", {
        /**
         * Checks if this series is a radial series
        */
        get: function () {
            return this.i.c2;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrRadialBase.prototype, "angleAxis", {
        /**
         * Gets the effective angle axis for the current series object.
        */
        get: function () {
            if (this.i.nd == null) {
                return null;
            }
            if (!this.i.nd.externalObject) {
                var e = IgrCategoryAngleAxis._createFromInternal(this.i.nd);
                if (e) {
                    e._implementation = this.i.nd;
                }
                this.i.nd.externalObject = e;
            }
            return this.i.nd.externalObject;
        },
        set: function (v) {
            if (v != null && this._stylingContainer && v._styling)
                v._styling(this._stylingContainer, this, this);
            v == null ? this.i.nd = null : this.i.nd = v.i;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrRadialBase.prototype, "angleAxisName", {
        /**
        * Gets or sets the name to use to resolve angleAxis from markup.
        */
        get: function () {
            return this._angleAxisName;
        },
        set: function (v) {
            this._angleAxisName = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrRadialBase.prototype, "valueAxis", {
        /**
         * Gets the effective value axis for the current series object.
        */
        get: function () {
            if (this.i.nf == null) {
                return null;
            }
            if (!this.i.nf.externalObject) {
                var e = IgrNumericRadiusAxis._createFromInternal(this.i.nf);
                if (e) {
                    e._implementation = this.i.nf;
                }
                this.i.nf.externalObject = e;
            }
            return this.i.nf.externalObject;
        },
        set: function (v) {
            if (v != null && this._stylingContainer && v._styling)
                v._styling(this._stylingContainer, this, this);
            v == null ? this.i.nf = null : this.i.nf = v.i;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrRadialBase.prototype, "valueAxisName", {
        /**
        * Gets or sets the name to use to resolve valueAxis from markup.
        */
        get: function () {
            return this._valueAxisName;
        },
        set: function (v) {
            this._valueAxisName = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrRadialBase.prototype, "clipSeriesToBounds", {
        /**
         * Gets or sets whether to clip the series to the bounds.
         * Setting this property to true will decrease chart performance.
        */
        get: function () {
            return this.i.no;
        },
        set: function (v) {
            this.i.no = ensureBool(v);
        },
        enumerable: true,
        configurable: true
    });
    IgrRadialBase.prototype.bindAxes = function (axes) {
        _super.prototype.bindAxes.call(this, axes);
        for (var i = 0; i < axes.length; i++) {
            if (this.angleAxisName && this.angleAxisName.length > 0 &&
                axes[i].name == this.angleAxisName) {
                this.angleAxis = axes[i];
            }
        }
        for (var i = 0; i < axes.length; i++) {
            if (this.valueAxisName && this.valueAxisName.length > 0 &&
                axes[i].name == this.valueAxisName) {
                this.valueAxis = axes[i];
            }
        }
    };
    IgrRadialBase.prototype.findByName = function (name) {
        var baseResult = _super.prototype.findByName.call(this, name);
        if (baseResult) {
            return baseResult;
        }
        if (this.angleAxis && this.angleAxis.name && this.angleAxis.name == name) {
            return this.angleAxis;
        }
        if (this.valueAxis && this.valueAxis.name && this.valueAxis.name == name) {
            return this.valueAxis;
        }
        return null;
    };
    IgrRadialBase.prototype._styling = function (container, component, parent) {
        _super.prototype._styling.call(this, container, component, parent);
        this._inStyling = true;
        if (this.angleAxis && this.angleAxis._styling) {
            this.angleAxis._styling(container, component, this);
        }
        if (this.valueAxis && this.valueAxis._styling) {
            this.valueAxis._styling(container, component, this);
        }
        this._inStyling = false;
    };
    /**
     * Determine if object can be used as ValueAxis
    
    * @param axis  * The object to check
    */
    IgrRadialBase.prototype.canUseAsValueAxis = function (axis) {
        var iv = this.i.nn(axis);
        return (iv);
    };
    /**
     * Determine if object can be used as AngleAxis
    
    * @param axis  * The object to check
    */
    IgrRadialBase.prototype.canUseAsAngleAxis = function (axis) {
        var iv = this.i.nm(axis);
        return (iv);
    };
    /**
     * Gets the item that is the best match for the specified world coordinates.
    
    * @param world  * The world coordinates to use.
    */
    IgrRadialBase.prototype.getItem = function (world) {
        var iv = this.i.fp(toPoint(world));
        return (iv);
    };
    /**
     * Gets the angle to the provided world position from the center of the radial series.
    
    * @param world  * The world position to get the angle for
    */
    IgrRadialBase.prototype.getAngleFromWorld = function (world) {
        var iv = this.i.nq(toPoint(world));
        return (iv);
    };
    /**
     * Gets the precise item index, if possible, based on the closeness to the previous or next whole integer. If the series cannot provide this information, GetExactItemIndex will return the same integer value as GetItemIndex.
    
    * @param world  * The world position for which to return the index.
    */
    IgrRadialBase.prototype.getExactItemIndex = function (world) {
        var iv = this.i.eb(toPoint(world));
        return (iv);
    };
    /**
     * Get the index of the item near the provided world coordinates.
    
    * @param world  * The world coordinates for which to getch the item index.
    */
    IgrRadialBase.prototype.getItemIndex = function (world) {
        var iv = this.i.e8(toPoint(world));
        return (iv);
    };
    /**
     * Scrolls the specified item into the view.
    
    * @param item  * The item to scroll into view.
    */
    IgrRadialBase.prototype.scrollIntoView = function (item) {
        var iv = this.i.c9(item);
        return (iv);
    };
    /**
     * Returns the offset value for this series if grouped on a category axis.
    
    */
    IgrRadialBase.prototype.getOffsetValue = function () {
        var iv = this.i.getOffsetValue();
        return (iv);
    };
    /**
     * Returns the width of the category grouping this series is in.
    
    */
    IgrRadialBase.prototype.getCategoryWidth = function () {
        var iv = this.i.getCategoryWidth();
        return (iv);
    };
    return IgrRadialBase;
}(IgrMarkerSeries));
export { IgrRadialBase };
//# sourceMappingURL=igr-radial-base.js.map
