diff --git a/wsgi.py b/wsgi.py index defe430..087cc6f 100644 --- a/wsgi.py +++ b/wsgi.py @@ -198,6 +198,8 @@ def plot( def create_fig( url: str = "https://beschaeftigtenbefragung.verdi.de/", importance_factor: float = 1.0, + landesbez_strs: list[str | None] | None = None, + fix_lims: bool = True, ): curr_datetime = datetime.datetime.now() try: @@ -233,17 +235,19 @@ def create_fig( timestamp = Markup(f'{key} 10:00:00') total = plot_df.loc[curr_datetime].sum() - landesbez_strs = [None] + [ - bez - for bez in plot_df.columns - if plot_df.loc[curr_datetime][bez] >= importance_factor * total - ] + if landesbez_strs is None: + landesbez_strs = [None] + [ + bez + for bez in plot_df.columns + if plot_df.loc[curr_datetime][bez] >= importance_factor * total + ] return ( plot( curr_datetime, plot_df, annotate_current=annotate_current, landesbez_str=landesbez_strs, + fix_lims=fix_lims, ), df, df_state,