From bab3427034f6fb48d5ae7fbba2ced85c9eaf9459 Mon Sep 17 00:00:00 2001 From: Your name Date: Thu, 10 Oct 2024 13:00:11 -0400 Subject: [PATCH] . --- js/utils.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/js/utils.js b/js/utils.js index 50718a6..64e41d2 100644 --- a/js/utils.js +++ b/js/utils.js @@ -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") @@ -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]; @@ -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() }