Source code for the macroscopic interactive Javascript simulation at corona-simulation.de. The aggregation level is one country. Several interesting countries such as Germany, Switzerland, Sweden, the US, or India can be chosen. For model details and usage of the simulator including some examples see the info page of corona-simulation.de
This simulation uses JavaScript together with html5.
The simulation is driven by index.html
which starts the actual
simulation coded in corona.js
and corona_gui.js
At initialization, the canvas referenced by
<canvas id="myCanvas"...>some text for old browsers </canvas>
is defined and its size adapted to the viewport. Furthermore, the html drives some initialization via
<body onload="startup()">
This project uses the Covid-19
data that have been
brought into the json
format by the ressources of the Github repo pomber/covid19
The javascript code uses the pseudo objects CoronaSim
and
DrawSim
that do what is expected by their names. Particularly,
both have a method .updateOneDay
that defines the timestep:
one day:
TODO