<commit_before>function tooltipHtml(n, d){	/* function to create html content string in tooltip div. */
	if (!d) return ''
	return "<h4>"+n+"</h4><table>"+
		"<tr><td>Military Equip.</td><td>"+(d.dollars)+"</td></tr>"+
		"<tr><td>Killed by Police</td><td>"+(d.deaths)+"</td></tr>"+
		"<tr><td>Violent Crimes</td><td>"+(d.violent)+"</td></tr>"+
		"<tr><td>Property Crimes</td><td>"+(d.property)+"</td></tr>"+
		"</table>";
}

$.getJSON("/api/state/", function(data) {
	var sampleData = {};

	data.results.forEach(function(state) {
		var dollars = Math.round(state.total_military_dollars)
		var population = state.total_population_twentyfifteen
		var violent = state.total_violent_crime
		var deaths = state.total_deaths_twentyfifteen

		sampleData[state.state] = {
			dollars: '$' + dollars.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","),
			deaths: deaths,
			violent: violent.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","),
			property: state.total_property_crime.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","),
			color: d3.interpolate("#A8D8F0", "#4878A8")((dollars / population) / 10)
		};
	});

	/* draw states on id #statesvg */
	uStates.draw("#statesvg", sampleData, tooltipHtml);
});<commit_msg>Homepage map colors now based on military equip, deaths, and violent crime.<commit_after>function tooltipHtml(n, d){	/* function to create html content string in tooltip div. */
	if (!d) return ''
	return "<h4>"+n+"</h4><table>"+
		"<tr><td>Military Equip.</td><td>"+(d.dollars)+"</td></tr>"+
		"<tr><td>Killed by Police</td><td>"+(d.deaths)+"</td></tr>"+
		"<tr><td>Violent Crimes</td><td>"+(d.violent)+"</td></tr>"+
		"<tr><td>Property Crimes</td><td>"+(d.property)+"</td></tr>"+
		"</table>";
}

$.getJSON("/api/state/", function(data) {
	var sampleData = {};

	data.results.forEach(function(state) {
		var dollars = Math.round(state.total_military_dollars)
		var population = state.total_population_twentyfifteen
		var violent = state.total_violent_crime
		var deaths = state.total_deaths_twentyfifteen

		sampleData[state.state] = {
			dollars: '$' + dollars.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","),
			deaths: deaths,
			violent: violent.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","),
			property: state.total_property_crime.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","),
			color: d3.interpolate("#A8D8F0", "#6c93b9")(((dollars / population) / 10) + ((deaths / population) * 100000) + ((violent / population) * 100) / 10)
		};
	});

	/* draw states on id #statesvg */
	uStates.draw("#statesvg", sampleData, tooltipHtml);
});
{'fraction_non_alphanumeric': 0.2528375733855186, 'fraction_numerical': 0.01643835616438356, 'mean_word_length': 4.916666666666667, 'pattern_counts': {'":': 0, '<': 59, '<?xml version=': 0, '>': 59, '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': '3000569', 'n_tokens_mistral': 1066, 'n_tokens_neox': 941, 'n_words': 150}