<commit_before>if (Meteor.isClient || Meteor.isCordova) {
    // Subscriptions
    Meteor.subscribe("samples");

    // Data sets
    var points = [];
    var recent = [
        { time: new Date(), level: 121 },
        { time: new Date(), level: 76 },
        { time: new Date(), level: 90 },
        { time: new Date(), level: 108 },
        { time: new Date(), level: 169 },
    ];

    // Startup
    Meteor.startup(function() {
        var samplesCursor = Samples.find();

        samplesCursor.observe({
            added: function(doc) {
                points.push(doc);
                drawGraph(points);
            }
        });

        start(recent[0].level)
    });

    // Rickshaw graphing function
    function drawGraph(items) {
        graphData = items.map(function(item) {
            return { x: item.time, y: item.level };
        });<commit_msg>Sort by time<commit_after>if (Meteor.isClient || Meteor.isCordova) {
    // Subscriptions
    Meteor.subscribe("samples");

    // Data sets
    var points = [];
    var recent = [
        { time: new Date(), level: 121 },
        { time: new Date(), level: 76 },
        { time: new Date(), level: 90 },
        { time: new Date(), level: 108 },
        { time: new Date(), level: 169 },
    ];

    // Startup
    Meteor.startup(function() {
        var samplesCursor = Samples.find();

        samplesCursor.observe({
            added: function(doc) {
                points.push(doc);
                drawGraph(points);
            }
        });

        start(recent[0].level)
    });

    // Rickshaw graphing function
    function drawGraph(items) {
        // Sort by time
        items = items.sort(function(a, b) {
            return a.time - b.time;
        });

        graphData = items.map(function(item) {
            return { x: item.time, y: item.level };
        });
{'fraction_non_alphanumeric': 0.14670981661272922, 'fraction_numerical': 0.015102481121898598, 'mean_word_length': 1.6884057971014492, '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': '7162382', 'n_tokens_mistral': 585, 'n_tokens_neox': 531, 'n_words': 129}