<commit_before>export default () => {

    var bounds = [0, 0];

    var strategy = (data) => data.map((d, i) => {
        var tx = d.x;
        var ty = d.y;
        if (tx + d.width > bounds[0]) {
            tx -= d.width;
        }

        if (ty + d.height > bounds[1]) {
            ty -= d.height;
        }
        return {x: tx, y: ty};
    });

    strategy.bounds = function(value) {
        if (!arguments.length) {
            return bounds;
        }
        bounds = value;
        return strategy;
    };

    return strategy;
};
<commit_msg>fix: return width and height in bounding box<commit_after>export default () => {

    var bounds = [0, 0];

    var strategy = (data) => data.map((d, i) => {
        var tx = d.x;
        var ty = d.y;
        if (tx + d.width > bounds[0]) {
            tx -= d.width;
        }

        if (ty + d.height > bounds[1]) {
            ty -= d.height;
        }
        return {height: d.height, width: d.width, x: tx, y: ty};
    });

    strategy.bounds = function(value) {
        if (!arguments.length) {
            return bounds;
        }
        bounds = value;
        return strategy;
    };

    return strategy;
};

{'fraction_non_alphanumeric': 0.1530008453085376, 'fraction_numerical': 0.006762468300929839, 'mean_word_length': 1.416326530612245, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6336283', 'n_tokens_mistral': 388, 'n_tokens_neox': 376, 'n_words': 103}