<commit_before>function graph(stats_labels, stats_data, stats_total) {
    Morris.Line({
        // ID of the element in which to draw the chart.
        element: 'evol-holder',
        // Chart data records -- each entry in this array corresponds to a point on
        // the chart.
        data: stats_data,
        // The name of the data record attribute that contains x-values.
        xkey: 'day',
        // A list of names of data record attributes that contain y-values.
        ykeys: ['value'],
        // Labels for the ykeys -- will be displayed when you hover over the
        // chart.
        labels: ['Uploaded files'],
        xLabels: 'day',
        dateFormat: function(x) { return new Date(x).toLocaleDateString(); },
        xLabelFormat: function(x) { return x.toLocaleDateString(); }
    });
    Morris.Line({
        // ID of the element in which to draw the chart.
        element: 'total-holder',
        // Chart data records -- each entry in this array corresponds to a point on
        // the chart.
        data: stats_total,
        // The name of the data record attribute that contains x-values.
        xkey: 'day',
        // A list of names of data record attributes that contain y-values.
        ykeys: ['value'],
        // Labels for the ykeys -- will be displayed when you hover over the
        // chart.
        labels: ['Uploaded files'],
        xLabels: 'day',
        lineColors: ['red'],
        dateFormat: function(x) { return new Date(x).toLocaleDateString(); },
        xLabelFormat: function(x) { return x.toLocaleDateString(); }
    });
}
$(document).ready(function() {
    // Get the data
    var stats_labels = [], stats_data = [], stats_total = [];
    $("#stats-data thead th").each(function () {
        stats_labels.push($(this).html());
    });
    var i = 0;
    $("#stats-data tbody tr:first-child td").each(function () {
        var s = stats_labels[i++];
        s = s.replace(/([0-9]{1,2})\/([0-9]{1,2})\/([0-9]{4})/, "$3-$2-$1");
        stats_data.push({ day: s, value: $(this).html()});
    });
    i = 0;
    $("#stats-data tbody tr:nth-child(2) td").each(function () {
        var s = stats_labels[i++];
        s = s.replace(/([0-9]{1,2})\/([0-9]{1,2})\/([0-9]{4})/, "$3-$2-$1");
        stats_total.push({ day: s, value: $(this).html()});
    });

    // Hide the data
    $("#stats-data").hide();

    graph(stats_labels, stats_data, stats_total);

    $(window).resize(function() {
        $("#evol-holder").empty();
        $("#total-holder").empty();
        graph(stats_labels, stats_data, stats_total);
    });
});
<commit_msg>Fix donuts charts<commit_after>function graph(stats_labels, stats_data, stats_total) {
    Morris.Line({
        // ID of the element in which to draw the chart.
        element: 'evol-holder',
        // Chart data records -- each entry in this array corresponds to a point on
        // the chart.
        data: stats_data,
        // The name of the data record attribute that contains x-values.
        xkey: 'day',
        // A list of names of data record attributes that contain y-values.
        ykeys: ['value'],
        // Labels for the ykeys -- will be displayed when you hover over the
        // chart.
        labels: ['Uploaded files'],
        xLabels: 'day',
        dateFormat: function(x) { return new Date(x).toLocaleDateString(); },
        xLabelFormat: function(x) { return x.toLocaleDateString(); }
    });
    Morris.Line({
        // ID of the element in which to draw the chart.
        element: 'total-holder',
        // Chart data records -- each entry in this array corresponds to a point on
        // the chart.
        data: stats_total,
        // The name of the data record attribute that contains x-values.
        xkey: 'day',
        // A list of names of data record attributes that contain y-values.
        ykeys: ['value'],
        // Labels for the ykeys -- will be displayed when you hover over the
        // chart.
        labels: ['Uploaded files'],
        xLabels: 'day',
        lineColors: ['red'],
        dateFormat: function(x) { return new Date(x).toLocaleDateString(); },
        xLabelFormat: function(x) { return x.toLocaleDateString(); }
    });
}
$(document).ready(function() {
    // Get the data
    var stats_labels = [], stats_data = [], stats_total = [];
    $("#stats-data thead th").each(function () {
        stats_labels.push($(this).html());
    });
    var i = 0;
    $("#stats-data tbody tr:first-child td").each(function () {
        var s = stats_labels[i++];
        s = s.replace(/([0-9]{1,2})\/([0-9]{1,2})\/([0-9]{4})/, "$3-$2-$1");
        stats_data.push({ day: s, value: $(this).html()});
    });
    i = 0;
    $("#stats-data tbody tr:nth-child(2) td").each(function () {
        var s = stats_labels[i++];
        s = s.replace(/([0-9]{1,2})\/([0-9]{1,2})\/([0-9]{4})/, "$3-$2-$1");
        stats_total.push({ day: s, value: $(this).html()});
    });

    // Hide the data
    $("#stats-data").hide();

    graph(stats_labels, stats_data, stats_total);

    $(window).resize(function() {
        $("#evol-holder").empty();
        $("#total-holder").empty();
        graph(stats_labels, stats_data, stats_total);
    });
    Morris.Donut(enabled_donut);
    Morris.Donut(disabled_donut);
});

{'fraction_non_alphanumeric': 0.16991485335856196, 'fraction_numerical': 0.01173131504257332, 'mean_word_length': 2.264978381717109, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5767739', 'n_tokens_mistral': 1604, 'n_tokens_neox': 1615, 'n_words': 464}