<commit_before>function drawNginxMap() {
  $.ajax('/api/nginx_geocache', { dataType: 'json' }).done(function(response) {
    var ip_table = [];   
    ip_table[0] = ['Latitude', 'Longitude', 'Requests'];
    var ip_list = response.nginx_ips.ips;
    for (var i = 0; i < ip_list.length; i++) {
      var ip_entry = [
        ip_list[i].latitude,
        ip_list[i].longitude,
        ip_list[i].number
      ];
      ip_table.push(ip_entry);
    }
    console.log(ip_table);

    var options = {
      legend: 'top',
      fontName: 'maven pro',
      displayMode: 'markers',
//      colors: ['#ff2d55', '#5ac8fa', '#4cd964']
    };
    var chart_data = google.visualization.arrayToDataTable(ip_table);
    var chart = new google.visualization.GeoChart(document.getElementById('nginx-geo-ip-div'));
    chart.draw(chart_data, options);

    if (!nginx_map_refresh) {
      nginx_map_refresh = setInterval(drawNginxMap, 2000);
    }
    
  });
};<commit_msg>Okay that wasn't fun.<commit_after>function drawNginxMap() {
  $.ajax('/api/nginx_geocache', { dataType: 'json' }).done(function(response) {
    var ip_table = [];   
    /* an empty geochart complains about needing only two columns */
    var ip_list = response.nginx_ips.ips;
    if (ip_list.length == 0) {
        ip_table[0] = ['Latitude', 'Longitude'];
    } else {
        ip_table[0] = ['Latitude', 'Longitude', 'Requests'];
        for (var i = 0; i < ip_list.length; i++) {
          var ip_entry = [
            ip_list[i].latitude,
            ip_list[i].longitude,
            ip_list[i].number
          ];
          ip_table.push(ip_entry);
        }
        console.log(ip_table);
    }

    var options = {
      legend: 'top',
      fontName: 'maven pro',
      displayMode: 'markers',
      colors: ['#ff2d55', '#5ac8fa', '#4cd964']
    };
    var chart_data = google.visualization.arrayToDataTable(ip_table);
    var chart = new google.visualization.GeoChart(document.getElementById('nginx-geo-ip-div'));
    chart.draw(chart_data, options);

    if (!nginx_map_refresh) {
      nginx_map_refresh = setInterval(drawNginxMap, 2000);
    }
    
  });
};
{'fraction_non_alphanumeric': 0.15522107243650046, 'fraction_numerical': 0.015051740357478834, 'mean_word_length': 2.705574912891986, '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': '4814994', 'n_tokens_mistral': 762, 'n_tokens_neox': 730, 'n_words': 131}