<commit_before>
var select_paragraph = function() {

    var chart = d3.select(".chart");
    var data = [4, 8, 15, 16, 23, 42];

    var width = 420;
    var barheight = 20;

    var data2 = [];

    chart.attr("width", width);


    d3.json('get_daily_metrics', function(error, json) {
        console.log('received: ', json);

        //quick reversal of our desc() ordered array:
        for (var i = json.summary.length - 1; i >= 0; i--) {
            data2.push(Math.abs(+json.summary[i].balance));
        }
        console.log('data loading is complete.', data2);

        var x = d3.scale.linear()
            .domain([0, d3.max(data2)])
            .range([0, width]);

        chart.attr("height", barheight * data2.length);

        var bar = chart.selectAll("g")
            .data(data2)
            .enter().append("g")
            .attr("transform", function (d, i) {
                return "translate(0," + i * barheight + ")";
            });

        bar.append("rect")
            .attr("width", function (d) {
                return x(d);
            })
            .attr("height", barheight - 1);

        bar.append("text")
            .attr("x", function (d) {
                return d - 3;
            })
            .attr("y", barheight / 2)
            .attr("dy", "0.35em")
            .text(function (d) {
                return d;
            });

    }); //end of json loading.

        console.log('select_paragraph is finished.');

};<commit_msg>d3_functions data object is broken.. but pushing for work anyways.<commit_after>
var select_paragraph = function() {

    var chart = d3.select(".chart");

    var height = 200;
    var width = 600;


    var data = [];

    chart.attr("height", height)
        .attr("width", width);


    d3.json('get_daily_metrics', function(error, json) {
        console.log('received: ', json);

        //quick reversal of our desc() ordered array:
        for (var i = json.summary.length - 1; i >= 0; i--) {
            var datum = {"value": Math.abs(+json.summary[i].balance),
                         "date": json.summary[i].date};

            data.push(datum);
        }
        console.log('data loading is complete.', data);
        ////////////////////////////////////////////////////////////////////////////////

        var barwidth = width / data.length;

        var y = d3.scale.linear()
            .domain([0, d3.max(data.value)])
            .range([height, 0]);


        var bar = chart.selectAll("g")
            .data(data.value)
            .enter().append("g")
            .attr("transform", function (d, i) {
                return "translate(" + i * barwidth + ",0)";
            });

        bar.append("rect")
            .attr("y", function(d) {return y(d.value);})
            .attr("height", function (d) {
                return height - y(d.value);
            })
            .attr("width", barwidth - 1);

        bar.append("text")
            .attr("x", barwidth / 2)
            .attr("y", function(d) {return y(d.value) + 3;})
            .attr("dy", "0.75em")
            .text(function (d) {
                return d.value;
            });

    }); //end of json loading.

        console.log('select_paragraph is finished.');

};
{'fraction_non_alphanumeric': 0.18777022853613343, 'fraction_numerical': 0.017912291537986413, 'mean_word_length': 1.4896233666410454, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 5, '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': '4095388', 'n_tokens_mistral': 1003, 'n_tokens_neox': 926, 'n_words': 227}