commit | c3b457a1fb3f644ec8d73baa8f80f9efd297a359 | [log] [tgz] |
---|---|---|
author | avm99963 <me@avm99963.com> | Tue Jul 21 14:23:15 2020 +0200 |
committer | avm99963 <me@avm99963.com> | Tue Jul 21 15:43:47 2020 +0200 |
tree | 89c5a3057f84fd368e62e6da6f8e64944b0345c2 | |
parent | 965cba77796bd0d076fbdf881f0919483bbb442d [diff] |
Adds ability to generate graphs for custom areas This commit adds the ability to generate individual PNG and SVG graphs for custom areas, defined as the union of several "Àrees Bàsiques de Salut" (ABS) in the config/customAreas.php file. Change-Id: I27f34b4a8f520a38c55eed224554b470c5ba2938
This is the code for https://covid-19.sandbox.avm99963.com, which contains graphs which determine the level of risk of each Catalan health area due to the COVID-19, based on the work of the BIOCOMSC group at the Polytechnic University of Catalonia (UPC).
It can also be used to generate risk graphs for custom areas by defining these areas in the config/customAreas.php
file.
DISCLAIMER: The data shown in the website might be wrong due to a wrong implementation.
This software is meant to be used with Apache2 in order to serve a static website including the latest Covid-19 data.
To install it, follow these steps:
git clone "https://gerrit.avm99963.com/covid19"
.covid19/cron
and runs the bash generate.bash
command every day early in the morning.crontab -e
and place the following line at the end of the document: 0 2 * * * (cd /path/to/covid19/cron/ && bash generate.bash)
Each day, the generate.bash
script will generate the graphs at the covid19/output
folder.
bash generate.bash
command anytime from the covid19/cron
directory in order to manually generate the graphs.This is what each file does:
index.html
: a web accessible document which includes a disclaimer text, a key for the graphs, and the generated graphs themselves.cron
folder: a non-web accessible folder which contains programs which ultimately generate the graphs.cron/generate.bash
: a Bash script which orchestrates all the other programs in the folder in order to generate the graphs.cron/generateData.php
: a PHP script which extracts the Covid-19 data from the Generalitat de Catalunya's API and analyzes that data to generate the ρ7 and IA14 values needed by cron/generateGraphs.gnu
to generate the graphs for each health area.cron/generateGraphs.gnu
: a gnuplot script which generates the graphs with the data which has been provided by the cron/generateData.php
. It uses the helper script cron/plot.gnu
.cron/generateCustomData.php
: a PHP script analogous to cron/generateData.php
which generates the data for custom areas defined in config/customAreas.php
.cron/generateCustomGraph.gnu
: a PHP script analogous to cron/generateGraphs.gnu
which generates the graph of a custom area using the data provided by the previous script.config/config.php
: a file where general settings can be set.config/customAreas.php
: a file where the custom areas can be defined.output
folder: a folder created by the generate.bash
script where the generated graphs are saved.