Eric2mangel commited on
Commit
b309b37
·
1 Parent(s): 4a8c39d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +38 -1
app.py CHANGED
@@ -145,7 +145,7 @@ def predire(image, mouvements_selectionnes):
145
  ))
146
 
147
  # === Amélioration du design général ===
148
- fig.update_layout(
149
  template="plotly_white", # base moderne claire
150
  paper_bgcolor="rgba(0,0,0,0)", # fond transparent
151
  plot_bgcolor="rgba(245,247,250,1)", # gris bleuté clair moderne
@@ -178,7 +178,44 @@ def predire(image, mouvements_selectionnes):
178
  autosize=True,
179
  responsive=True,
180
  font=dict(size=13, family="Arial"),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
181
  )
 
182
 
183
  # Texte blanc à l’intérieur des barres
184
  fig.data[0].textfont = dict(color='white', size=14, family="Arial", weight="bold")
 
145
  ))
146
 
147
  # === Amélioration du design général ===
148
+ """fig.update_layout(
149
  template="plotly_white", # base moderne claire
150
  paper_bgcolor="rgba(0,0,0,0)", # fond transparent
151
  plot_bgcolor="rgba(245,247,250,1)", # gris bleuté clair moderne
 
178
  autosize=True,
179
  responsive=True,
180
  font=dict(size=13, family="Arial"),
181
+ )"""
182
+
183
+ fig.update_layout(
184
+ template="plotly_white",
185
+ paper_bgcolor="rgba(0,0,0,0)",
186
+ plot_bgcolor="rgba(245,247,250,1)",
187
+ autosize=True, # <-- autorise le redimensionnement
188
+ xaxis=dict(
189
+ fixedrange=True,
190
+ tickangle=30, # angle moins prononcé (plus lisible sur mobile)
191
+ tickfont=dict(size=14, color="#333"),
192
+ automargin=True,
193
+ showline=False,
194
+ zeroline=False
195
+ ),
196
+ yaxis=dict(
197
+ fixedrange=True,
198
+ range=[0, 1],
199
+ title="Probabilité",
200
+ tickfont=dict(size=13, color="#555"),
201
+ gridcolor="rgba(220,220,220,0.4)",
202
+ zeroline=False
203
+ ),
204
+ title=dict(
205
+ text=f"🎨 Mouvements picturaux reconnus (≥ {SEUIL_RECONNAISSANCE*100:.0f}%)",
206
+ y=0.93,
207
+ x=0.5,
208
+ xanchor='center',
209
+ font=dict(size=18, color="#333", family="Arial Black")
210
+ ),
211
+ # marges légèrement réduites pour éviter le rognage sur petit écran
212
+ margin=dict(l=40, r=20, t=70, b=70),
213
+ height=HAUTEUR_GRAPHIQUE, # garde la hauteur souhaitée
214
+ # NE PAS préciser `width` ici (laissons le navigateur décider)
215
+ font=dict(size=13, family="Arial"),
216
+ bargap=0.25
217
  )
218
+
219
 
220
  # Texte blanc à l’intérieur des barres
221
  fig.data[0].textfont = dict(color='white', size=14, family="Arial", weight="bold")