Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -26,8 +26,8 @@ MODEL_FALLBACKS = [MODELS_DIR / "model.joblib", MODELS_DIR / "model.pkl"]
|
|
| 26 |
COLORS = {"pred": "#1f77b4", "actual": "#f2b702", "ref": "#5a5a5a"}
|
| 27 |
|
| 28 |
# ---- Plot sizing controls ----
|
| 29 |
-
CROSS_W =
|
| 30 |
-
CROSS_H =
|
| 31 |
TRACK_H = 740 # px (plotly height; width auto-fits column)
|
| 32 |
FONT_SZ = 13
|
| 33 |
|
|
@@ -35,7 +35,17 @@ FONT_SZ = 13
|
|
| 35 |
# Page / CSS
|
| 36 |
# =========================
|
| 37 |
st.set_page_config(page_title="ST_GeoMech_UCS", page_icon="logo.png", layout="wide")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
# Hide uploader helper text ("Drag and drop file here", limits, etc.)
|
| 40 |
st.markdown("""
|
| 41 |
<style>
|
|
@@ -80,7 +90,7 @@ def add_password_gate() -> None:
|
|
| 80 |
if st.session_state.get("auth_ok", False):
|
| 81 |
return
|
| 82 |
|
| 83 |
-
st.sidebar.image("logo.png", use_column_width=
|
| 84 |
st.sidebar.markdown("### ST_GeoMech_UCS\nSmart Thinking • Secure Access")
|
| 85 |
pwd = st.sidebar.text_input("Access key", type="password", placeholder="••••••••")
|
| 86 |
if st.sidebar.button("Unlock", type="primary"):
|
|
@@ -235,19 +245,31 @@ def track_plot(df, include_actual=True):
|
|
| 235 |
),
|
| 236 |
legend_title_text=""
|
| 237 |
)
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 251 |
return fig
|
| 252 |
|
| 253 |
# ---------- Preview modal (matplotlib) ----------
|
|
@@ -351,7 +373,7 @@ st.session_state.setdefault("dev_preview",False)
|
|
| 351 |
# =========================
|
| 352 |
# Branding in Sidebar
|
| 353 |
# =========================
|
| 354 |
-
st.sidebar.image("logo.png", use_column_width=
|
| 355 |
st.sidebar.markdown(
|
| 356 |
"<div style='font-weight:800;font-size:1.2rem;'>ST_GeoMech_UCS</div>"
|
| 357 |
"<div style='color:#667085;'>Real-Time UCS Tracking While Drilling</div>",
|
|
|
|
| 26 |
COLORS = {"pred": "#1f77b4", "actual": "#f2b702", "ref": "#5a5a5a"}
|
| 27 |
|
| 28 |
# ---- Plot sizing controls ----
|
| 29 |
+
CROSS_W = 450 # px (matplotlib figure size; Streamlit will still scale)
|
| 30 |
+
CROSS_H = 450
|
| 31 |
TRACK_H = 740 # px (plotly height; width auto-fits column)
|
| 32 |
FONT_SZ = 13
|
| 33 |
|
|
|
|
| 35 |
# Page / CSS
|
| 36 |
# =========================
|
| 37 |
st.set_page_config(page_title="ST_GeoMech_UCS", page_icon="logo.png", layout="wide")
|
| 38 |
+
st.markdown("""
|
| 39 |
+
<style>
|
| 40 |
+
/* Reusable logo style */
|
| 41 |
+
.brand-logo { width: 16px; height: auto; object-fit: contain; }
|
| 42 |
|
| 43 |
+
/* Sidebar header layout */
|
| 44 |
+
.sidebar-header { display:flex; align-items:center; gap:12px; }
|
| 45 |
+
.sidebar-header .text h1 { font-size: 1.05rem; margin:0; line-height:1.1; }
|
| 46 |
+
.sidebar-header .text .tag { font-size: .85rem; color:#6b7280; margin:2px 0 0; }
|
| 47 |
+
</style>
|
| 48 |
+
""", unsafe_allow_html=True)
|
| 49 |
# Hide uploader helper text ("Drag and drop file here", limits, etc.)
|
| 50 |
st.markdown("""
|
| 51 |
<style>
|
|
|
|
| 90 |
if st.session_state.get("auth_ok", False):
|
| 91 |
return
|
| 92 |
|
| 93 |
+
st.sidebar.image("logo.png", use_column_width=False)
|
| 94 |
st.sidebar.markdown("### ST_GeoMech_UCS\nSmart Thinking • Secure Access")
|
| 95 |
pwd = st.sidebar.text_input("Access key", type="password", placeholder="••••••••")
|
| 96 |
if st.sidebar.button("Unlock", type="primary"):
|
|
|
|
| 245 |
),
|
| 246 |
legend_title_text=""
|
| 247 |
)
|
| 248 |
+
BOLD = "Arial Black, Arial, sans-serif" # or "Open Sans Bold", "Helvetica Neue", etc.
|
| 249 |
+
|
| 250 |
+
fig.update_xaxes(
|
| 251 |
+
title_text="UCS (psi)",
|
| 252 |
+
title_font=dict(size=16, family=BOLD), # ← bold axis title
|
| 253 |
+
tickfont=dict(size=13, family=BOLD), # ← bold tick labels
|
| 254 |
+
side="top",
|
| 255 |
+
range=[xmin, xmax],
|
| 256 |
+
ticks="outside",
|
| 257 |
+
tickformat=",.0f",
|
| 258 |
+
tickmode="auto",
|
| 259 |
+
tick0=tick0,
|
| 260 |
+
showline=True, linewidth=1.2, linecolor="#444", mirror=True,
|
| 261 |
+
showgrid=True, gridcolor="rgba(0,0,0,0.12)", automargin=True
|
| 262 |
+
)
|
| 263 |
+
|
| 264 |
+
fig.update_yaxes(
|
| 265 |
+
title_text=ylab,
|
| 266 |
+
title_font=dict(size=16, family=BOLD), # ← bold axis title
|
| 267 |
+
tickfont=dict(size=13, family=BOLD), # ← bold tick labels
|
| 268 |
+
range=y_range,
|
| 269 |
+
ticks="outside",
|
| 270 |
+
showline=True, linewidth=1.2, linecolor="#444", mirror=True,
|
| 271 |
+
showgrid=True, gridcolor="rgba(0,0,0,0.12)", automargin=True
|
| 272 |
+
)
|
| 273 |
return fig
|
| 274 |
|
| 275 |
# ---------- Preview modal (matplotlib) ----------
|
|
|
|
| 373 |
# =========================
|
| 374 |
# Branding in Sidebar
|
| 375 |
# =========================
|
| 376 |
+
st.sidebar.image("logo.png", use_column_width=False)
|
| 377 |
st.sidebar.markdown(
|
| 378 |
"<div style='font-weight:800;font-size:1.2rem;'>ST_GeoMech_UCS</div>"
|
| 379 |
"<div style='color:#667085;'>Real-Time UCS Tracking While Drilling</div>",
|