From 8a3c5159b5bb7924625520d30ed4cceb1db9dc3f Mon Sep 17 00:00:00 2001 From: Benedikt Bastin Date: Wed, 17 Feb 2021 12:11:49 +0100 Subject: [PATCH] feat: Figures are now automatically generated --- dashboard_template.xhtml | 121 +++------------------------------------ plot.py | 43 ++++++++++++++ 2 files changed, 52 insertions(+), 112 deletions(-) diff --git a/dashboard_template.xhtml b/dashboard_template.xhtml index 5bc636a..35a6eb7 100644 --- a/dashboard_template.xhtml +++ b/dashboard_template.xhtml @@ -173,124 +173,21 @@

Plots

+ {% for fig in figures %}
- + + src="{{ fig['filename'] }}.png" + alt="{{ fig['caption'] }}" />
- Abbildung 1: - Tägliche Impfquote, kumulierte Impfungen und lineare Extrapolation bis 10 % der Bevölkerung Deutschlands
- Download als PNG - Download als PDF -
-
- -
- - - -
- Abbildung 2: - Tägliche Impfquote, kumulierte Impfungen und lineare Extrapolation bis 70 % der Bevölkerung Deutschlands
- Download als PNG - Download als PDF -
-
-
- - - -
- Abbildung 3: - Tägliche Impfquote, kumulierte Impfungen und lineare Extrapolation bis 100 % der Bevölkerung Deutschlands
- Download als PNG - Download als PDF -
-
-
- - - -
- Abbildung 4: - Tägliche Impfrate (Erst- und Zweitimpfung übereinander)
- Download als PNG - Download als PDF -
-
-
- - - -
- Abbildung 5: - Tägliche Impfrate (Erst- und Zweitimpfung nebeneinander)
- Download als PNG - Download als PDF -
-
-
- - - -
- Abbildung 6: - Tägliche Impfrate (Erst- und Zweitimpfung nebeneinander)
- Download als PNG - Download als PDF -
-
-
- - - -
- Abbildung 7: - Kumulative Impfrate (Erst- und Zweitimpfung)
- Download als PNG - Download als PDF -
-
-
- - - -
- Abbildung 8: - Kumulative Impfrate (Erst- und Zweitimpfung) in Prozent der Bevölkerung Deutschlands2
- Download als PNG - Download als PDF -
-
-
- - - -
- Abbildung 9: - Anzahl der Personen zwischen Erst- und Zweitimpfung, also Personen, die die erste Impfung erhalten haben, die zweite aber noch nicht
- Download als PNG - Download als PDF + Abbildung {{ fig['index'] }}: + {{ fig['caption'] }}
+ Download als PNG + Download als PDF
+ {% endfor %}
diff --git a/plot.py b/plot.py index eb15aae..906462f 100644 --- a/plot.py +++ b/plot.py @@ -717,6 +717,49 @@ def render_dashboard(): data_second_vaccination = data_second_vaccination, #details_per_land = dict(sorted(details_per_land_formatted.items(), key=lambda item: item[0])), #details_total = details_total_formatted + figures = [ + { + 'index': 1, + 'filename': 'extrapolated_to_10_percent', + 'caption': 'Tägliche Impfquote, kumulierte Impfungen und lineare Extrapolation bis 10 % der Bevölkerung Deutschlands' + },{ + 'index': 2, + 'filename': 'extrapolated_to_70_percent', + 'caption': 'Tägliche Impfquote, kumulierte Impfungen und lineare Extrapolation bis 70 % der Bevölkerung Deutschlands' + },{ + 'index': 3, + 'filename': 'extrapolated_to_100_percent', + 'caption': 'Tägliche Impfquote, kumulierte Impfungen und lineare Extrapolation bis 100 % der Bevölkerung Deutschlands' + },{ + 'index': 4, + 'filename': 'vaccination_bar_graph_total_time', + 'caption': 'Tägliche Impfrate (Erst- und Zweitimpfung übereinander)' + },{ + 'index': 5, + 'filename': 'vaccination_bar_graph_total_time_two_bars', + 'caption': 'Tägliche Impfrate (Erst- und Zweitimpfung nebeneinander)' + },{ + 'index': 6, + 'filename': 'vaccination_bar_graph_compare_both_vaccinations', + 'caption': 'Tägliche Impfrate (Erst- und Zweitimpfung nebeneinander)' + },{ + 'index': 7, + 'filename': 'cumulative_two_vaccinations', + 'caption': 'Kumulative Impfrate (Erst- und Zweitimpfung)' + },{ + 'index': 8, + 'filename': 'cumulative_two_vaccinations_percentage', + 'caption': 'Kumulative Impfrate (Erst- und Zweitimpfung) in Prozent der Bevölkerung Deutschlands' + },{ + 'index': 9, + 'filename': 'people_between_first_and_second', + 'caption': 'Anzahl der Personen zwischen Erst- und Zweitimpfung, also Personen, die die erste Impfung erhalten haben, die zweite aber noch nicht' + },{ + 'index': 10, + 'filename': 'vaccination_rate', + 'caption': 'Tägliche Impfrate sowie durchschnittliche Impfrate' + } + ] ).dump('site/index.xhtml') shutil.copyfile(dashboard_filename, dashboard_archive_filename)