<commit_before>

    var map = L.map('map').setView([40, -95], 4);

		L.tileLayer(
			'https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=<KEY>', {
				maxZoom: 18,
				attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
					'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
					'Imagery © <a href="http://mapbox.com">Mapbox</a>' +
          ' | <a id="mapcredits" href="#">Map Credits</a>',
				id: 'mapbox.light'
			}).addTo(map);

var win = L.control.window(map,{title:'Credits',content:'<a href="" target="_blank">Writeup</a><br /><br /><b>Data:</b><br /><NAME> <a href="https://github.com/cageyjames/GeoJSON-Ballparks" target="_blank">GeoJSON Ballparks</a><br />Me: <a href="" target="_blank" >MLB Schedule Data</a><br /><br /><b>Plugins</b><br /><a href="https://github.com/mapshakers/leaflet-control-window" target="_blank" >Leaflet Control Window</a> (this)', modal: true})
           
document.getElementById('mapcredits').addEventListener('click', function(){win.show();})

		var xhr = new XMLHttpRequest();
		xhr.open('GET', '/games');
		xhr.send(null);

		xhr.onreadystatechange = function() {
			if (xhr.readyState === 4) { 
				if (xhr.status === 200) {
					var game_day_data = JSON.parse(xhr.responseText);
					pictureArray(game_day_data);
				} else {
					console.log('Error: ' + xhr.status);
				}
			}
		};

		function addMarkers(game_day_data, values) {
      
			var markers = [];
      
			game_day_data.forEach(function(d, i) {
				var newIcon = L.icon({
					iconUrl: values[i],
					iconSize: [30, 40],
					iconAnchor: [15, 40],
					popupAnchor: [0, -15]
				});
        
				markers[i] = L.marker([d.coordinates[1], d.coordinates[0]], {
					icon: newIcon
				}).addTo(map);
				markers[i].bindPopup("<b>" + d["SUBJECT"] + "</b><br />"+ ((d["START TIME"]) ? (d["START TIME"]).replace(/^[0]+/g,'') : "") + " (local)<br />" + d["START TIME ET"].replace(/^[0]+/g,'') + " (ET)<br />" + d["LOCATION"]);
			});
      
		}

		function pictureArray(game_day_data) {
      
				var length = game_day_data.length;
				var c = []; //canvas elements
				var a = []; //promises
      <commit_msg>Update main.js<commit_after>

    var map = L.map('map').setView([40, -95], 4);

		L.tileLayer(
			'https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=<KEY>', {
				maxZoom: 18,
				attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
					'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
					'Imagery © <a href="http://mapbox.com">Mapbox</a>' +
          ' | <a id="mapcredits" href="#">Map Credits</a>',
				id: 'mapbox.light'
			}).addTo(map);

var win = L.control.window(map,{title:'Credits',content:'<a href="" target="_blank">Writeup</a><br /><br /><b>Data:</b><br /><NAME> <a href="https://github.com/cageyjames/GeoJSON-Ballparks" target="_blank">GeoJSON Ballparks</a><br />Me: <a href="" target="_blank" >MLB Schedule Data</a><br /><br /><b>Plugins</b><br /><a href="https://github.com/mapshakers/leaflet-control-window" target="_blank" >Leaflet Control Window</a> (this)', modal: true})
           
document.getElementById('mapcredits').addEventListener('click', function(){win.show();})

		var xhr = new XMLHttpRequest();
		xhr.open('GET', '/games');
		xhr.send(null);

		xhr.onreadystatechange = function() {
			if (xhr.readyState === 4) { 
				if (xhr.status === 200) {
					var game_day_data = JSON.parse(xhr.responseText);
					pictureArray(game_day_data);
				} else {
					console.log('Error: ' + xhr.status);
				}
			}
		};

		function addMarkers(game_day_data, values) {
      
			var markers = [];
      
			game_day_data.forEach(function(d, i) {
				var newIcon = L.icon({
					iconUrl: values[i],
					iconSize: [30, 40],
					iconAnchor: [15, 40],
					popupAnchor: [0, -15]
				});
        
				markers[i] = L.marker([d.coordinates[1], d.coordinates[0]], {
					icon: newIcon
				}).addTo(map);
				markers[i].bindPopup("<b>" + d["SUBJECT"] + "</b><br />"+ ( (d["START TIME"]) ? (d["START TIME"]).replace(/^[0]+/g,'') : "" ) + " (local)<br />" + ( (d["START TIME ET"]) ? d["START TIME ET"].replace(/^[0]+/g,'') : "" ) + " (ET)<br />" + d["LOCATION"]);
			});
      
		}

		function pictureArray(game_day_data) {
      
				var length = game_day_data.length;
				var c = []; //canvas elements
				var a = []; //promises
      
{'fraction_non_alphanumeric': 0.23059617547806524, 'fraction_numerical': 0.013048368953880765, 'mean_word_length': 3.2627037392138063, 'pattern_counts': {'":': 0, '<': 71, '<?xml version=': 0, '>': 71, 'https://': 6, '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': '1032859', 'n_tokens_mistral': 1926, 'n_tokens_neox': 1633, 'n_words': 276}