import { delegateCombine, delegateRemove } from "igniteui-react-core";
import { IgrNumericXAxis } from "./igr-numeric-x-axis";
import { IgrNumericYAxis } from "./igr-numeric-y-axis";
import { IgrStyleShapeEventArgs } from "./igr-style-shape-event-args";
import { IgrSeries } from "./igr-series";
/**
 * Series class for rendering polygons.
*/
export class IgrShapeSeriesBase extends IgrSeries {
    constructor(props) {
        super(props);
        this._xAxisName = null;
        this._yAxisName = null;
        this._styleShape = null;
        this._styleShape_wrapped = null;
    }
    /**
                                 * @hidden
                                 */
    get i() {
        return this._implementation;
    }
    /**
     * The name of the property on ItemsSource items which, for each shape, contains a list of points to be converted to a polygon.
     * To be consistent with the Shapefile technical description, it is expected that each list of points is defined as an IEnumerable of IEnumerable of Point, or in other words, a list of lists of points.
    */
    get shapeMemberPath() {
        return this.i.m4;
    }
    set shapeMemberPath(v) {
        this.i.m4 = v;
    }
    /**
     * Gets or sets the effective x-axis for the current ScatterBase object.
    */
    get xAxis() {
        if (this.i.mg == null) {
            return null;
        }
        if (!this.i.mg.externalObject) {
            let e = IgrNumericXAxis._createFromInternal(this.i.mg);
            if (e) {
                e._implementation = this.i.mg;
            }
            this.i.mg.externalObject = e;
        }
        return this.i.mg.externalObject;
    }
    set xAxis(v) {
        if (v != null && this._stylingContainer && v._styling)
            v._styling(this._stylingContainer, this, this);
        v == null ? this.i.mg = null : this.i.mg = v.i;
    }
    /**
    * Gets or sets the name to use to resolve xAxis from markup.
    */
    get xAxisName() {
        return this._xAxisName;
    }
    set xAxisName(v) {
        this._xAxisName = v;
    }
    /**
     * Gets or sets the effective y-axis for the current ScatterBase object.
    */
    get yAxis() {
        if (this.i.mi == null) {
            return null;
        }
        if (!this.i.mi.externalObject) {
            let e = IgrNumericYAxis._createFromInternal(this.i.mi);
            if (e) {
                e._implementation = this.i.mi;
            }
            this.i.mi.externalObject = e;
        }
        return this.i.mi.externalObject;
    }
    set yAxis(v) {
        if (v != null && this._stylingContainer && v._styling)
            v._styling(this._stylingContainer, this, this);
        v == null ? this.i.mi = null : this.i.mi = v.i;
    }
    /**
    * Gets or sets the name to use to resolve yAxis from markup.
    */
    get yAxisName() {
        return this._yAxisName;
    }
    set yAxisName(v) {
        this._yAxisName = v;
    }
    /**
     * The resolution at which to filter out shapes in the series.  For example, if the ShapeFilterResolution is set to 3, then elements with a bounding rectangle smaller than 3 X 3 pixels will be filtered out.
     * In the case of ScatterPolylineSeries, the resolution is compared to either dimension, rather than both.  In other words, a polyline will not be filtered if its height or its width exceeds the value of this property.  Whereas with a ShapeSeries, both the height and the width must exceed the value of this property.
    */
    get shapeFilterResolution() {
        return this.i.my;
    }
    set shapeFilterResolution(v) {
        this.i.my = +v;
    }
    /**
     * Gets whether or not this series is a shape series
    */
    get isShape() {
        return this.i.c5;
    }
    bindAxes(axes) {
        super.bindAxes(axes);
        for (let i = 0; i < axes.length; i++) {
            if (this.xAxisName && this.xAxisName.length > 0 &&
                axes[i].name == this.xAxisName) {
                this.xAxis = axes[i];
            }
        }
        for (let i = 0; i < axes.length; i++) {
            if (this.yAxisName && this.yAxisName.length > 0 &&
                axes[i].name == this.yAxisName) {
                this.yAxis = axes[i];
            }
        }
    }
    findByName(name) {
        var baseResult = super.findByName(name);
        if (baseResult) {
            return baseResult;
        }
        if (this.xAxis && this.xAxis.name && this.xAxis.name == name) {
            return this.xAxis;
        }
        if (this.yAxis && this.yAxis.name && this.yAxis.name == name) {
            return this.yAxis;
        }
        return null;
    }
    _styling(container, component, parent) {
        super._styling(container, component, parent);
        this._inStyling = true;
        if (this.xAxis && this.xAxis._styling) {
            this.xAxis._styling(container, component, this);
        }
        if (this.yAxis && this.yAxis._styling) {
            this.yAxis._styling(container, component, this);
        }
        this._inStyling = false;
    }
    getItemValue(item, memberPathName) {
        let iv = this.i.fs(item, memberPathName);
        return (iv);
    }
    /**
     * Determine if object can be used as YAxis
    
    * @param axis  * The object to check
    */
    canUseAsYAxis(axis) {
        let iv = this.i.mn(axis);
        return (iv);
    }
    /**
     * Determine if object can be used as XAxis
    
    * @param axis  * The object to check
    */
    canUseAsXAxis(axis) {
        let iv = this.i.mm(axis);
        return (iv);
    }
    /**
     * Raised when tile's image URI should be provided
    */
    get styleShape() {
        return this._styleShape;
    }
    set styleShape(ev) {
        if (this._styleShape_wrapped !== null) {
            this.i.styleShape = delegateRemove(this.i.styleShape, this._styleShape_wrapped);
            this._styleShape_wrapped = null;
            this._styleShape = null;
        }
        this._styleShape = ev;
        this._styleShape_wrapped = (o, e) => {
            let outerArgs = new IgrStyleShapeEventArgs();
            outerArgs._provideImplementation(e);
            if (this.beforeStyleShape) {
                this.beforeStyleShape(this, outerArgs);
            }
            if (this._styleShape) {
                this._styleShape(this, outerArgs);
            }
        };
        this.i.styleShape = delegateCombine(this.i.styleShape, this._styleShape_wrapped);
    }
}
//# sourceMappingURL=igr-shape-series-base.js.map
