import { IgrNumericAngleAxis } from "./igr-numeric-angle-axis";
import { IgrNumericRadiusAxis } from "./igr-numeric-radius-axis";
import { TrendLineType_$type } from "igniteui-react-core";
import { IgrMarkerSeries } from "./igr-marker-series";
import { ensureBool, ensureEnum, brushToString, stringToBrush, toPoint } from "igniteui-react-core";
/**
 * Represents the base class from which all IgxDataChartComponent polar series are derived.
*/
export class IgrPolarBase extends IgrMarkerSeries {
    constructor(props) {
        super(props);
        this._angleAxisName = null;
        this._radiusAxisName = null;
    }
    /**
                                 * @hidden
                                 */
    get i() {
        return this._implementation;
    }
    /**
     * Checks if this series is a polar series
    */
    get isPolar() {
        return this.i.c0;
    }
    /**
     * Gets or sets the path to use to find the angle values for the series.
    */
    get angleMemberPath() {
        return this.i.n9;
    }
    set angleMemberPath(v) {
        this.i.n9 = v;
    }
    /**
     * Gets or sets the path to use to get the radius values for the series.
    */
    get radiusMemberPath() {
        return this.i.of;
    }
    set radiusMemberPath(v) {
        this.i.of = v;
    }
    /**
     * Gets the effective angle axis for the current series object.
    */
    get angleAxis() {
        if (this.i.ng == null) {
            return null;
        }
        if (!this.i.ng.externalObject) {
            let e = IgrNumericAngleAxis._createFromInternal(this.i.ng);
            if (e) {
                e._implementation = this.i.ng;
            }
            this.i.ng.externalObject = e;
        }
        return this.i.ng.externalObject;
    }
    set angleAxis(v) {
        if (v != null && this._stylingContainer && v._styling)
            v._styling(this._stylingContainer, this, this);
        v == null ? this.i.ng = null : this.i.ng = 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 radius axis for the current series object.
    */
    get radiusAxis() {
        if (this.i.nh == null) {
            return null;
        }
        if (!this.i.nh.externalObject) {
            let e = IgrNumericRadiusAxis._createFromInternal(this.i.nh);
            if (e) {
                e._implementation = this.i.nh;
            }
            this.i.nh.externalObject = e;
        }
        return this.i.nh.externalObject;
    }
    set radiusAxis(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;
    }
    /**
    * Gets or sets the name to use to resolve radiusAxis from markup.
    */
    get radiusAxisName() {
        return this._radiusAxisName;
    }
    set radiusAxisName(v) {
        this._radiusAxisName = v;
    }
    /**
     * Gets or sets whether Cartesian Interpolation should be used rather than Archimedian
     * spiral based interpolation.
    */
    get useCartesianInterpolation() {
        return this.i.n1;
    }
    set useCartesianInterpolation(v) {
        this.i.n1 = ensureBool(v);
    }
    /**
     * Gets or sets the maximum number of markers displayed by the current series.
     * If more than the specified number of markers are visible, the polar series will automatically
     * choose a representative set.
    */
    get maximumMarkers() {
        return this.i.n4;
    }
    set maximumMarkers(v) {
        this.i.n4 = +v;
    }
    /**
     * Gets or sets the trend type for the current series object.
    */
    get trendLineType() {
        return this.i.ns;
    }
    set trendLineType(v) {
        this.i.ns = ensureEnum(TrendLineType_$type, v);
    }
    /**
     * Gets or sets the brush that specifies how the current series
     * object's trend line is drawn.
    */
    get trendLineBrush() {
        return brushToString(this.i.o5);
    }
    set trendLineBrush(v) {
        this.i.o5 = stringToBrush(v);
    }
    /**
     * Gets the effective TrendLineBrush for this series.
    */
    get actualTrendLineBrush() {
        return brushToString(this.i.o4);
    }
    set actualTrendLineBrush(v) {
        this.i.o4 = stringToBrush(v);
    }
    /**
     * Gets or sets the thickness of the current series object's trend line.
    */
    get trendLineThickness() {
        return this.i.n3;
    }
    set trendLineThickness(v) {
        this.i.n3 = +v;
    }
    /**
     * Gets or sets the moving average period for the current series object.
    */
    get trendLinePeriod() {
        return this.i.n5;
    }
    set trendLinePeriod(v) {
        this.i.n5 = +v;
    }
    /**
     * Sets or Gets the Trendline Z index.
    */
    get trendLineZIndex() {
        return this.i.n6;
    }
    set trendLineZIndex(v) {
        this.i.n6 = +v;
    }
    /**
     * Gets or sets whether to clip the series to the bounds.
     * Setting this to true can effect performance.
    */
    get clipSeriesToBounds() {
        return this.i.nz;
    }
    set clipSeriesToBounds(v) {
        this.i.nz = 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.radiusAxisName && this.radiusAxisName.length > 0 &&
                axes[i].name == this.radiusAxisName) {
                this.radiusAxis = 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.radiusAxis && this.radiusAxis.name && this.radiusAxis.name == name) {
            return this.radiusAxis;
        }
        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.radiusAxis && this.radiusAxis._styling) {
            this.radiusAxis._styling(container, component, this);
        }
        this._inStyling = false;
    }
    /**
     * Scrolls the requested item into view, if possible.
    
    * @param item  * The item to scroll into view.
    */
    scrollIntoView(item) {
        let iv = this.i.c9(item);
        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 index of the item that resides at the provided world coordinates.
    
    * @param world  * The world coordinates of the requested item.
    */
    getItemIndex(world) {
        let iv = this.i.e8(toPoint(world));
        return (iv);
    }
    getItemValue(item, memberPathName) {
        let iv = this.i.fs(item, memberPathName);
        return (iv);
    }
    /**
     * Determine if object can be used as RadiusAxis
    
    * @param axis  * The object to check
    */
    canUseAsRadiusAxis(axis) {
        let iv = this.i.ny(axis);
        return (iv);
    }
    /**
     * Determine if object can be used as AngleAxis
    
    * @param axis  * The object to check
    */
    canUseAsAngleAxis(axis) {
        let iv = this.i.nx(axis);
        return (iv);
    }
}
//# sourceMappingURL=igr-polar-base.js.map
