design layout fix

This commit is contained in:
Jesselyn Mu
2025-02-01 12:36:28 +07:00
parent 49f1f93bd9
commit 84f08f24c6
9 changed files with 15417 additions and 8535 deletions

View File

@ -462,41 +462,7 @@ def show_prediction():
col1, col2 = st.columns([1.5, 2]) # **Kolom pertama untuk grafik, kolom kedua untuk penjelasan**
with col1:
# st.image(buf, caption="SHAP Waterfall Plot", use_container_width=True)
# Tambahkan CSS styling ke HTML
st.markdown(
"""
<style>
.shap-container {
display: flex;
justify-content: center;
align-items: center;
margin-top: 10px;
}
.shap-image {
border-radius: 10px; /* Sudut membulat */
box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.2); /* Shadow */
border: 2px solid #ddd; /* Stroke */
padding: 5px; /* Ruang di dalam border */
background: white; /* Biar keliatan efeknya */
max-width: 100%; /* Biar responsif */
}
.shap-caption {
text-align: center;
font-size: 14px;
font-family: 'Poppins', sans-serif;
color: #555;
margin-top: 5px;
}
</style>
""",
unsafe_allow_html=True
)
# Gunakan `st.image()` untuk menampilkan gambar SHAP dari `buf`
st.markdown('<div class="shap-container">', unsafe_allow_html=True)
st.image(buf, caption="SHAP Waterfall Plot", use_container_width=True)
st.markdown('</div>', unsafe_allow_html=True)
with col2:
top_factors = sorted(shap_dict.items(), key=lambda x: abs(x[1]), reverse=True)[:5]