import { __extends } from "tslib";
import { EventEmitter, Output, Component, Input } from '@angular/core';
import { delegateCombine } from "igniteui-angular-core";
import { IgxNumericXAxisComponent } from "./igx-numeric-x-axis-component";
import { IgxNumericYAxisComponent } from "./igx-numeric-y-axis-component";
import { TrendLineType_$type } from "igniteui-angular-core";
import { CollisionAvoidanceType_$type } from "./CollisionAvoidanceType";
import { ScatterItemSearchMode_$type } from "./ScatterItemSearchMode";
import { IgxAssigningScatterStyleEventArgs } from "./igx-assigning-scatter-style-event-args";
import { IgxAssigningScatterMarkerStyleEventArgs } from "./igx-assigning-scatter-marker-style-event-args";
import { IgxMarkerSeriesComponent } from "./igx-marker-series-component";
import { ensureBool, ensureEnum, brushToString, stringToBrush, toPoint, fromRect, fromPoint } from "igniteui-angular-core";
import * as i0 from "@angular/core";
/**
 * Represents the base class for all IgxDataChartComponent scatter series
*/
var IgxScatterBaseComponent = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(IgxScatterBaseComponent, _super);
    function IgxScatterBaseComponent() {
        var _this = _super.call(this) || this;
        _this._assigningScatterStyle = null;
        _this._assigningScatterMarkerStyle = null;
        return _this;
    }
    Object.defineProperty(IgxScatterBaseComponent.prototype, "i", {
        /**
                                     * @hidden
                                     */
        get: function () {
            return this._implementation;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxScatterBaseComponent.prototype, "isScatter", {
        /**
         * Checks if this series is a scatter series
        */
        get: function () {
            return this.i.dj;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxScatterBaseComponent.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 = IgxNumericXAxisComponent._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: false,
        configurable: true
    });
    Object.defineProperty(IgxScatterBaseComponent.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 = IgxNumericYAxisComponent._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: false,
        configurable: true
    });
    Object.defineProperty(IgxScatterBaseComponent.prototype, "xMemberPath", {
        /**
         * Gets or sets the value mapping property for the current series object.
        */
        get: function () {
            return this.i.rf;
        },
        set: function (v) {
            this.i.rf = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxScatterBaseComponent.prototype, "yMemberPath", {
        /**
         * Gets or sets the value mapping property for the current series object.
        */
        get: function () {
            return this.i.rj;
        },
        set: function (v) {
            this.i.rj = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxScatterBaseComponent.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(IgxScatterBaseComponent.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(IgxScatterBaseComponent.prototype, "actualTrendLineBrush", {
        /**
         * Gets the effective TrendLineBrush for this series.
        */
        get: function () {
            return brushToString(this.i.sq);
        },
        set: function (v) {
            this.i.sq = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxScatterBaseComponent.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(IgxScatterBaseComponent.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(IgxScatterBaseComponent.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.pv;
        },
        set: function (v) {
            this.i.pv = ensureEnum(CollisionAvoidanceType_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxScatterBaseComponent.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.q4;
        },
        set: function (v) {
            this.i.q4 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxScatterBaseComponent.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.q3;
        },
        set: function (v) {
            this.i.q3 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxScatterBaseComponent.prototype, "itemSearchMode", {
        /**
         * Gets or sets the mode the series will use to find the closest point to the cursor.
        */
        get: function () {
            return this.i.qe;
        },
        set: function (v) {
            this.i.qe = ensureEnum(ScatterItemSearchMode_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxScatterBaseComponent.prototype, "itemSearchThreshold", {
        /**
         * Gets or sets the threshold to use when searching for items using ItemSearchMode.
        */
        get: function () {
            return this.i.q2;
        },
        set: function (v) {
            this.i.q2 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxScatterBaseComponent.prototype, "actualItemSearchMode", {
        get: function () {
            return this.i.qc;
        },
        set: function (v) {
            this.i.qc = ensureEnum(ScatterItemSearchMode_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxScatterBaseComponent.prototype, "isCustomScatterStyleAllowed", {
        /**
         * Gets or sets whether this Scatter series should allow custom style overrides of its individual visuals.
        */
        get: function () {
            return this.i.qp;
        },
        set: function (v) {
            this.i.qp = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxScatterBaseComponent.prototype, "isCustomScatterMarkerStyleAllowed", {
        /**
         * Gets or sets whether this Scatter series should allow custom style overrides of its individual marker visuals.
        */
        get: function () {
            return this.i.qo;
        },
        set: function (v) {
            this.i.qo = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    IgxScatterBaseComponent.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;
    };
    IgxScatterBaseComponent.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;
    };
    IgxScatterBaseComponent.prototype.getItemValue = function (item, memberPathName) {
        var iv = this.i.gt(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
    */
    IgxScatterBaseComponent.prototype.getSeriesValueMarkerBoundingBox = function (world) {
        var iv = this.i.n4(toPoint(world));
        return fromRect(iv);
    };
    /**
     * Determine if object can be used as YAxis
    
    * @param axis  * The object to check
    */
    IgxScatterBaseComponent.prototype.canUseAsYAxis = function (axis) {
        var iv = this.i.qn(axis);
        return (iv);
    };
    /**
     * Determine if object can be used as XAxis
    
    * @param axis  * The object to check
    */
    IgxScatterBaseComponent.prototype.canUseAsXAxis = function (axis) {
        var iv = this.i.qm(axis);
        return (iv);
    };
    /**
     * Gets the item that is the best match for the specified world coordinates.
    
    * @param world  * The world coordinates to use.
    */
    IgxScatterBaseComponent.prototype.getItem = function (world) {
        var iv = this.i.gq(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.
    */
    IgxScatterBaseComponent.prototype.getItemIndex = function (world) {
        var iv = this.i.f9(toPoint(world));
        return (iv);
    };
    IgxScatterBaseComponent.prototype.getExactItemIndex = function (world) {
        var iv = this.i.e4(toPoint(world));
        return (iv);
    };
    IgxScatterBaseComponent.prototype.getSeriesValuePosition = function (world, useInterpolation, skipUnknowns) {
        var iv = this.i.nt(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.
    */
    IgxScatterBaseComponent.prototype.scrollIntoView = function (item) {
        var iv = this.i.dq(item);
        return (iv);
    };
    Object.defineProperty(IgxScatterBaseComponent.prototype, "assigningScatterStyle", {
        /**
         * Event raised when Assigning Category Style
        */
        get: function () {
            var _this = this;
            if (this._assigningScatterStyle == null) {
                this._assigningScatterStyle = new EventEmitter();
                this.i.assigningScatterStyle = delegateCombine(this.i.assigningScatterStyle, function (o, e) {
                    var outerArgs = new IgxAssigningScatterStyleEventArgs();
                    outerArgs._provideImplementation(e);
                    if (_this.beforeAssigningScatterStyle) {
                        _this.beforeAssigningScatterStyle(_this, outerArgs);
                    }
                    _this._assigningScatterStyle.emit({
                        sender: _this,
                        args: outerArgs
                    });
                });
            }
            return this._assigningScatterStyle;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxScatterBaseComponent.prototype, "assigningScatterMarkerStyle", {
        /**
         * Event raised when Assigning Scatter Marker Style
        */
        get: function () {
            var _this = this;
            if (this._assigningScatterMarkerStyle == null) {
                this._assigningScatterMarkerStyle = new EventEmitter();
                this.i.assigningScatterMarkerStyle = delegateCombine(this.i.assigningScatterMarkerStyle, function (o, e) {
                    var outerArgs = new IgxAssigningScatterMarkerStyleEventArgs();
                    outerArgs._provideImplementation(e);
                    if (_this.beforeAssigningScatterMarkerStyle) {
                        _this.beforeAssigningScatterMarkerStyle(_this, outerArgs);
                    }
                    _this._assigningScatterMarkerStyle.emit({
                        sender: _this,
                        args: outerArgs
                    });
                });
            }
            return this._assigningScatterMarkerStyle;
        },
        enumerable: false,
        configurable: true
    });
    IgxScatterBaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: IgxScatterBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    IgxScatterBaseComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: IgxScatterBaseComponent, selector: "ng-component", inputs: { xAxis: "xAxis", yAxis: "yAxis", xMemberPath: "xMemberPath", yMemberPath: "yMemberPath", trendLineType: "trendLineType", trendLineBrush: "trendLineBrush", actualTrendLineBrush: "actualTrendLineBrush", trendLineThickness: "trendLineThickness", trendLinePeriod: "trendLinePeriod", markerCollisionAvoidance: "markerCollisionAvoidance", trendLineZIndex: "trendLineZIndex", maximumMarkers: "maximumMarkers", itemSearchMode: "itemSearchMode", itemSearchThreshold: "itemSearchThreshold", actualItemSearchMode: "actualItemSearchMode", isCustomScatterStyleAllowed: "isCustomScatterStyleAllowed", isCustomScatterMarkerStyleAllowed: "isCustomScatterMarkerStyleAllowed" }, outputs: { assigningScatterStyle: "assigningScatterStyle", assigningScatterMarkerStyle: "assigningScatterMarkerStyle" }, usesInheritance: true, ngImport: i0, template: "", isInline: true });
    return IgxScatterBaseComponent;
}(IgxMarkerSeriesComponent));
export { IgxScatterBaseComponent };
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: IgxScatterBaseComponent, decorators: [{
            type: Component,
            args: [{
                    template: "",
                }]
        }], ctorParameters: function () { return []; }, propDecorators: { xAxis: [{
                type: Input
            }], yAxis: [{
                type: Input
            }], xMemberPath: [{
                type: Input
            }], yMemberPath: [{
                type: Input
            }], trendLineType: [{
                type: Input
            }], trendLineBrush: [{
                type: Input
            }], actualTrendLineBrush: [{
                type: Input
            }], trendLineThickness: [{
                type: Input
            }], trendLinePeriod: [{
                type: Input
            }], markerCollisionAvoidance: [{
                type: Input
            }], trendLineZIndex: [{
                type: Input
            }], maximumMarkers: [{
                type: Input
            }], itemSearchMode: [{
                type: Input
            }], itemSearchThreshold: [{
                type: Input
            }], actualItemSearchMode: [{
                type: Input
            }], isCustomScatterStyleAllowed: [{
                type: Input
            }], isCustomScatterMarkerStyleAllowed: [{
                type: Input
            }], assigningScatterStyle: [{
                type: Output
            }], assigningScatterMarkerStyle: [{
                type: Output
            }] } });
//# sourceMappingURL=igx-scatter-base-component.js.map
