import * as tslib_1 from "tslib";
import { delegateCombine, delegateRemove } from "igniteui-react-core";
import { IgrNumericXAxis } from "./igr-numeric-x-axis";
import { IgrNumericYAxis } from "./igr-numeric-y-axis";
import { IgrTriangulationStatusEventArgs } from "igniteui-react-core";
import { IgrSeries } from "./igr-series";
/**
 * Base class for series which triangulate XY data prior to rendering.
*/
var IgrScatterTriangulationSeries = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(IgrScatterTriangulationSeries, _super);
    function IgrScatterTriangulationSeries(props) {
        var _this = _super.call(this, props) || this;
        _this._xAxisName = null;
        _this._yAxisName = null;
        _this._triangulationStatusChanged = null;
        _this._triangulationStatusChanged_wrapped = null;
        return _this;
    }
    Object.defineProperty(IgrScatterTriangulationSeries.prototype, "i", {
        /**
                                     * @hidden
                                     */
        get: function () {
            return this._implementation;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrScatterTriangulationSeries.prototype, "xMemberPath", {
        /**
         * The name of the property from which to extract the X-coordinate for each item in the ItemsSource.
        */
        get: function () {
            return this.i.o7;
        },
        set: function (v) {
            this.i.o7 = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrScatterTriangulationSeries.prototype, "yMemberPath", {
        /**
         * The name of the property from which to extract the Y-coordinate for each item in the ItemsSource.
        */
        get: function () {
            return this.i.pb;
        },
        set: function (v) {
            this.i.pb = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrScatterTriangulationSeries.prototype, "xAxis", {
        /**
         * The X-Axis for this series.
        */
        get: function () {
            if (this.i.n9 == null) {
                return null;
            }
            if (!this.i.n9.externalObject) {
                var e = IgrNumericXAxis._createFromInternal(this.i.n9);
                if (e) {
                    e._implementation = this.i.n9;
                }
                this.i.n9.externalObject = e;
            }
            return this.i.n9.externalObject;
        },
        set: function (v) {
            if (v != null && this._stylingContainer && v._styling)
                v._styling(this._stylingContainer, this, this);
            v == null ? this.i.n9 = null : this.i.n9 = v.i;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrScatterTriangulationSeries.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(IgrScatterTriangulationSeries.prototype, "yAxis", {
        /**
         * The Y-Axis for this series.
        */
        get: function () {
            if (this.i.oa == null) {
                return null;
            }
            if (!this.i.oa.externalObject) {
                var e = IgrNumericYAxis._createFromInternal(this.i.oa);
                if (e) {
                    e._implementation = this.i.oa;
                }
                this.i.oa.externalObject = e;
            }
            return this.i.oa.externalObject;
        },
        set: function (v) {
            if (v != null && this._stylingContainer && v._styling)
                v._styling(this._stylingContainer, this, this);
            v == null ? this.i.oa = null : this.i.oa = v.i;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrScatterTriangulationSeries.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(IgrScatterTriangulationSeries.prototype, "trianglesSource", {
        /**
         * The source of triangulation data.
         * This property is optional.  If it is left as null, the triangulation will be created based on the items in the ItemsSource.  Triangulation is a demanding operation, so the runtime performance will be better when specifying a TriangulationSource, especially when a large number of data items are present.
        */
        get: function () {
            return this.i.trianglesSource;
        },
        set: function (v) {
            this.i.trianglesSource = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrScatterTriangulationSeries.prototype, "triangleVertexMemberPath1", {
        /**
         * The name of the property of the TrianglesSource items which, for each triangle, contains the index of the first vertex point in the ItemsSource.
        */
        get: function () {
            return this.i.oz;
        },
        set: function (v) {
            this.i.oz = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrScatterTriangulationSeries.prototype, "triangleVertexMemberPath2", {
        /**
         * The name of the property of the TrianglesSource items which, for each triangle, contains the index of the second vertex point in the ItemsSource.
        */
        get: function () {
            return this.i.o1;
        },
        set: function (v) {
            this.i.o1 = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrScatterTriangulationSeries.prototype, "triangleVertexMemberPath3", {
        /**
         * The name of the property of the TrianglesSource items which, for each triangle, contains the index of the third vertex point in the ItemsSource.
        */
        get: function () {
            return this.i.o3;
        },
        set: function (v) {
            this.i.o3 = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrScatterTriangulationSeries.prototype, "isShape", {
        /**
         * Gets whether or not this series is a shape series
        */
        get: function () {
            return this.i.dk;
        },
        enumerable: true,
        configurable: true
    });
    IgrScatterTriangulationSeries.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];
            }
        }
    };
    IgrScatterTriangulationSeries.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;
    };
    IgrScatterTriangulationSeries.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;
    };
    IgrScatterTriangulationSeries.prototype.getItemValue = function (item, memberPathName) {
        var iv = this.i.gt(item, memberPathName);
        return (iv);
    };
    /**
     * Determine if object can be used as YAxis
    
    * @param axis  * The object to check
    */
    IgrScatterTriangulationSeries.prototype.canUseAsYAxis = function (axis) {
        var iv = this.i.or(axis);
        return (iv);
    };
    /**
     * Determine if object can be used as XAxis
    
    * @param axis  * The object to check
    */
    IgrScatterTriangulationSeries.prototype.canUseAsXAxis = function (axis) {
        var iv = this.i.oq(axis);
        return (iv);
    };
    Object.defineProperty(IgrScatterTriangulationSeries.prototype, "triangulationStatusChanged", {
        /**
         * Raised when the status of an ongoing Triangulation has changed.
        */
        get: function () {
            return this._triangulationStatusChanged;
        },
        set: function (ev) {
            var _this = this;
            if (this._triangulationStatusChanged_wrapped !== null) {
                this.i.triangulationStatusChanged = delegateRemove(this.i.triangulationStatusChanged, this._triangulationStatusChanged_wrapped);
                this._triangulationStatusChanged_wrapped = null;
                this._triangulationStatusChanged = null;
            }
            this._triangulationStatusChanged = ev;
            this._triangulationStatusChanged_wrapped = function (o, e) {
                var outerArgs = new IgrTriangulationStatusEventArgs();
                outerArgs._provideImplementation(e);
                if (_this.beforeTriangulationStatusChanged) {
                    _this.beforeTriangulationStatusChanged(_this, outerArgs);
                }
                if (_this._triangulationStatusChanged) {
                    _this._triangulationStatusChanged(_this, outerArgs);
                }
            };
            this.i.triangulationStatusChanged = delegateCombine(this.i.triangulationStatusChanged, this._triangulationStatusChanged_wrapped);
        },
        enumerable: true,
        configurable: true
    });
    return IgrScatterTriangulationSeries;
}(IgrSeries));
export { IgrScatterTriangulationSeries };
//# sourceMappingURL=igr-scatter-triangulation-series.js.map
