<commit_before>var fipsData;
google.load('visualization', '1', {packages:['table']});
$(function() {
    $.ajax({
        url: '/data/fipsData.json',
        dataType: 'json',
        success: function(data) {
            fipsData = data;
        }
    });
    $('#collapse-data-more').on('shown.bs.collapse', function () {
        generateChart();
    });
});

function generateChart() {
    if (!fipsData) {
        //Wait for fips data to load
        setTimeout(generateChart, 1000);
    } else {
        var data = new google.visualization.DataTable();

        data.addColumn('string', 'State');
        data.addColumn('string', 'County');
        data.addColumn('number', 'Count');
        var rows = [];
        var keys = vehicleCounts.keys();
        for (var i in keys) {
            var key = keys[i];
            var count = vehicleCounts.get(key.replace(/^0*/, ''));
            var fips = fipsData[''+key];
            if (fips) {
                rows.push([fips.State, fips.County, count]);
            } else {
                console.log('Unknown fips: ' + fips);
            }
        }

        data.addRows(rows);

        var table = new google.visualization.Table(document.getElementById('dataTable'));
        table.draw(data, {showRowNumber: false, sort: 'enable', sortColumn: 2, sortAscending: false});
    }<commit_msg>Change button text and other stuff<commit_after>var fipsData;
google.load('visualization', '1', {packages:['table']});
$(function() {
    $.ajax({
        url: '/data/fipsData.json',
        dataType: 'json',
        success: function(data) {
            fipsData = data;
        }
    });
    $('#collapse-data-more').on('shown.bs.collapse', function () {
        generateChart();
        $('#tableToggle').html('Hide this data');
    });
    $('#collapse-data-more').on('hidden.bs.collapse', function () {
        $('#tableToggle').html('Learn More About This Data');
    });
});

function generateChart() {
    if (!fipsData) {
        //Wait for fips data to load
        setTimeout(generateChart, 1000);
    } else {
        var data = new google.visualization.DataTable();

        data.addColumn('string', 'State');
        data.addColumn('string', 'County');
        data.addColumn('number', 'Count');
        var rows = [];
        var keys = vehicleCounts.keys();
        for (var i in keys) {
            var key = keys[i];
            var count = vehicleCounts.get(key.replace(/^0*/, ''));
            var fips = fipsData[''+key];
            if (fips) {
                rows.push([fips.State, fips.County, count]);
            } else {
                console.log('Unknown fips: ' + fips);
            }
        }

        data.addRows(rows);

        var table = new google.visualization.Table(document.getElementById('dataTable'));
        table.draw(data, {showRowNumber: false, sort: 'enable', sortColumn: 2, sortAscending: false});
    }
{'fraction_non_alphanumeric': 0.16787314719062393, 'fraction_numerical': 0.004825922095829024, 'mean_word_length': 2.1475054229934925, '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': '5239145', 'n_tokens_mistral': 871, 'n_tokens_neox': 840, 'n_words': 181}