Spaces:
Running
Running
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +6 -12
src/streamlit_app.py
CHANGED
|
@@ -10,24 +10,18 @@ st.set_page_config(page_title="Brake Performance Lab", layout="wide", page_icon=
|
|
| 10 |
# --- FORÇAGE CSS NOIR ABSOLU POUR STREAMLIT ---
|
| 11 |
st.markdown("""
|
| 12 |
<style>
|
| 13 |
-
/* Tous les textes Streamlit en Noir pur */
|
| 14 |
html, body, [class*="css"], .stMarkdown, p, span, label {
|
| 15 |
color: #000000 !important;
|
| 16 |
font-weight: 500 !important;
|
| 17 |
}
|
| 18 |
-
/* Metrics en Noir pur */
|
| 19 |
[data-testid="stMetricValue"] { color: #000000 !important; font-weight: 800 !important; font-size: 22px !important; }
|
| 20 |
[data-testid="stMetricLabel"] { color: #000000 !important; font-weight: bold !important; }
|
| 21 |
-
|
| 22 |
-
/* Contours des boites d'analyse */
|
| 23 |
[data-testid="column"] {
|
| 24 |
padding: 10px !important;
|
| 25 |
border: 2px solid #000000 !important;
|
| 26 |
border-radius: 8px !important;
|
| 27 |
background-color: #ffffff !important;
|
| 28 |
}
|
| 29 |
-
|
| 30 |
-
/* Alerte rouge/verte bien flashy */
|
| 31 |
.alert-red { color: #D32F2F !important; font-weight: 900 !important; font-size: 13px; }
|
| 32 |
.check-green { color: #2E7D32 !important; font-weight: 900 !important; font-size: 13px; }
|
| 33 |
</style>
|
|
@@ -100,13 +94,13 @@ try:
|
|
| 100 |
fig.add_trace(go.Scatter(x=x_range, y=row['dry a']*x_range+row['dry b'], mode='lines', name=f"{row['model name']} (Dry)", line=dict(color=color, width=4), hovertemplate=f"<b>{row['model name']}</b><br>Perf: %{{y:.1f}} N<extra></extra>"))
|
| 101 |
if n_dry > 0:
|
| 102 |
xt = (n_dry - row['dry b']) / row['dry a']
|
| 103 |
-
if xt <= 200: fig.add_trace(go.Scatter(x=[xt], y=[n_dry], mode='markers+text', text=[f"{round(xt,1)}N"], textfont=dict(color="black", size=12), textposition="top center", marker=dict(color=color, size=10, symbol='x'), showlegend=False))
|
| 104 |
|
| 105 |
if condition_view in ["Both", "Wet only"]:
|
| 106 |
fig.add_trace(go.Scatter(x=x_range, y=row['wet a']*x_range+row['wet b'], mode='lines', name=f"{row['model name']} (Wet)", line=dict(color=color, width=3, dash='dot'), hovertemplate=f"<b>{row['model name']}</b><br>Perf: %{{y:.1f}} N<extra></extra>"))
|
| 107 |
if n_wet > 0:
|
| 108 |
xtw = (n_wet - row['wet b']) / row['wet a']
|
| 109 |
-
if xtw <= 200: fig.add_trace(go.Scatter(x=[xtw], y=[n_wet], mode='markers+text', text=[f"{round(xtw,1)}N"], textfont=dict(color="black", size=12), textposition="bottom center", marker=dict(color=color, size=10, symbol='circle-open'), showlegend=False))
|
| 110 |
|
| 111 |
# Lignes de normes
|
| 112 |
if n_dry > 0 and (condition_view in ["Both", "Dry only"]):
|
|
@@ -116,15 +110,15 @@ try:
|
|
| 116 |
|
| 117 |
fig.add_vline(x=x_input, line_width=2, line_dash="dash", line_color="#000000")
|
| 118 |
|
| 119 |
-
# --- NOIR TOTAL
|
| 120 |
fig.update_layout(
|
| 121 |
height=480,
|
| 122 |
-
xaxis=dict(title="Lever Effort [N]", color="#000000", linecolor="#000000", linewidth=3, tickfont=dict(color="#000000", size=13,
|
| 123 |
-
yaxis=dict(title="Performance [N]", color="#000000", linecolor="#000000", linewidth=3, tickfont=dict(color="#000000", size=13,
|
| 124 |
font=dict(color="#000000", size=12),
|
| 125 |
plot_bgcolor='white', paper_bgcolor='white',
|
| 126 |
hovermode="x unified",
|
| 127 |
-
legend=dict(font=dict(color="#000000", size=12,
|
| 128 |
)
|
| 129 |
st.plotly_chart(fig, use_container_width=True)
|
| 130 |
|
|
|
|
| 10 |
# --- FORÇAGE CSS NOIR ABSOLU POUR STREAMLIT ---
|
| 11 |
st.markdown("""
|
| 12 |
<style>
|
|
|
|
| 13 |
html, body, [class*="css"], .stMarkdown, p, span, label {
|
| 14 |
color: #000000 !important;
|
| 15 |
font-weight: 500 !important;
|
| 16 |
}
|
|
|
|
| 17 |
[data-testid="stMetricValue"] { color: #000000 !important; font-weight: 800 !important; font-size: 22px !important; }
|
| 18 |
[data-testid="stMetricLabel"] { color: #000000 !important; font-weight: bold !important; }
|
|
|
|
|
|
|
| 19 |
[data-testid="column"] {
|
| 20 |
padding: 10px !important;
|
| 21 |
border: 2px solid #000000 !important;
|
| 22 |
border-radius: 8px !important;
|
| 23 |
background-color: #ffffff !important;
|
| 24 |
}
|
|
|
|
|
|
|
| 25 |
.alert-red { color: #D32F2F !important; font-weight: 900 !important; font-size: 13px; }
|
| 26 |
.check-green { color: #2E7D32 !important; font-weight: 900 !important; font-size: 13px; }
|
| 27 |
</style>
|
|
|
|
| 94 |
fig.add_trace(go.Scatter(x=x_range, y=row['dry a']*x_range+row['dry b'], mode='lines', name=f"{row['model name']} (Dry)", line=dict(color=color, width=4), hovertemplate=f"<b>{row['model name']}</b><br>Perf: %{{y:.1f}} N<extra></extra>"))
|
| 95 |
if n_dry > 0:
|
| 96 |
xt = (n_dry - row['dry b']) / row['dry a']
|
| 97 |
+
if xt <= 200: fig.add_trace(go.Scatter(x=[xt], y=[n_dry], mode='markers+text', text=[f"{round(xt,1)}N"], textfont=dict(color="black", size=12, weight=700), textposition="top center", marker=dict(color=color, size=10, symbol='x'), showlegend=False))
|
| 98 |
|
| 99 |
if condition_view in ["Both", "Wet only"]:
|
| 100 |
fig.add_trace(go.Scatter(x=x_range, y=row['wet a']*x_range+row['wet b'], mode='lines', name=f"{row['model name']} (Wet)", line=dict(color=color, width=3, dash='dot'), hovertemplate=f"<b>{row['model name']}</b><br>Perf: %{{y:.1f}} N<extra></extra>"))
|
| 101 |
if n_wet > 0:
|
| 102 |
xtw = (n_wet - row['wet b']) / row['wet a']
|
| 103 |
+
if xtw <= 200: fig.add_trace(go.Scatter(x=[xtw], y=[n_wet], mode='markers+text', text=[f"{round(xtw,1)}N"], textfont=dict(color="black", size=12, weight=700), textposition="bottom center", marker=dict(color=color, size=10, symbol='circle-open'), showlegend=False))
|
| 104 |
|
| 105 |
# Lignes de normes
|
| 106 |
if n_dry > 0 and (condition_view in ["Both", "Dry only"]):
|
|
|
|
| 110 |
|
| 111 |
fig.add_vline(x=x_input, line_width=2, line_dash="dash", line_color="#000000")
|
| 112 |
|
| 113 |
+
# --- NOIR TOTAL AVEC 'WEIGHT' AU LIEU DE 'BOLD' ---
|
| 114 |
fig.update_layout(
|
| 115 |
height=480,
|
| 116 |
+
xaxis=dict(title="Lever Effort [N]", color="#000000", linecolor="#000000", linewidth=3, tickfont=dict(color="#000000", size=13, weight=700), gridcolor="#E0E0E0"),
|
| 117 |
+
yaxis=dict(title="Performance [N]", color="#000000", linecolor="#000000", linewidth=3, tickfont=dict(color="#000000", size=13, weight=700), gridcolor="#E0E0E0"),
|
| 118 |
font=dict(color="#000000", size=12),
|
| 119 |
plot_bgcolor='white', paper_bgcolor='white',
|
| 120 |
hovermode="x unified",
|
| 121 |
+
legend=dict(font=dict(color="#000000", size=12, weight=700), bordercolor="#000000", borderwidth=2, bgcolor="white")
|
| 122 |
)
|
| 123 |
st.plotly_chart(fig, use_container_width=True)
|
| 124 |
|