import * as tslib_1 from "tslib";
import { IgrNumericXAxis } from "./igr-numeric-x-axis";
import { IgrNumericYAxis } from "./igr-numeric-y-axis";
import { TrendLineType_$type } from "igniteui-react-core";
import { CollisionAvoidanceType_$type } from "./CollisionAvoidanceType";
import { IgrMarkerSeries } from "./igr-marker-series";
import { ensureEnum, brushToString, stringToBrush, toPoint, fromRect } from "igniteui-react-core";
/**
 * Represents the base class for all IgxDataChartComponent scatter series
*/
var IgrScatterBase = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(IgrScatterBase, _super);
    function IgrScatterBase(props) {
        var _this = _super.call(this, props) || this;
        _this._xAxisName = null;
        _this._yAxisName = null;
        return _this;
    }
    Object.defineProperty(IgrScatterBase.prototype, "i", {
        /**
                                     * @hidden
                                     */
        get: function () {
            return this._implementation;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrScatterBase.prototype, "isScatter", {
        /**
         * Checks if this series is a scatter series
        */
        get: function () {
            return this.i.c4;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrScatterBase.prototype, "xAxis", {
        /**
         * Gets or sets the effective x-axis for the current object.
        */
        get: function () {
            if (this.i.xAxis == null) {
                return null;
            }
            if (!this.i.xAxis.externalObject) {
                var e = IgrNumericXAxis._createFromInternal(this.i.xAxis);
                if (e) {
                    e._implementation = this.i.xAxis;
                }
                this.i.xAxis.externalObject = e;
            }
            return this.i.xAxis.externalObject;
        },
        set: function (v) {
            if (v != null && this._stylingContainer && v._styling)
                v._styling(this._stylingContainer, this, this);
            v == null ? this.i.xAxis = null : this.i.xAxis = v.i;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrScatterBase.prototype, "xAxisName", {
        /**
        * Gets or sets the name to use to resolve xAxis from markup.
        */
        get: function () {
            return this._xAxisName;
        },
        set: function (v) {
            this._xAxisName = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrScatterBase.prototype, "yAxis", {
        /**
         * Gets or sets the effective y-axis for the current object.
        */
        get: function () {
            if (this.i.yAxis == null) {
                return null;
            }
            if (!this.i.yAxis.externalObject) {
                var e = IgrNumericYAxis._createFromInternal(this.i.yAxis);
                if (e) {
                    e._implementation = this.i.yAxis;
                }
                this.i.yAxis.externalObject = e;
            }
            return this.i.yAxis.externalObject;
        },
        set: function (v) {
            if (v != null && this._stylingContainer && v._styling)
                v._styling(this._stylingContainer, this, this);
            v == null ? this.i.yAxis = null : this.i.yAxis = v.i;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrScatterBase.prototype, "yAxisName", {
        /**
        * Gets or sets the name to use to resolve yAxis from markup.
        */
        get: function () {
            return this._yAxisName;
        },
        set: function (v) {
            this._yAxisName = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrScatterBase.prototype, "xMemberPath", {
        /**
         * Gets or sets the value mapping property for the current series object.
        */
        get: function () {
            return this.i.n4;
        },
        set: function (v) {
            this.i.n4 = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrScatterBase.prototype, "yMemberPath", {
        /**
         * Gets or sets the value mapping property for the current series object.
        */
        get: function () {
            return this.i.n8;
        },
        set: function (v) {
            this.i.n8 = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrScatterBase.prototype, "trendLineType", {
        /**
         * Gets or sets the trend type for the current scatter series.
        */
        get: function () {
            return this.i.trendLineType;
        },
        set: function (v) {
            this.i.trendLineType = ensureEnum(TrendLineType_$type, v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrScatterBase.prototype, "trendLineBrush", {
        /**
         * Gets or sets the brush to use to draw the trend line.
        */
        get: function () {
            return brushToString(this.i.trendLineBrush);
        },
        set: function (v) {
            this.i.trendLineBrush = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrScatterBase.prototype, "actualTrendLineBrush", {
        /**
         * Gets the effective TrendLineBrush for this series.
        */
        get: function () {
            return brushToString(this.i.o5);
        },
        set: function (v) {
            this.i.o5 = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrScatterBase.prototype, "trendLineThickness", {
        /**
         * Gets or sets the thickness of the current scatter series object's trend line.
        */
        get: function () {
            return this.i.trendLineThickness;
        },
        set: function (v) {
            this.i.trendLineThickness = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrScatterBase.prototype, "trendLinePeriod", {
        /**
         * Gets or sets the moving average period for the current scatter series object.
         * The typical, and initial, value for trend line period is 7.
        */
        get: function () {
            return this.i.trendLinePeriod;
        },
        set: function (v) {
            this.i.trendLinePeriod = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrScatterBase.prototype, "markerCollisionAvoidance", {
        /**
         * The desired behavior for markers in this series which are placed too close together for the current view, resulting in a collision.
        */
        get: function () {
            return this.i.ne;
        },
        set: function (v) {
            this.i.ne = ensureEnum(CollisionAvoidanceType_$type, v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrScatterBase.prototype, "trendLineZIndex", {
        /**
         * Gets or sets the Z-Index of the trend line.  Values greater than 1000 will result in the trend line being rendered in front of the series data.
        */
        get: function () {
            return this.i.ny;
        },
        set: function (v) {
            this.i.ny = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrScatterBase.prototype, "maximumMarkers", {
        /**
         * Gets or sets the maximum number of markerItems displayed by the current series.
         * If more than the specified number of markerItems are visible, the series will automatically
         * choose a representative set.
        */
        get: function () {
            return this.i.nx;
        },
        set: function (v) {
            this.i.nx = +v;
        },
        enumerable: true,
        configurable: true
    });
    IgrScatterBase.prototype.bindAxes = function (axes) {
        _super.prototype.bindAxes.call(this, axes);
        for (var i = 0; i < axes.length; i++) {
            if (this.xAxisName && this.xAxisName.length > 0 &&
                axes[i].name == this.xAxisName) {
                this.xAxis = axes[i];
            }
        }
        for (var i = 0; i < axes.length; i++) {
            if (this.yAxisName && this.yAxisName.length > 0 &&
                axes[i].name == this.yAxisName) {
                this.yAxis = axes[i];
            }
        }
    };
    IgrScatterBase.prototype.findByName = function (name) {
        var baseResult = _super.prototype.findByName.call(this, 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;
    };
    IgrScatterBase.prototype._styling = function (container, component, parent) {
        _super.prototype._styling.call(this, 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;
    };
    IgrScatterBase.prototype.getItemValue = function (item, memberPathName) {
        var iv = this.i.fs(item, memberPathName);
        return (iv);
    };
    /**
     * If possible, will return the best available value marker bounding box within the series that has the best value match for the world position provided.
    
    * @param world  * The world coordinates for which to get a value marker bounding box for
    */
    IgrScatterBase.prototype.getSeriesValueMarkerBoundingBox = function (world) {
        var iv = this.i.l6(toPoint(world));
        return fromRect(iv);
    };
    /**
     * Determine if object can be used as YAxis
    
    * @param axis  * The object to check
    */
    IgrScatterBase.prototype.canUseAsYAxis = function (axis) {
        var iv = this.i.nu(axis);
        return (iv);
    };
    /**
     * Determine if object can be used as XAxis
    
    * @param axis  * The object to check
    */
    IgrScatterBase.prototype.canUseAsXAxis = function (axis) {
        var iv = this.i.nt(axis);
        return (iv);
    };
    /**
     * Gets the item that is the best match for the specified world coordinates.
    
    * @param world  * The world coordinates to use.
    */
    IgrScatterBase.prototype.getItem = function (world) {
        var 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.
    */
    IgrScatterBase.prototype.getItemIndex = function (world) {
        var iv = this.i.e8(toPoint(world));
        return (iv);
    };
    /**
     * Scrolls the series to display the item for the specified data item.
     * The series is scrolled by the minimum amount required to place the specified data item within
     * the central 80% of the visible axis.
    
    * @param item  * The data item (item) to scroll to.
    */
    IgrScatterBase.prototype.scrollIntoView = function (item) {
        var iv = this.i.c9(item);
        return (iv);
    };
    return IgrScatterBase;
}(IgrMarkerSeries));
export { IgrScatterBase };
//# sourceMappingURL=igr-scatter-base.js.map
