detecteurs.py: center the image with its slider below, legend on top so it no longer overlaps the Error rate colorbar

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
maximeandClaude Opus 5.5 committed 2026-10-27 10:24:09 +01:00
1 parent 1057aadd2b
commit 7fa79cb941
1 file changed
+5 -4
+5 -4
View File
@@ -153,8 +153,9 @@ def page(dossier, du=None, au=None, entete="", annexe="", chemin=None):
fig.add_trace(d, row=3 + c, col=1)
fig.add_trace(comparaison.taux_erreur(mesures, a, b), row=4 + c, col=1)
fig.update_layout(bargap=0.3, height=680 + 230 * c + 30 * len(ordre), hovermode="closest",
plot_bgcolor="white", margin={"l": 170, "r": 170, "t": 40, "b": 40},
legend={"x": 1.02, "y": 1, "yanchor": "top", "title": {"text": "clic : cacher<br>double clic : seul"}})
plot_bgcolor="white", margin={"l": 170, "r": 90, "t": 40, "b": 40},
legend={"orientation": "h", "x": 0, "y": 1.02, "yanchor": "bottom", # au-dessus : à droite, la barre de l'Error rate
"title": {"text": "clic : cacher, double clic : seul", "side": "top left"}})
for t in fig.data: # légende : la pose de la caméra et les capteurs seuls
if t.showlegend is None:
t.showlegend = t.name in dict(POSE)
@@ -176,9 +177,9 @@ def page(dossier, du=None, au=None, entete="", annexe="", chemin=None):
cadre = {k: [min(h[i] for h in maisons) - MARGE_PX, max(h[i] for h in maisons) + MARGE_PX]
for i, k in enumerate("xy")} if maisons else None
script += IMAGES_JS.replace("__IMAGES__", json.dumps(images)).replace("__VUE__", json.dumps(cadre))
vue = f"""<div><button id="prec">◀</button> <input id="glis" type="range" min="0" max="{len(images) - 1}" value="0"
vue = f"""<img id="img" alt="image de la caméra" style="max-width:100%;max-height:60vh;margin:8px auto;display:block">
<div style="text-align:center"><button id="prec">◀</button> <input id="glis" type="range" min="0" max="{len(images) - 1}" value="0"
style="width:min(60em,70vw);vertical-align:middle"> <button id="suiv">▶</button> <span id="heure" style="font-variant-numeric:tabular-nums"></span></div>
<img id="img" alt="image de la caméra" style="max-width:100%;max-height:60vh;margin:8px 0;display:block">
<div id="gif" hidden><div><canvas></canvas><div><button id="gif-av">◀</button> <button id="gif-p">❚❚</button>
<button id="gif-ap">▶</button> <button id="gif-x">✕</button> <span id="gif-info"></span></div></div></div>"""
corps = fig.to_html(include_plotlyjs="cdn", full_html=False, div_id="fig", post_script=script, config={"scrollZoom": False})