Make create_fig more general
This commit is contained in:
parent
ef8cab6330
commit
f9c14e442b
14
wsgi.py
14
wsgi.py
@ -198,6 +198,8 @@ def plot(
|
|||||||
def create_fig(
|
def create_fig(
|
||||||
url: str = "https://beschaeftigtenbefragung.verdi.de/",
|
url: str = "https://beschaeftigtenbefragung.verdi.de/",
|
||||||
importance_factor: float = 1.0,
|
importance_factor: float = 1.0,
|
||||||
|
landesbez_strs: list[str | None] | None = None,
|
||||||
|
fix_lims: bool = True,
|
||||||
):
|
):
|
||||||
curr_datetime = datetime.datetime.now()
|
curr_datetime = datetime.datetime.now()
|
||||||
try:
|
try:
|
||||||
@ -233,17 +235,19 @@ def create_fig(
|
|||||||
timestamp = Markup(f'<font color="red">{key} 10:00:00</font>')
|
timestamp = Markup(f'<font color="red">{key} 10:00:00</font>')
|
||||||
|
|
||||||
total = plot_df.loc[curr_datetime].sum()
|
total = plot_df.loc[curr_datetime].sum()
|
||||||
landesbez_strs = [None] + [
|
if landesbez_strs is None:
|
||||||
bez
|
landesbez_strs = [None] + [
|
||||||
for bez in plot_df.columns
|
bez
|
||||||
if plot_df.loc[curr_datetime][bez] >= importance_factor * total
|
for bez in plot_df.columns
|
||||||
]
|
if plot_df.loc[curr_datetime][bez] >= importance_factor * total
|
||||||
|
]
|
||||||
return (
|
return (
|
||||||
plot(
|
plot(
|
||||||
curr_datetime,
|
curr_datetime,
|
||||||
plot_df,
|
plot_df,
|
||||||
annotate_current=annotate_current,
|
annotate_current=annotate_current,
|
||||||
landesbez_str=landesbez_strs,
|
landesbez_str=landesbez_strs,
|
||||||
|
fix_lims=fix_lims,
|
||||||
),
|
),
|
||||||
df,
|
df,
|
||||||
df_state,
|
df_state,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user