import { xyCheck } from "./xyCheck.js";
/**
 * Filter out all the points for which x <= 0. Useful to display log scale data
 * @param data - data
 * @returns an object with the filtered data.
 */
export function xyFilterXPositive(data) {
    xyCheck(data);
    const { x, y } = data;
    const newX = [];
    const newY = [];
    if (x === undefined || y === undefined) {
        return { x: newX, y: newY };
    }
    for (let i = 0; i < x.length; i++) {
        if (x[i] > 0) {
            newX.push(x[i]);
            newY.push(y[i]);
        }
    }
    return { x: newX, y: newY };
}
//# sourceMappingURL=xyFilterXPositive.js.map