def METHOD_NAME(cls, data, scales, **params):
    if params["breaks"] is not None:
        breaks = np.asarray(params["breaks"])
        if hasattr(scales.x, "transform"):
            breaks = scales.x.transform(breaks)
    elif params["binwidth"] is not None:
        breaks = breaks_from_binwidth(
            scales.x.dimension(),
            params["binwidth"],
            params["center"],
            params["boundary"],
        )
    else:
        breaks = breaks_from_bins(
            scales.x.dimension(),
            params["bins"],
            params["center"],
            params["boundary"],
        )
    new_data = assign_bins(
        data["x"],
        breaks,
        data.get("weight"),
        params["pad"],
        params["closed"],
    )
    return new_data