import { IgrHorizontalAnchoredCategorySeries } from "./igr-horizontal-anchored-category-series";
import { WaterfallSeries } from "./WaterfallSeries";
import { brushToString, stringToBrush, toPoint, fromRect } from "igniteui-react-core/ES2015/componentUtil";
/**
 * Represents a IgxDataChartComponent waterfall column series.
*
* `IgrWaterfallSeries` belongs to a group of `IgrCategorySeries` and it is rendered using a collection of vertical columns that show the difference between consecutive data points.
*/
export class IgrWaterfallSeries extends IgrHorizontalAnchoredCategorySeries {
    createImplementation() {
        return new WaterfallSeries();
    }
    get i() {
        return this._implementation;
    }
    constructor(props) {
        super(props);
    }
    /**
     * Overridden by derived series classes to indicate when negative colors are supported or not.
    */
    get isNegativeColorSupported() {
        return this.i.cz;
    }
    /**
     * Gets or sets the brush to use for negative portions of the series.
    *
    * Gets or sets the color used to draw negative declines in values for this `IgrWaterfallSeries`.
    */
    get negativeBrush() {
        return brushToString(this.i.ql);
    }
    set negativeBrush(v) {
        this.i.ql = stringToBrush(v);
    }
    /**
     * Gets or sets the x-radius of the ellipse that is used to round the corners of the column.
    *
    * Gets or sets the amount to round corners in the direction of the X axis in this series.
    */
    get radiusX() {
        return this.i.qb;
    }
    set radiusX(v) {
        this.i.qb = +v;
    }
    /**
     * Gets or sets the y-radius of the ellipse that is used to round the corners of the column.
    *
    * Gets or sets the amount to round corners in the direction of the Y axis in this series.
    */
    get radiusY() {
        return this.i.qc;
    }
    set radiusY(v) {
        this.i.qc = +v;
    }
    /**
     * Brush to use for outlining negative elements in the waterfall series.
    *
    * Gets or sets the color used to draw borders of negative declines in values for this `IgrWaterfallSeries`.
    */
    get negativeOutline() {
        return brushToString(this.i.qm);
    }
    set negativeOutline(v) {
        this.i.qm = stringToBrush(v);
    }
    setNegativeColors(negativeBrush, negativeOutline) {
        this.i.jb(stringToBrush(negativeBrush), stringToBrush(negativeOutline));
    }
    /**
     * If possible, will return the best available value bounding box within the series that has the best value match for the world position provided.
    
    * @param world  * The world coordinate for which to get a value bounding box for
    *
    * Returns a bounding box `Rect` for a data value given a `Point`.
    */
    getSeriesValueBoundingBox(world) {
        let iv = this.i.ln(toPoint(world));
        return fromRect(iv);
    }
    /**
     * For a category plotted series, returns the current width of the items within the categories. This only returns a value if the items have some form of width (e.g. columns, bars, etc.) otherwise 0 is returned.
    
    *
    * Returns the width of items in the `IgrWaterfallSeries`.
    *
    * ```ts
    * let itemSpan: number = series.GetItemSpan();
    * ```
    */
    getItemSpan() {
        let iv = this.i.ed();
        return (iv);
    }
}
