import { __extends } from "tslib";
import { delegateCombine, delegateRemove } from "igniteui-react-core";
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 { ScatterItemSearchMode_$type } from "./ScatterItemSearchMode";
import { IgrAssigningScatterStyleEventArgs } from "./igr-assigning-scatter-style-event-args";
import { IgrAssigningScatterMarkerStyleEventArgs } from "./igr-assigning-scatter-marker-style-event-args";
import { IgrMarkerSeries } from "./igr-marker-series";
import { ensureBool, ensureEnum, brushToString, stringToBrush, toDoubleCollection, fromDoubleCollection, toPoint, fromRect, fromPoint } from "igniteui-react-core";
/**
 * Represents the base class for all IgxDataChartComponent scatter series
*/
var IgrScatterBase = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(IgrScatterBase, _super);
    function IgrScatterBase(props) {
        var _this = _super.call(this, props) || this;
        _this._xAxisName = null;
        _this._yAxisName = null;
        _this._assigningScatterStyle = null;
        _this._assigningScatterStyle_wrapped = null;
        _this._assigningScatterMarkerStyle = null;
        _this._assigningScatterMarkerStyle_wrapped = null;
        return _this;
    }
    Object.defineProperty(IgrScatterBase.prototype, "i", {
        /**
                                     * @hidden
                                     */
        get: function () {
            return this._implementation;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrScatterBase.prototype, "isScatter", {
        /**
         * Checks if this series is a scatter series
        */
        get: function () {
            return this.i.e9;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrScatterBase.prototype, "xAxis", {
        /**
         * Gets or sets the effective x-axis for the current object.
        */
        get: function () {
            var r = this.i.xAxis;
            if (r == null) {
                return null;
            }
            if (!r.externalObject) {
                var e = IgrNumericXAxis._createFromInternal(r);
                if (e) {
                    e._implementation = r;
                }
                r.externalObject = e;
            }
            return r.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: false,
        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: false,
        configurable: true
    });
    Object.defineProperty(IgrScatterBase.prototype, "yAxis", {
        /**
         * Gets or sets the effective y-axis for the current object.
        */
        get: function () {
            var r = this.i.yAxis;
            if (r == null) {
                return null;
            }
            if (!r.externalObject) {
                var e = IgrNumericYAxis._createFromInternal(r);
                if (e) {
                    e._implementation = r;
                }
                r.externalObject = e;
            }
            return r.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: false,
        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: false,
        configurable: true
    });
    Object.defineProperty(IgrScatterBase.prototype, "xMemberPath", {
        /**
         * Gets or sets the value mapping property for the current series object.
        */
        get: function () {
            return this.i.xl;
        },
        set: function (v) {
            this.i.xl = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrScatterBase.prototype, "yMemberPath", {
        /**
         * Gets or sets the value mapping property for the current series object.
        */
        get: function () {
            return this.i.xt;
        },
        set: function (v) {
            this.i.xt = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrScatterBase.prototype, "highlightedXMemberPath", {
        /**
         * Gets or sets the highlighted X value mapping property for the current series object.
        */
        get: function () {
            return this.i.w5;
        },
        set: function (v) {
            this.i.w5 = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrScatterBase.prototype, "highlightedYMemberPath", {
        /**
         * Gets or sets the highlighted Y value mapping property for the current series object.
        */
        get: function () {
            return this.i.w7;
        },
        set: function (v) {
            this.i.w7 = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrScatterBase.prototype, "xMemberAsLegendLabel", {
        /**
         * Gets or sets the label displayed before series X value in the Data Legend.
        */
        get: function () {
            return this.i.xh;
        },
        set: function (v) {
            this.i.xh = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrScatterBase.prototype, "yMemberAsLegendLabel", {
        /**
         * Gets or sets the label displayed before series Y value in the Data Legend.
        */
        get: function () {
            return this.i.xp;
        },
        set: function (v) {
            this.i.xp = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrScatterBase.prototype, "xMemberAsLegendUnit", {
        /**
         * Gets or sets the unit after displayed after series X value in the Data Legend.
        */
        get: function () {
            return this.i.xj;
        },
        set: function (v) {
            this.i.xj = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrScatterBase.prototype, "yMemberAsLegendUnit", {
        /**
         * Gets or sets the unit after displayed after series Y value in the Data Legend.
        */
        get: function () {
            return this.i.xr;
        },
        set: function (v) {
            this.i.xr = v;
        },
        enumerable: false,
        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: false,
        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: false,
        configurable: true
    });
    Object.defineProperty(IgrScatterBase.prototype, "actualTrendLineBrush", {
        /**
         * Gets the effective TrendLineBrush for this series.
        */
        get: function () {
            return brushToString(this.i.y9);
        },
        set: function (v) {
            this.i.y9 = stringToBrush(v);
        },
        enumerable: false,
        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: false,
        configurable: true
    });
    Object.defineProperty(IgrScatterBase.prototype, "trendLineDashArray", {
        /**
         * Gets or sets a collection of double values that indicate the pattern of dashes and gaps that
         * is used to draw the trend line for the current scatter series object.
        */
        get: function () {
            return fromDoubleCollection(this.i.za);
        },
        set: function (v) {
            this.i.za = toDoubleCollection(v);
        },
        enumerable: false,
        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: false,
        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.vm;
        },
        set: function (v) {
            this.i.vm = ensureEnum(CollisionAvoidanceType_$type, v);
        },
        enumerable: false,
        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.w2;
        },
        set: function (v) {
            this.i.w2 = +v;
        },
        enumerable: false,
        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.w1;
        },
        set: function (v) {
            this.i.w1 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrScatterBase.prototype, "itemSearchMode", {
        /**
         * Gets or sets the mode the series will use to find the closest point to the cursor.
        */
        get: function () {
            return this.i.v6;
        },
        set: function (v) {
            this.i.v6 = ensureEnum(ScatterItemSearchMode_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrScatterBase.prototype, "itemSearchThreshold", {
        /**
         * Gets or sets the threshold to use when searching for items using ItemSearchMode.
        */
        get: function () {
            return this.i.w0;
        },
        set: function (v) {
            this.i.w0 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrScatterBase.prototype, "actualItemSearchMode", {
        get: function () {
            return this.i.v4;
        },
        set: function (v) {
            this.i.v4 = ensureEnum(ScatterItemSearchMode_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrScatterBase.prototype, "isCustomScatterStyleAllowed", {
        /**
         * Gets or sets whether this Scatter series should allow custom style overrides of its individual visuals.
        */
        get: function () {
            return this.i.wi;
        },
        set: function (v) {
            this.i.wi = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrScatterBase.prototype, "isCustomScatterMarkerStyleAllowed", {
        /**
         * Gets or sets whether this Scatter series should allow custom style overrides of its individual marker visuals.
        */
        get: function () {
            return this.i.wh;
        },
        set: function (v) {
            this.i.wh = ensureBool(v);
        },
        enumerable: false,
        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.ju(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.tu(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.wg(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.wf(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.jr(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.i8(toPoint(world));
        return (iv);
    };
    IgrScatterBase.prototype.getExactItemIndex = function (world) {
        var iv = this.i.hv(toPoint(world));
        return (iv);
    };
    IgrScatterBase.prototype.getSeriesValuePosition = function (world, useInterpolation, skipUnknowns) {
        var iv = this.i.th(toPoint(world), useInterpolation, skipUnknowns);
        return fromPoint(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.fo(item);
        return (iv);
    };
    /**
     * Gets the numeric values from the X and Y axis associated with this scatter series that matches the desired
     * value mode.
    
    * @param mode  * The type of value desired from the series numeric axis.
    */
    IgrScatterBase.prototype.getSeriesValueType = function (mode) {
        var iv = this.i.am((mode == null ? null : mode));
        return (iv);
    };
    IgrScatterBase.prototype.getSeriesValueTypePositionFromValue = function (values) {
        var iv = this.i.tl(values);
        return fromPoint(iv);
    };
    IgrScatterBase.prototype.getSeriesValueTypePosition = function (mode) {
        var iv = this.i.tk((mode == null ? null : mode));
        return fromPoint(iv);
    };
    Object.defineProperty(IgrScatterBase.prototype, "assigningScatterStyle", {
        /**
         * Event raised when Assigning Category Style
        */
        get: function () {
            return this._assigningScatterStyle;
        },
        set: function (ev) {
            var _this = this;
            if (this._assigningScatterStyle_wrapped !== null) {
                this.i.assigningScatterStyle = delegateRemove(this.i.assigningScatterStyle, this._assigningScatterStyle_wrapped);
                this._assigningScatterStyle_wrapped = null;
                this._assigningScatterStyle = null;
            }
            this._assigningScatterStyle = ev;
            this._assigningScatterStyle_wrapped = function (o, e) {
                var outerArgs = new IgrAssigningScatterStyleEventArgs();
                outerArgs._provideImplementation(e);
                if (_this.beforeAssigningScatterStyle) {
                    _this.beforeAssigningScatterStyle(_this, outerArgs);
                }
                if (_this._assigningScatterStyle) {
                    _this._assigningScatterStyle(_this, outerArgs);
                }
            };
            this.i.assigningScatterStyle = delegateCombine(this.i.assigningScatterStyle, this._assigningScatterStyle_wrapped);
            ;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrScatterBase.prototype, "assigningScatterMarkerStyle", {
        /**
         * Event raised when Assigning Scatter Marker Style
        */
        get: function () {
            return this._assigningScatterMarkerStyle;
        },
        set: function (ev) {
            var _this = this;
            if (this._assigningScatterMarkerStyle_wrapped !== null) {
                this.i.assigningScatterMarkerStyle = delegateRemove(this.i.assigningScatterMarkerStyle, this._assigningScatterMarkerStyle_wrapped);
                this._assigningScatterMarkerStyle_wrapped = null;
                this._assigningScatterMarkerStyle = null;
            }
            this._assigningScatterMarkerStyle = ev;
            this._assigningScatterMarkerStyle_wrapped = function (o, e) {
                var outerArgs = new IgrAssigningScatterMarkerStyleEventArgs();
                outerArgs._provideImplementation(e);
                if (_this.beforeAssigningScatterMarkerStyle) {
                    _this.beforeAssigningScatterMarkerStyle(_this, outerArgs);
                }
                if (_this._assigningScatterMarkerStyle) {
                    _this._assigningScatterMarkerStyle(_this, outerArgs);
                }
            };
            this.i.assigningScatterMarkerStyle = delegateCombine(this.i.assigningScatterMarkerStyle, this._assigningScatterMarkerStyle_wrapped);
            ;
        },
        enumerable: false,
        configurable: true
    });
    return IgrScatterBase;
}(IgrMarkerSeries));
export { IgrScatterBase };
