Autoselecting the frist KPI if kpis are available (#539)

This commit is contained in:
Philipp Horstenkamp 2024-01-10 21:00:55 +01:00 committed by GitHub
parent 26292a9dea
commit 2df13e6896
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -89,6 +89,10 @@ def financial_metrics_layout(session: Session, selected_company_id: int) -> html
id="metrics-dropdown",
options=available_metrics,
placeholder="Kennzahl",
value=list(available_metrics.keys())[0]
if available_metrics
else None,
clearable=False,
),
],
),
@ -109,7 +113,6 @@ def financial_metrics_layout(session: Session, selected_company_id: int) -> html
Output("finance-fig", "children"),
Input("metrics-dropdown", "value"),
[State("store-finance-df", "data")],
prevent_initial_call=True,
)
def update_figure(value: str, data: str) -> html:
"""Update graph after selecting from dropdown.