Configuration fine des tailles de cartes #65
This commit is contained in:
@@ -423,6 +423,11 @@ input[type="checkbox"] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* --- Organization Cards (Grid Items) --- */
|
/* --- Organization Cards (Grid Items) --- */
|
||||||
|
|
||||||
|
#cards .card {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
.org_title {
|
.org_title {
|
||||||
grid-column: 1 / 3;
|
grid-column: 1 / 3;
|
||||||
grid-row: 1;
|
grid-row: 1;
|
||||||
|
|||||||
+5
-7
@@ -509,9 +509,9 @@ def get_geographic_maps(dff: pl.DataFrame) -> list | None:
|
|||||||
else:
|
else:
|
||||||
raise ValueError(f"Map type '{map_type}' not recognised")
|
raise ValueError(f"Map type '{map_type}' not recognised")
|
||||||
|
|
||||||
md = 6 if code == "Métropole" else 3
|
lg, xl = (12, 8) if code == "Métropole" else (6, 4)
|
||||||
|
|
||||||
col = make_card(regions[code]["name"], md=md, fig=map_graph)
|
col = make_card(regions[code]["name"], fig=map_graph, lg=lg, xl=xl)
|
||||||
cols.append(col)
|
cols.append(col)
|
||||||
|
|
||||||
return cols
|
return cols
|
||||||
@@ -526,11 +526,9 @@ def make_chloropleth_map(region: dict) -> dcc.Graph:
|
|||||||
locations="Département",
|
locations="Département",
|
||||||
color="uid",
|
color="uid",
|
||||||
color_continuous_scale="Reds",
|
color_continuous_scale="Reds",
|
||||||
title="Nombres de marchés attribués",
|
|
||||||
range_color=(df_map["uid"].min(), df_map["uid"].max()),
|
range_color=(df_map["uid"].min(), df_map["uid"].max()),
|
||||||
labels={"uid": "Marchés attribués"},
|
labels={"uid": "Marchés attribués"},
|
||||||
scope="europe",
|
scope="europe",
|
||||||
height=400,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
fig.update_geos(fitbounds="locations", visible=False)
|
fig.update_geos(fitbounds="locations", visible=False)
|
||||||
@@ -602,7 +600,7 @@ def make_clusters_map(region: dict) -> dl.Map:
|
|||||||
|
|
||||||
|
|
||||||
def make_card(
|
def make_card(
|
||||||
title: str, subtitle=None, fig=None, paragraphs=None, md=3, width=12
|
title: str, subtitle=None, fig=None, paragraphs=None, lg=6, xl=4
|
||||||
) -> dbc.Col:
|
) -> dbc.Col:
|
||||||
children = []
|
children = []
|
||||||
if title:
|
if title:
|
||||||
@@ -618,8 +616,8 @@ def make_card(
|
|||||||
|
|
||||||
card = dbc.Col(
|
card = dbc.Col(
|
||||||
html.Div(html.Div(className="card-body", children=children), className="card"),
|
html.Div(html.Div(className="card-body", children=children), className="card"),
|
||||||
lg=6,
|
lg=lg,
|
||||||
xl=4,
|
xl=xl,
|
||||||
# width=width,
|
# width=width,
|
||||||
# className="mb-4",
|
# className="mb-4",
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user