From 6c778882f94774f5bcf558810f4a13eb30dd2e92 Mon Sep 17 00:00:00 2001 From: Colin Maudry Date: Tue, 17 Mar 2026 20:51:09 +0100 Subject: [PATCH] =?UTF-8?q?Filtre=20par=20type=20de=20march=C3=A9=20#65?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/statistiques.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/pages/statistiques.py b/src/pages/statistiques.py index df71edd..4a1f970 100644 --- a/src/pages/statistiques.py +++ b/src/pages/statistiques.py @@ -81,6 +81,14 @@ layout = [ options=options_departements, ), ), + html.H5("Marché"), + dbc.Row( + dcc.Dropdown( + id="dashboard_marche_type", + placeholder="Type de marché", + options=get_enum_values_as_dict("type"), + ), + ), ], ), dbc.Col( @@ -104,9 +112,13 @@ layout = [ Input("dashboard_year", "value"), Input("dashboard_acheteur_categorie", "value"), Input("dashboard_acheteur_departement_code", "value"), + Input("dashboard_marche_type", "value"), ) def udpate_dashboard_cards( - dashboard_year, dashboard_acheteur_categorie, dashboard_acheteur_departement_code + dashboard_year, + dashboard_acheteur_categorie, + dashboard_acheteur_departement_code, + dashboard_marche_type, ): lff: pl.LazyFrame = df.lazy() lff = lff.select( @@ -136,6 +148,9 @@ def udpate_dashboard_cards( ) ) + if dashboard_marche_type: + lff = lff.filter(pl.col("type") == dashboard_marche_type) + # Génération des métriques dff = lff.collect()