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
*/
export class IgrRadialBase extends IgrMarkerSeries {
    constructor(props) {
        super(props);
        this._angleAxisName = null;
        this._valueAxisName = null;
    }
    /**
                                 * @hidden
                                 */
    get i() {
        return this._implementation;
    }
    /**
     * Checks if this series is a radial series
    */
    get isRadial() {
        return this.i.c2;
    }
    /**
     * Gets the effective angle axis for the current series object.
    */
    get angleAxis() {
        if (this.i.nd == null) {
            return null;
        }
        if (!this.i.nd.externalObject) {
            let e = IgrCategoryAngleAxis._createFromInternal(this.i.nd);
            if (e) {
                e._implementation = this.i.nd;
            }
            this.i.nd.externalObject = e;
        }
        return this.i.nd.externalObject;
    }
    set angleAxis(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;
    }
    /**
    * Gets or sets the name to use to resolve angleAxis from markup.
    */
    get angleAxisName() {
        return this._angleAxisName;
    }
    set angleAxisName(v) {
        this._angleAxisName = v;
    }
    /**
     * Gets the effective value axis for the current series object.
    */
    get valueAxis() {
        if (this.i.nf == null) {
            return null;
        }
        if (!this.i.nf.externalObject) {
            let e = IgrNumericRadiusAxis._createFromInternal(this.i.nf);
            if (e) {
                e._implementation = this.i.nf;
            }
            this.i.nf.externalObject = e;
        }
        return this.i.nf.externalObject;
    }
    set valueAxis(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;
    }
    /**
    * Gets or sets the name to use to resolve valueAxis from markup.
    */
    get valueAxisName() {
        return this._valueAxisName;
    }
    set valueAxisName(v) {
        this._valueAxisName = v;
    }
    /**
     * Gets or sets whether to clip the series to the bounds.
     * Setting this property to true will decrease chart performance.
    */
    get clipSeriesToBounds() {
        return this.i.no;
    }
    set clipSeriesToBounds(v) {
        this.i.no = ensureBool(v);
    }
    bindAxes(axes) {
        super.bindAxes(axes);
        for (let i = 0; i < axes.length; i++) {
            if (this.angleAxisName && this.angleAxisName.length > 0 &&
                axes[i].name == this.angleAxisName) {
                this.angleAxis = axes[i];
            }
        }
        for (let i = 0; i < axes.length; i++) {
            if (this.valueAxisName && this.valueAxisName.length > 0 &&
                axes[i].name == this.valueAxisName) {
                this.valueAxis = axes[i];
            }
        }
    }
    findByName(name) {
        var baseResult = super.findByName(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;
    }
    _styling(container, component, parent) {
        super._styling(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
    */
    canUseAsValueAxis(axis) {
        let iv = this.i.nn(axis);
        return (iv);
    }
    /**
     * Determine if object can be used as AngleAxis
    
    * @param axis  * The object to check
    */
    canUseAsAngleAxis(axis) {
        let 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.
    */
    getItem(world) {
        let 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
    */
    getAngleFromWorld(world) {
        let 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.
    */
    getExactItemIndex(world) {
        let 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.
    */
    getItemIndex(world) {
        let iv = this.i.e8(toPoint(world));
        return (iv);
    }
    /**
     * Scrolls the specified item into the view.
    
    * @param item  * The item to scroll into view.
    */
    scrollIntoView(item) {
        let iv = this.i.c9(item);
        return (iv);
    }
    /**
     * Returns the offset value for this series if grouped on a category axis.
    
    */
    getOffsetValue() {
        let iv = this.i.getOffsetValue();
        return (iv);
    }
    /**
     * Returns the width of the category grouping this series is in.
    
    */
    getCategoryWidth() {
        let iv = this.i.getCategoryWidth();
        return (iv);
    }
}
//# sourceMappingURL=igr-radial-base.js.map
