About this stage
In this stage, we'd like to capture some of the data in a table so we can graph the infection over time.
Then, we will be able to see if our efforts to stop the virus are successful.
Who knew you could use JavaScript to write to a table dynamically. Our old friend, W3Schools led the way in helping us generate this infection data. Once we had it, we had an EXCEL-lent opportunity to dust off our spreadsheet skills and visualize the information.
Ponder Points (Simulitis ~ Stage 7)
- We used a pre-existing function to capture the infection percent data as a function of elapsed time and tablularize it. What's the function that contains this code?
- If you are having trouble finding an answer to Ponder Point #1 above, it's understandable. There are nearly 500 lines of code in sketch7.js. But since our caring developers heavily comment their code, perhaps you can search for a keyword like 'table' and find what you're looking for. What other variables were used to construct the table? In particular, the entries are spaced by every 50 time units. What variable controls that?
- The table is currently unformatted (no CSS, yet). Rummage around in the Processing apps here at Tech Novice and undoubtedly, you will find an app with tabular data that DOES have a nice format, consistent with the TNT theme. Find one? Great! What is it? Are there more than one? Perhaps we could 'steal' the formatting and apply it to our table here.
- Refresh the app and run it with default values. Copy the data, paste it in Excel and find a way to graph the data there as a 'Scatter Plot' with straight lines and markers. Put a title on the chart and save it as 'stage7DefaultInfectionGraph.xlsx' and put it with your other documents for your instructor to evaluate.
Last update: 03/16/20
Stats:
Elapsed time:
Healthy:
Infected:
Recovered:
Infection Table
| Time | % Infected |
|---|