diff --git a/indexSalaries.html b/indexSalaries.html index 0aa4df8..a7d2b81 100644 --- a/indexSalaries.html +++ b/indexSalaries.html @@ -12,14 +12,29 @@ // Load the Visualization API and the corechart package. google.charts.load('current', {'packages':['corechart']}); // Set a callback to run when the Google Visualization API is loaded. - google.charts.setOnLoadCallback(drawChart); +// NOTE: I've commented this function because cause an error due to the drawChart's parameter is not defined + //google.charts.setOnLoadCallback(drawChart); // get data from url let data = null; let url = "https://pollysnips.s3.amazonaws.com/bostonEmployeeSalaries.json" fetch(url).then((response) => response.json()) .then(json => { + /** + --------------------------------------------------------------------------------------------- + NOTE: I've added the following lines to enable the analyzeData button once the data is loaded + Also, I've added a loading message that hiddes once the data is loaded + --------------------------------------------------------------------------------------------- + **/ + analyzeData_btn = document.getElementById("analyzeData_btn") + loading_msg = document.getElementById("loading_msg") + loading_msg.hidden = true; + analyzeData_btn.disabled = false; + /** End of the added lines **/ + data = json; + // I've added this line to call the analyzeData function once the data is loaded + analyzeData() //writeData(JSON.stringify(data.data[0])); }) .catch(error => { @@ -39,9 +54,12 @@

Boston City Valued Workers

+ +

Loading Data

- + +