Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Your name committed Oct 10, 2024
1 parent 01f5fe6 commit bab3427
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -608,10 +608,12 @@ function updateAgencies(type, states) {

function main(type, states, state_default, crimes, crime_starter) {

console.time()
state_default = Math.floor(Math.random()*states.length)
makeDataSourceDropdown()

make_dropdown('#state_dropdown', states, state_default)

if (type == "arrests") {
make_dropdown("#subcategory_dropdown", arrest_age_categories, "tot")
make_dropdown("#subsubcategory_dropdown", arrests_breakdown, "Race")
Expand All @@ -633,14 +635,14 @@ function main(type, states, state_default, crimes, crime_starter) {
toggle_display("#weaponsDiv", ["officers_assaulted"]);
$("#policeSex").show();
}

console.timeEnd()

// if (window.location.hash == "") {
// change_url(type)
//} else {
// change_data_from_url(type);
//}
document.addEventListener("DOMContentLoaded", function() {
console.time()
ctx = document.getElementById("graph").getContext('2d');
main_results = get_data(type, states);
table_data = main_results[0];
Expand All @@ -649,6 +651,7 @@ function main(type, states, state_default, crimes, crime_starter) {
all_data = main_results[3];
graph = makeGraph(type, crimes);
table = makeTable(type);
});
makeDataSourceDropdown()

console.timeEnd()
// makeDataSourceDropdown()
}

0 comments on commit bab3427

Please sign in to comment.