<commit_before>$(function(){
    hljs.initHighlightingOnLoad();

    $.getJSON('/info', function(info) {
        $('#conn-info').text(info.address + ":" + info.port);
    });

    var start = new Date();
    var initialData = [{
        label: "all",
        values: [ {time: new Date(), y: 0} ]
    }];

    var chart = $('#area-chart').epoch({
        type: 'time.line',
        data: initialData,
        axes: ['left', 'bottom'],
        ticks: { time: 10, left: 3},
    });

    var socket = io();

    var eventTypes = ['commitcommentevent', 'createevent', 'deleteevent',
     'deploymentevent', 'teamaddevent', 'watchevent',
     'deploymentstatusevent', 'downloadevent', 'followevent', 'forkevent',
     'forkapplyevent', 'gistevent', 'gollumevent', 'issuecommentevent',
     'issuesevent', 'memberevent', 'pagebuildevent', 'publicevent',
     'pullrequestevent', 'pullrequestreviewcommentevent', 'pushevent',
     'releaseevent', 'statusevent'];

    var allCount = 0;
    eventTypes.forEach(function(eventType) {
        var count = 0;
        socket.on(eventType, function(event){
            allCount += 1;
            count += 1;
            //var elem = document.getElementById("event-log");
            //var text = JSON.stringify(event, undefined, 2);

            //elem.innerHTML = text;
            //hljs.highlightBlock(elem);
        });
    });

    window.setInterval(function() {
        var current = new Date();
        var lapse = new Date(start - current);
        var dataPoint = [ {time: current, y: allCount } ];
        chart.push(dataPoint);
    }, 1000);
});
<commit_msg>Managed to display all event types<commit_after>$(function(){
    hljs.initHighlightingOnLoad();

    $.getJSON('/info', function(info) {
        $('#conn-info').text(info.address + ":" + info.port);
    });

    var start = new Date();

    var socket = io();

    var eventTypes = ['commitcommentevent', 'createevent', 'deleteevent',
     'deploymentevent', 'teamaddevent', 'watchevent',
     'deploymentstatusevent', 'downloadevent', 'followevent', 'forkevent',
     'forkapplyevent', 'gistevent', 'gollumevent', 'issuecommentevent',
     'issuesevent', 'memberevent', 'pagebuildevent', 'publicevent',
     'pullrequestevent', 'pullrequestreviewcommentevent', 'pushevent',
     'releaseevent', 'statusevent'];

    var initialData = [];
    for (i = 0; i < eventTypes.length; i++) {
        var type = eventTypes[i];
        initialData.push({
            label: type,
            values: [{time: new Date(), y: 0}],
        });
    }

    var chart = $('#area-chart').epoch({
        type: 'time.area',
        data: initialData,
        axes: ['left', 'bottom'],
        ticks: { time: 10, left: 3},
    });
    var counts = {};
    for (i = 0; i < eventTypes.length; i++) {
        var type = eventTypes[i];
        counts[type] = 0;
    }

    eventTypes.forEach(function(eventType) {
        socket.on(eventType, function(event){
            counts[eventType] += 1;
            //var elem = document.getElementById("event-log");
            //var text = JSON.stringify(event, undefined, 2);

            //elem.innerHTML = text;
            //hljs.highlightBlock(elem);
        });
    });

    window.setInterval(function() {
        var current = new Date();
        var lapse = new Date(start - current);

        var dataPoint = [];
        for (i = 0; i < eventTypes.length; i++) {
            var count = counts[eventTypes[i]];
            dataPoint.push({ time: current, y: count });
        }
        console.log(dataPoint);
        chart.push(dataPoint);
    }, 1000);
});

{'fraction_non_alphanumeric': 0.16773296244784422, 'fraction_numerical': 0.007510431154381085, 'mean_word_length': 2.4510556621880997, 'pattern_counts': {'":': 2, '<': 6, '<?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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3896333', 'n_tokens_mistral': 1123, 'n_tokens_neox': 1062, 'n_words': 241}