<commit_before>$(function () {
    var that = this;
    this.count = 0;
    this.frame = 100 / 25;
    this.sentiment = [];
    this.labels = [];


    var sock = new SockJS('/tweets');
    sock.onmessage = function (e) {
        $("#tweets").prepend($('<div class="bubble"><span class="tweet">' + e.data + '</span></div>'));
        that.count++;
    };

    var ctx = $("#chart").get(0).getContext("2d");

    this.data = {
        labels: this.labels,
        datasets: [
            {
                label: "Polarity index",
                fillColor: "rgba(220,220,220,0)",
                strokeColor: "#003354",
                pointColor: "#003354",
                pointStrokeColor: "#fff",
                pointHighlightFill: "#fff",
                pointHighlightStroke: "rgba(220,220,220,1)",
                data: this.sentiment
            }
        ]
    };
    var lineChart = new Chart(ctx);

    function loadData() {
        $.getJSON('/analysis/sentiment-time', function (data) {
            $.each(data, function () {
                var date = new Date(this.timestamp);
                var label = date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
                that.labels.push(label);
                that.sentiment.push(this.sentiment);
                if (that.sentiment.length > 40) {
                    that.sentiment.shift();
                    that.labels.shift();
                }
            });
            lineChart.Line(that.data);
        });


    }


    window.setInterval(function () {
        $("#counter").text(that.count);
    }, 1000 / 25);

    window.setInterval(function () {
        loadData();
    }, 1000);
});<commit_msg>tuned graph<commit_after>$(function () {
    var that = this;
    this.count = 0;
    this.frame = 100 / 25;
    this.sentiment = [];


    var sock = new SockJS('/tweets');
    sock.onmessage = function (e) {
        $("#tweets").prepend($('<div class="bubble"><span class="tweet">' + e.data + '</span></div>'));
        that.count++;
    };

    var ctx = $("#chart").get(0).getContext("2d");

    var data = {
        labels: [],
        datasets: [
            {
                label: "Polarity index",
                fillColor: "rgba(220,220,220,0)",
                strokeColor: "#003354",
                pointColor: "#003354",
                pointStrokeColor: "#fff",
                pointHighlightFill: "#fff",
                pointHighlightStroke: "rgba(220,220,220,1)",
                data: []
            }
        ]
    };
    var lineChart = new Chart(ctx, {"animationSteps": 5}).Line(data);

    function loadData() {
        $.getJSON('/analysis/dummy', function (data) {
            $.each(data, function () {
                var date = new Date(this.timestamp);
                var label = date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
                lineChart.addData([this.sentiment], label);
            });
            lineChart.removeData();

        });
    }

    window.setInterval(function () {
        $("#counter").text(that.count);
    }, 1000 / 25);

    window.setInterval(function () {
        loadData();
    }, 2000);
});
{'fraction_non_alphanumeric': 0.17392628693268353, 'fraction_numerical': 0.03320134023758757, 'mean_word_length': 1.700657894736842, 'pattern_counts': {'":': 5, '<': 13, '<?xml version=': 0, '>': 12, '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': '6433896', 'n_tokens_mistral': 1070, 'n_tokens_neox': 950, 'n_words': 170}