Amélioration du layout dans titulaire et acheteur
This commit is contained in:
+42
-40
@@ -117,44 +117,47 @@ layout = [
|
|||||||
className="mb-2",
|
className="mb-2",
|
||||||
children=[
|
children=[
|
||||||
dbc.Col(
|
dbc.Col(
|
||||||
html.Div(
|
className="org_infos",
|
||||||
className="org_infos",
|
children=[
|
||||||
children=[
|
# TODO: ajouter le type d'acheteur : commune, CD, CR, etc.
|
||||||
# TODO: ajouter le type d'acheteur : commune, CD, CR, etc.
|
html.P(
|
||||||
html.P(["Commune : ", html.Strong(id="acheteur_commune")]),
|
[
|
||||||
html.P(
|
"Commune : ",
|
||||||
[
|
html.Strong(id="acheteur_commune"),
|
||||||
"Département : ",
|
]
|
||||||
html.Strong(id="acheteur_departement"),
|
),
|
||||||
]
|
html.P(
|
||||||
),
|
[
|
||||||
html.P(["Région : ", html.Strong(id="acheteur_region")]),
|
"Département : ",
|
||||||
html.A(
|
html.Strong(id="acheteur_departement"),
|
||||||
id="acheteur_lien_annuaire",
|
]
|
||||||
children="Plus de détails sur l'Annuaire des entreprises",
|
),
|
||||||
),
|
html.P(
|
||||||
],
|
["Région : ", html.Strong(id="acheteur_region")]
|
||||||
),
|
),
|
||||||
|
html.A(
|
||||||
|
id="acheteur_lien_annuaire",
|
||||||
|
children="Plus de détails sur l'Annuaire des entreprises",
|
||||||
|
),
|
||||||
|
],
|
||||||
width=4,
|
width=4,
|
||||||
),
|
),
|
||||||
dbc.Col(
|
dbc.Col(
|
||||||
html.Div(
|
children=[
|
||||||
children=[
|
html.P(id="acheteur_titre_stats"),
|
||||||
html.P(id="acheteur_titre_stats"),
|
html.P(id="acheteur_marches_attribues"),
|
||||||
html.P(id="acheteur_marches_attribues"),
|
html.P(id="acheteur_titulaires_differents"),
|
||||||
html.P(id="acheteur_titulaires_differents"),
|
html.Button(
|
||||||
html.Button(
|
"Téléchargement au format Excel",
|
||||||
"Téléchargement au format Excel",
|
id="btn-download-data-acheteur",
|
||||||
id="btn-download-data-acheteur",
|
className="btn btn-primary",
|
||||||
className="btn btn-primary",
|
),
|
||||||
),
|
dcc.Download(id="download-data-acheteur"),
|
||||||
dcc.Download(id="download-data-acheteur"),
|
],
|
||||||
],
|
|
||||||
),
|
|
||||||
width=4,
|
width=4,
|
||||||
),
|
),
|
||||||
dbc.Col(
|
dbc.Col(
|
||||||
html.Div(id="acheteur_map"),
|
id="acheteur_map",
|
||||||
width=4,
|
width=4,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -162,17 +165,13 @@ layout = [
|
|||||||
dbc.Row(
|
dbc.Row(
|
||||||
children=[
|
children=[
|
||||||
dbc.Col(
|
dbc.Col(
|
||||||
html.Div(
|
className="marches_table",
|
||||||
children=[
|
id="top10_titulaires",
|
||||||
html.H3("Top titulaires"),
|
|
||||||
html.Div(className="marches_table", id="top10_titulaires"),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
width=8,
|
width=8,
|
||||||
),
|
),
|
||||||
|
dbc.Col(id="acheteur-distance-histogram", width=4),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
html.Div(id="acheteur-distance-histogram"),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
# récupérer les données de l'acheteur sur l'api annuaire
|
# récupérer les données de l'acheteur sur l'api annuaire
|
||||||
@@ -373,7 +372,8 @@ def get_last_marches_data(
|
|||||||
Input(component_id="acheteur_data", component_property="data"),
|
Input(component_id="acheteur_data", component_property="data"),
|
||||||
)
|
)
|
||||||
def get_top_titulaires(data):
|
def get_top_titulaires(data):
|
||||||
return get_top_org_table(data, "titulaire", ["titulaire_distance", "montant"])
|
table = get_top_org_table(data, "titulaire", ["titulaire_distance", "montant"])
|
||||||
|
return make_card(fig=table, title="Top titulaires", lg=12, xl=12)
|
||||||
|
|
||||||
|
|
||||||
@callback(
|
@callback(
|
||||||
@@ -522,4 +522,6 @@ def update_acheteur_distance_histogram(data):
|
|||||||
title="Distance acheteur–titulaire",
|
title="Distance acheteur–titulaire",
|
||||||
subtitle="en nombre de marchés, échelle logarithmique",
|
subtitle="en nombre de marchés, échelle logarithmique",
|
||||||
fig=fig,
|
fig=fig,
|
||||||
|
lg=12,
|
||||||
|
xl=12,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ layout = [
|
|||||||
[
|
[
|
||||||
dcc.Markdown(
|
dcc.Markdown(
|
||||||
"""
|
"""
|
||||||
Les données saisies et publiées par les acheteurs comportent de nombreux montants farfelus qui sabotent les statistiques, au lieu de montants estimés avec rigueur. On parle de montant atteignant parfois les millions de milliards. Certains réutilisateurs mettent de côté ces marchés ou bien modifient les montants selon des règles fatalement arbitraires. J'ai fait le choix de ne quasiment pas modifier les données* afin de visibiliser le problème.
|
Les données saisies et publiées par les acheteurs comportent de nombreux montants farfelus qui sabotent les statistiques, au lieu de montants estimés avec rigueur. On parle de montants atteignant parfois les millions de milliards. Certains réutilisateurs des données mettent de côté ces marchés ou bien modifient les montants selon des règles fatalement arbitraires. J'ai fait le choix de ne quasiment pas modifier les données* afin de visibiliser le problème.
|
||||||
|
|
||||||
Alors, on fait comment ?
|
Alors, on fait comment ?
|
||||||
|
|
||||||
|
|||||||
+48
-40
@@ -19,7 +19,6 @@ from src.callbacks import get_top_org_table
|
|||||||
from src.figures import (
|
from src.figures import (
|
||||||
DataTable,
|
DataTable,
|
||||||
get_distance_histogram,
|
get_distance_histogram,
|
||||||
make_card,
|
|
||||||
make_column_picker,
|
make_column_picker,
|
||||||
point_on_map,
|
point_on_map,
|
||||||
)
|
)
|
||||||
@@ -117,44 +116,50 @@ layout = [
|
|||||||
className="mb-2",
|
className="mb-2",
|
||||||
children=[
|
children=[
|
||||||
dbc.Col(
|
dbc.Col(
|
||||||
html.Div(
|
className="org_infos",
|
||||||
className="org_infos",
|
children=[
|
||||||
children=[
|
# TODO: ajouter le type d'acheteur : commune, CD, CR, etc.
|
||||||
# TODO: ajouter le type d'acheteur : commune, CD, CR, etc.
|
html.P(
|
||||||
html.P(["Commune : ", html.Strong(id="titulaire_commune")]),
|
[
|
||||||
html.P(
|
"Commune : ",
|
||||||
[
|
html.Strong(id="titulaire_commune"),
|
||||||
"Département : ",
|
]
|
||||||
html.Strong(id="titulaire_departement"),
|
),
|
||||||
]
|
html.P(
|
||||||
),
|
[
|
||||||
html.P(["Région : ", html.Strong(id="titulaire_region")]),
|
"Département : ",
|
||||||
html.A(
|
html.Strong(id="titulaire_departement"),
|
||||||
id="titulaire_lien_annuaire",
|
]
|
||||||
children="Plus de détails sur l'Annuaire des entreprises",
|
),
|
||||||
),
|
html.P(
|
||||||
],
|
[
|
||||||
),
|
"Région : ",
|
||||||
|
html.Strong(id="titulaire_region"),
|
||||||
|
]
|
||||||
|
),
|
||||||
|
html.A(
|
||||||
|
id="titulaire_lien_annuaire",
|
||||||
|
children="Plus de détails sur l'Annuaire des entreprises",
|
||||||
|
),
|
||||||
|
],
|
||||||
width=4,
|
width=4,
|
||||||
),
|
),
|
||||||
dbc.Col(
|
dbc.Col(
|
||||||
html.Div(
|
children=[
|
||||||
children=[
|
html.P(id="titulaire_titre_stats"),
|
||||||
html.P(id="titulaire_titre_stats"),
|
html.P(id="titulaire_marches_remportes"),
|
||||||
html.P(id="titulaire_marches_remportes"),
|
html.P(id="titulaire_acheteurs_differents"),
|
||||||
html.P(id="titulaire_acheteurs_differents"),
|
html.Button(
|
||||||
html.Button(
|
"Téléchargement au format Excel",
|
||||||
"Téléchargement au format Excel",
|
id="btn-download-data-titulaire",
|
||||||
id="btn-download-data-titulaire",
|
className="btn btn-primary",
|
||||||
className="btn btn-primary",
|
),
|
||||||
),
|
dcc.Download(id="download-data-titulaire"),
|
||||||
dcc.Download(id="download-data-titulaire"),
|
],
|
||||||
],
|
|
||||||
),
|
|
||||||
width=4,
|
width=4,
|
||||||
),
|
),
|
||||||
dbc.Col(
|
dbc.Col(
|
||||||
html.Div(id="titulaire_map"),
|
id="titulaire_map",
|
||||||
width=4,
|
width=4,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -165,14 +170,17 @@ layout = [
|
|||||||
html.Div(
|
html.Div(
|
||||||
children=[
|
children=[
|
||||||
html.H3("Top acheteurs"),
|
html.H3("Top acheteurs"),
|
||||||
html.Div(className="marches_table", id="top10_acheteurs"),
|
html.Div(
|
||||||
|
className="marches_table",
|
||||||
|
id="top10_acheteurs",
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
width=8,
|
width=8,
|
||||||
),
|
),
|
||||||
|
dbc.Col(id="titulaire-distance-histogram", width=4),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
html.Div(id="titulaire-distance-histogram"),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
# récupérer les données de l'acheteur sur l'api annuaire
|
# récupérer les données de l'acheteur sur l'api annuaire
|
||||||
@@ -536,8 +544,8 @@ def update_titulaire_distance_histogram(data):
|
|||||||
pl.col("titulaire_distance").cast(pl.Float64, strict=False)
|
pl.col("titulaire_distance").cast(pl.Float64, strict=False)
|
||||||
)
|
)
|
||||||
fig = get_distance_histogram(lff)
|
fig = get_distance_histogram(lff)
|
||||||
return make_card(
|
return [
|
||||||
title="Distance acheteur–titulaire",
|
html.H3("Distance acheteur-titulaire"),
|
||||||
subtitle="en nombre de marchés, échelle logarithmique",
|
html.H6("par nombre de marchés", className="card-subtitle mb-2 text-muted"),
|
||||||
fig=fig,
|
fig,
|
||||||
)
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user