<commit_before>(function () {

    var updateIntervalMs = 1000;

    (function createLineChart() {
        var randomData = Array(20);
        var last = 0;
        for (var i = 0; i < randomData.length; i++) {
            var num = last + (Math.random() * 2 - 1);
            randomData[i] = num;
            num = last;
        }
        randomData.unshift('header');

        var chart = c3.generate({
            bindto: '#chart-1',
            data: {
                columns: [
                    randomData
                ],
                colors: {
                    data: "#34ccff"
                },
            },
            axis: {
                y: { min: -10, max: 10, padding: { top: 0, bottom: 0} }
            },
            grid: {
                x: { show: true },
                y: { show: true }
            },
            padding: {
                top: 0,
                right: 0,
                bottom: 0,
                left: 20
            },
            legend: { hide: true },
            interaction: { enabled: false },
            transition: { duration: 200 }
        });

        window.setInterval(function () {
            var header = randomData.shift();
            randomData.shift();
            randomData.unshift(header);
            var num = randomData[randomData.length - 1];
            randomData.push(num + (Math.random() * 2 - 1));
            chart.load({
                columns: [randomData]
            });
        }, updateIntervalMs);
    }());

    (function createGaugeCharts() {
        var gaugeElements = document.querySelectorAll('.gauge-chart');
        var gaugeCharts = [];
        for (var el of gaugeElements) {
            var value = Math.random();
            var chart = c3.generate({
                bindto: el,
                size: {
                    width: 100,
                    height: 100
                },
                padding: {
                    top: 0,
                    right: 0,
                    bottom: 0,
                    left: 0
                },
                data: {
                    columns: [
                        ['data', value]
                    ],
                    colors: {
                        data: "#34ccff"
                    },
                    type: 'gauge'
                },
                gauge: {
                    min: 0,
                    max: 1
                },
                interaction: { enabled: false },
            });
            gaugeCharts.push(chart);
        }
        window.setInterval(function () {
            for (var chart of gaugeCharts) {
                var value = Math.random();
                chart.load({
                    columns: [['data', value]]
                });
            }
        }, updateIntervalMs);
    }());

}());
<commit_msg>Allow chart animations to be easily disabled through code<commit_after>(function () {

    var updateIntervalMs = 1000;
    var animate = false;

    (function createLineChart() {
        var randomData = Array(20);
        var last = 0;
        for (var i = 0; i < randomData.length; i++) {
            var num = last + (Math.random() * 2 - 1);
            randomData[i] = num;
            num = last;
        }
        randomData.unshift('header');

        var chart = c3.generate({
            bindto: '#chart-1',
            data: {
                columns: [
                    randomData
                ],
                colors: {
                    data: "#34ccff"
                },
            },
            axis: {
                y: { min: -10, max: 10, padding: { top: 0, bottom: 0} }
            },
            grid: {
                x: { show: true },
                y: { show: true }
            },
            padding: {
                top: 0,
                right: 0,
                bottom: 0,
                left: 20
            },
            legend: { hide: true },
            interaction: { enabled: false },
            transition: { duration: 200 }
        });

        if (!animate) { return; }
        window.setInterval(function () {
            var header = randomData.shift();
            randomData.shift();
            randomData.unshift(header);
            var num = randomData[randomData.length - 1];
            randomData.push(num + (Math.random() * 2 - 1));
            chart.load({
                columns: [randomData]
            });
        }, updateIntervalMs);
    }());

    (function createGaugeCharts() {
        var gaugeElements = document.querySelectorAll('.gauge-chart');
        var gaugeCharts = [];
        for (var el of gaugeElements) {
            var value = Math.random();
            var chart = c3.generate({
                bindto: el,
                size: {
                    width: 100,
                    height: 100
                },
                padding: {
                    top: 0,
                    right: 0,
                    bottom: 0,
                    left: 0
                },
                data: {
                    columns: [
                        ['data', value]
                    ],
                    colors: {
                        data: "#34ccff"
                    },
                    type: 'gauge'
                },
                gauge: {
                    min: 0,
                    max: 1
                },
                interaction: { enabled: false },
            });
            gaugeCharts.push(chart);
        }

        if (!animate) { return; }
        window.setInterval(function () {
            for (var chart of gaugeCharts) {
                var value = Math.random();
                chart.load({
                    columns: [['data', value]]
                });
            }
        }, updateIntervalMs);
    }());

}());

{'fraction_non_alphanumeric': 0.11459050240880936, 'fraction_numerical': 0.015829318651066758, 'mean_word_length': 0.8812297734627832, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5969283', 'n_tokens_mistral': 1557, 'n_tokens_neox': 1379, 'n_words': 339}