feat: Added SVG as output format and made it default in dashboard
This commit is contained in:
parent
6ee0666039
commit
093ee5f073
2 changed files with 10 additions and 9 deletions
9
plot.py
9
plot.py
|
@ -37,7 +37,8 @@ print_today = today.isoformat()
|
|||
|
||||
filename_now = datetime.datetime.now().strftime("%Y%m%d%H%M%S")
|
||||
|
||||
force_renew = True
|
||||
force_renew_plots = False
|
||||
force_renew_dashboard = True
|
||||
|
||||
# https://www.tagesschau.de/ausland/europa/ursula-von-der-leyen-zu-corona-impfstoffen-101.html
|
||||
target_date_for_herd_immunity = datetime.date(2021, 9, 22)
|
||||
|
@ -289,7 +290,7 @@ def check_recreate_plot(plot_name):
|
|||
|
||||
archive_plot_filename = '{}/{}'.format(archive_folder, plot_name)
|
||||
|
||||
if os.path.isfile(archive_plot_filename + '.pdf') and not force_renew:
|
||||
if os.path.isfile(archive_plot_filename + '.pdf') and not force_renew_plots:
|
||||
print('Plot {} already exists'.format(plot_name))
|
||||
return False
|
||||
|
||||
|
@ -298,7 +299,7 @@ def check_recreate_plot(plot_name):
|
|||
def save_plot(plot_name):
|
||||
|
||||
folders = [archive_folder, site_folder]
|
||||
file_formats = ['pdf', 'png']
|
||||
file_formats = ['pdf', 'png', 'svg']
|
||||
file_template = '{folder}/{plot_name}.{format}'
|
||||
|
||||
for folder in folders:
|
||||
|
@ -747,7 +748,7 @@ def render_dashboard():
|
|||
stylesheet_filename = 'site/rki-dashboard.css'
|
||||
stylesheet_archive_filename = 'site/archive/{}/rki-dashboard.css'.format(filename_stand)
|
||||
|
||||
if os.path.isfile(dashboard_archive_filename) and not force_renew:
|
||||
if os.path.isfile(dashboard_archive_filename) and not force_renew_dashboard:
|
||||
print('Dashboard {} already exists'.format(dashboard_archive_filename))
|
||||
return
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue