<commit_before>//dataset
var outputData;

// closure function to obtain JSON data
(function(){
  // get the output.json file
  d3.json("data/output.json", function(error, dataSet){
    if(error) return console.warn(error);
    outputData = dataSet;
    console.log(outputData);
	$( document ).ready(function() {
		drawGraph();
		populateServiceDropdown();
	});
  });
})();

function populateServiceDropdown(){
	//init bubble/map state
	/*var Bubble = document.getElementById("bubbleMap")
	Bubble.style.visibility = "hidden";
	Bubble.style.zIndex = "0";
	var Map = document.getElementById("USMap")
	Map.style.visibility = "visible";
	Map.style.zIndex = "1";*/
	
	//service selector
	var service = '';
	//var dataset = getData();
	//service = '<option value="" disabled selected>Select a service</option>'
	for(var i=0; i<outputData.serviceTypes.length; i++){
		service+='<option value="'+i+'">'+outputData.serviceTypes[i]+'</option>';
	}
	$("#serviceSelect").html(service);
	$("#serviceSelect").change(function () {
		  changeScatterData(0,$( "#serviceSelect option:selected" ).val());
	})
	//state
	
}

$(document).ready(function($){
	var stateList = ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY"];
	var states = '';
	for(var i=0; i<stateList.length; i++){
		states+='<option value="'+i+'">'+stateList[i]+'</option>';
	}
	$("#stateSelect").html(states);
	
	$("#stateSelect").change(function () {
		$( "#stateSelect option:selected" ).each(function() {
			changeScatterData($( this ).val(),$( "#serviceSelect option:selected" ).val());
		});
	})
});

//function for hiding and showing map/bubblegraph
/*
function show(map){
	if(map == 'bubble'){
		var Bubble = document.getElementById("bubbleMap")
		Bubble.style.visibility = "visible";
		Bubble.style.zIndex = "1";
		var Map = document.getElementById("USMap")
		Map.style.visibility = "hidden";
		Map.style.zIndex = "0";
	}
	if(map == 'map'){
		var Bubble = document.getElementById("bubbleMap")
		Bubble.style.visibility = "hidden";
		Bubble.style.zIndex = "0";
		var Map = document.getElementById("USMap")
		Map.style.visibility = "visible";
		Map.style.zIndex = "1";
	}
}*/<commit_msg>fixed a bug where drg selection would force the state back to arkansas, now you can select any states's info<commit_after>//dataset
var outputData;

// closure function to obtain JSON data
(function(){
  // get the output.json file
  d3.json("data/output.json", function(error, dataSet){
    if(error) return console.warn(error);
    outputData = dataSet;
    console.log(outputData);
	$( document ).ready(function() {
		drawGraph();
		populateServiceDropdown();
	});
  });
})();

function populateServiceDropdown(){
	//init bubble/map state
	/*var Bubble = document.getElementById("bubbleMap")
	Bubble.style.visibility = "hidden";
	Bubble.style.zIndex = "0";
	var Map = document.getElementById("USMap")
	Map.style.visibility = "visible";
	Map.style.zIndex = "1";*/
	
	//service selector
	var service = '';
	//var dataset = getData();
	//service = '<option value="" disabled selected>Select a service</option>'
	for(var i=0; i<outputData.serviceTypes.length; i++){
		service+='<option value="'+i+'">'+outputData.serviceTypes[i]+'</option>';
	}
	$("#serviceSelect").html(service);
	$("#serviceSelect").change(function () {
		  changeScatterData($( "#stateSelect option:selected" ).val(),$( "#serviceSelect option:selected" ).val());
	})
	//state
	
}

$(document).ready(function($){
	var stateList = ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY"];
	var states = '';
	for(var i=0; i<stateList.length; i++){
		states+='<option value="'+i+'">'+stateList[i]+'</option>';
	}
	$("#stateSelect").html(states);
	
	$("#stateSelect").change(function () {
		changeScatterData($( "#stateSelect option:selected" ).val(),$( "#serviceSelect option:selected" ).val());
	})
});

//function for hiding and showing map/bubblegraph
/*
function show(map){
	if(map == 'bubble'){
		var Bubble = document.getElementById("bubbleMap")
		Bubble.style.visibility = "visible";
		Bubble.style.zIndex = "1";
		var Map = document.getElementById("USMap")
		Map.style.visibility = "hidden";
		Map.style.zIndex = "0";
	}
	if(map == 'map'){
		var Bubble = document.getElementById("bubbleMap")
		Bubble.style.visibility = "hidden";
		Bubble.style.zIndex = "0";
		var Map = document.getElementById("USMap")
		Map.style.visibility = "visible";
		Map.style.zIndex = "1";
	}
}*/
{'fraction_non_alphanumeric': 0.23381147540983607, 'fraction_numerical': 0.00389344262295082, 'mean_word_length': 4.803804994054697, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 15, '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': '7173330', 'n_tokens_mistral': 1771, 'n_tokens_neox': 1700, 'n_words': 390}