import { delegateCombine, delegateRemove } from "igniteui-react-core";
import { IgrNumericXAxis } from "./igr-numeric-x-axis";
import { IgrNumericYAxis } from "./igr-numeric-y-axis";
import { IgrProgressiveLoadStatusEventArgs } from "./igr-progressive-load-status-event-args";
import { IgrSeries } from "./igr-series";
import { HighDensityScatterSeries } from "./HighDensityScatterSeries";
import { ensureBool, colorToString, stringToColor, toPoint } from "igniteui-react-core";
/**
 * Represents a IgxDataChartComponent series where a high volume of scatter points can be displayed.
*/
export class IgrHighDensityScatterSeries extends IgrSeries {
    constructor(props) {
        super(props);
        this._xAxisName = null;
        this._yAxisName = null;
        this._progressiveLoadStatusChanged = null;
        this._progressiveLoadStatusChanged_wrapped = null;
    }
    createImplementation() {
        return new HighDensityScatterSeries();
    }
    /**
                                 * @hidden
                                 */
    get i() {
        return this._implementation;
    }
    /**
     * Checks if this series is a scatter series
    */
    get isScatter() {
        return this.i.dj;
    }
    /**
     * Gets or sets the effective x-axis for the current object.
    */
    get xAxis() {
        if (this.i.og == null) {
            return null;
        }
        if (!this.i.og.externalObject) {
            let e = IgrNumericXAxis._createFromInternal(this.i.og);
            if (e) {
                e._implementation = this.i.og;
            }
            this.i.og.externalObject = e;
        }
        return this.i.og.externalObject;
    }
    set xAxis(v) {
        if (v != null && this._stylingContainer && v._styling)
            v._styling(this._stylingContainer, this, this);
        v == null ? this.i.og = null : this.i.og = 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 object.
    */
    get yAxis() {
        if (this.i.oi == null) {
            return null;
        }
        if (!this.i.oi.externalObject) {
            let e = IgrNumericYAxis._createFromInternal(this.i.oi);
            if (e) {
                e._implementation = this.i.oi;
            }
            this.i.oi.externalObject = e;
        }
        return this.i.oi.externalObject;
    }
    set yAxis(v) {
        if (v != null && this._stylingContainer && v._styling)
            v._styling(this._stylingContainer, this, this);
        v == null ? this.i.oi = null : this.i.oi = 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;
    }
    /**
     * Gets or sets the x value mapping property for the current series object.
    */
    get xMemberPath() {
        return this.i.qc;
    }
    set xMemberPath(v) {
        this.i.qc = v;
    }
    /**
     * Gets or sets the y value mapping property for the current series object.
    */
    get yMemberPath() {
        return this.i.qg;
    }
    set yMemberPath(v) {
        this.i.qg = v;
    }
    /**
     * Gets or sets the whether to use use brute force mode.
    */
    get useBruteForce() {
        return this.i.ow;
    }
    set useBruteForce(v) {
        this.i.ow = ensureBool(v);
    }
    /**
     * Gets or sets the whether to progressively load the data into the chart.
    */
    get progressiveLoad() {
        return this.i.ov;
    }
    set progressiveLoad(v) {
        this.i.ov = ensureBool(v);
    }
    /**
     * Gets or sets the density value that maps to the minimum heat color.
    */
    get heatMinimum() {
        return this.i.po;
    }
    set heatMinimum(v) {
        this.i.po = +v;
    }
    /**
     * Gets or sets the value that maps to the maximum heat color.
    */
    get heatMaximum() {
        return this.i.pn;
    }
    set heatMaximum(v) {
        this.i.pn = +v;
    }
    /**
     * Gets or sets the color to use for the minimum end of the scale.
    */
    get heatMinimumColor() {
        return colorToString(this.i.q9);
    }
    set heatMinimumColor(v) {
        this.i.q9 = stringToColor(v);
    }
    /**
     * Gets or sets the color to use for the maximum end of the scale.
    */
    get heatMaximumColor() {
        return colorToString(this.i.q8);
    }
    set heatMaximumColor(v) {
        this.i.q8 = stringToColor(v);
    }
    /**
     * Gets or sets the the pixel extent of the square data points that are rendered.
    */
    get pointExtent() {
        return this.i.p0;
    }
    set pointExtent(v) {
        this.i.p0 = +v;
    }
    /**
     * Represents the current status of the progressive load of the series. It will range from 0 to 100, where 100 is fully loaded.
    */
    get progressiveStatus() {
        return this.i.p1;
    }
    set progressiveStatus(v) {
        this.i.p1 = +v;
    }
    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.gt(item, memberPathName);
        return (iv);
    }
    /**
     * Determine if object can be used as YAxis
    
    * @param axis  * The object to check
    */
    canUseAsYAxis(axis) {
        let iv = this.i.ou(axis);
        return (iv);
    }
    /**
     * Determine if object can be used as XAxis
    
    * @param axis  * The object to check
    */
    canUseAsXAxis(axis) {
        let iv = this.i.ot(axis);
        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.
    */
    scrollIntoView(item) {
        let iv = this.i.dq(item);
        return (iv);
    }
    /**
     * Gets the item that is the best match for the specified world coordinates.
    
    * @param world  * The world coordinates to use.
    */
    getItem(world) {
        let iv = this.i.gq(toPoint(world));
        return (iv);
    }
    /**
     * Raised when the progressive loading state of the series has changed.
    */
    get progressiveLoadStatusChanged() {
        return this._progressiveLoadStatusChanged;
    }
    set progressiveLoadStatusChanged(ev) {
        if (this._progressiveLoadStatusChanged_wrapped !== null) {
            this.i.progressiveLoadStatusChanged = delegateRemove(this.i.progressiveLoadStatusChanged, this._progressiveLoadStatusChanged_wrapped);
            this._progressiveLoadStatusChanged_wrapped = null;
            this._progressiveLoadStatusChanged = null;
        }
        this._progressiveLoadStatusChanged = ev;
        this._progressiveLoadStatusChanged_wrapped = (o, e) => {
            let outerArgs = new IgrProgressiveLoadStatusEventArgs();
            outerArgs._provideImplementation(e);
            if (this.beforeProgressiveLoadStatusChanged) {
                this.beforeProgressiveLoadStatusChanged(this, outerArgs);
            }
            if (this._progressiveLoadStatusChanged) {
                this._progressiveLoadStatusChanged(this, outerArgs);
            }
        };
        this.i.progressiveLoadStatusChanged = delegateCombine(this.i.progressiveLoadStatusChanged, this._progressiveLoadStatusChanged_wrapped);
    }
}
//# sourceMappingURL=igr-high-density-scatter-series.js.map
