import { IgrNumericXAxis } from "./igr-numeric-x-axis";
import { IgrCategoryYAxis } from "./igr-category-y-axis";
import { IgrColumnFragment } from "./igr-column-fragment";
import { BarFragment } from "./BarFragment";
import { toPoint, fromRect } from "igniteui-react-core";
/**
 * Represents one part of a StackedBarSeries.
*/
export class IgrBarFragment extends IgrColumnFragment {
    constructor(props) {
        super(props);
    }
    createImplementation() {
        return new BarFragment();
    }
    /**
                                 * @hidden
                                 */
    get i() {
        return this._implementation;
    }
    /**
     * The X-Axis for this BarFragment.
    */
    get barFragmentXAxis() {
        if (this.i.barFragmentXAxis == null) {
            return null;
        }
        if (!this.i.barFragmentXAxis.externalObject) {
            let e = IgrNumericXAxis._createFromInternal(this.i.barFragmentXAxis);
            if (e) {
                e._implementation = this.i.barFragmentXAxis;
            }
            this.i.barFragmentXAxis.externalObject = e;
        }
        return this.i.barFragmentXAxis.externalObject;
    }
    /**
     * The Y-Axis for this BarFragment.
    */
    get barFragmentYAxis() {
        if (this.i.barFragmentYAxis == null) {
            return null;
        }
        if (!this.i.barFragmentYAxis.externalObject) {
            let e = IgrCategoryYAxis._createFromInternal(this.i.barFragmentYAxis);
            if (e) {
                e._implementation = this.i.barFragmentYAxis;
            }
            this.i.barFragmentYAxis.externalObject = e;
        }
        return this.i.barFragmentYAxis.externalObject;
    }
    get isVertical() {
        return this.i.isVertical;
    }
    _styling(container, component, parent) {
        super._styling(container, component, parent);
        this._inStyling = true;
        if (this.barFragmentXAxis && this.barFragmentXAxis._styling) {
            this.barFragmentXAxis._styling(container, component, this);
        }
        if (this.barFragmentYAxis && this.barFragmentYAxis._styling) {
            this.barFragmentYAxis._styling(container, component, this);
        }
        this._inStyling = false;
    }
    /**
     * Gets the precise item index, if possible, based on the closeness to the previous or next whole integer. If the series cannot provide this information, GetExactItemIndex will return the same integer value as GetItemIndex.
    
    * @param world  * The world position for which to return the index.
    */
    getExactItemIndex(world) {
        let iv = this.i.e4(toPoint(world));
        return (iv);
    }
    /**
     * 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
    */
    getSeriesValueBoundingBox(world) {
        let iv = this.i.n2(toPoint(world));
        return fromRect(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);
    }
}
//# sourceMappingURL=igr-bar-fragment.js.map
