Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +9 -9
src/streamlit_app.py
CHANGED
|
@@ -39,8 +39,6 @@ try:
|
|
| 39 |
st.stop()
|
| 40 |
|
| 41 |
# Family Selector
|
| 42 |
-
# Note: If you decoded labels back to text, this will show text.
|
| 43 |
-
# If not, it will show the encoded ID numbers.
|
| 44 |
if 'family' in df.columns:
|
| 45 |
family_list = sorted(df['family'].unique())
|
| 46 |
selected_family = st.sidebar.selectbox("Select Product Category (Family)", family_list)
|
|
@@ -62,8 +60,14 @@ try:
|
|
| 62 |
labels={'Predicted_Sales': 'Predicted Sales Volume', 'date': 'Date'},
|
| 63 |
markers=True)
|
| 64 |
|
| 65 |
-
#
|
| 66 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
st.plotly_chart(fig, use_container_width=True)
|
| 68 |
|
| 69 |
# Show Data Table
|
|
@@ -76,8 +80,4 @@ try:
|
|
| 76 |
except FileNotFoundError:
|
| 77 |
st.error("Error: 'dashboard_data.csv' not found. Please upload the file to Hugging Face Files.")
|
| 78 |
except Exception as e:
|
| 79 |
-
st.error(f"An unexpected error occurred: {e}")
|
| 80 |
-
|
| 81 |
-
# Footer / Credits
|
| 82 |
-
st.markdown("---")
|
| 83 |
-
st.markdown("Created with ❤️ using **Streamlit** and **XGBoost**.")
|
|
|
|
| 39 |
st.stop()
|
| 40 |
|
| 41 |
# Family Selector
|
|
|
|
|
|
|
| 42 |
if 'family' in df.columns:
|
| 43 |
family_list = sorted(df['family'].unique())
|
| 44 |
selected_family = st.sidebar.selectbox("Select Product Category (Family)", family_list)
|
|
|
|
| 60 |
labels={'Predicted_Sales': 'Predicted Sales Volume', 'date': 'Date'},
|
| 61 |
markers=True)
|
| 62 |
|
| 63 |
+
# --- DÜZELTİLEN KISIM (FIXED PART) ---
|
| 64 |
+
# Renk ayarını 'update_traces' içine aldık (Layout hatasını çözer)
|
| 65 |
+
fig.update_traces(line_color='#00CC96')
|
| 66 |
+
|
| 67 |
+
# Layout ayarları sadece hover (üzerine gelince çıkan bilgi) için kaldı
|
| 68 |
+
fig.update_layout(hovermode="x unified")
|
| 69 |
+
# -------------------------------------
|
| 70 |
+
|
| 71 |
st.plotly_chart(fig, use_container_width=True)
|
| 72 |
|
| 73 |
# Show Data Table
|
|
|
|
| 80 |
except FileNotFoundError:
|
| 81 |
st.error("Error: 'dashboard_data.csv' not found. Please upload the file to Hugging Face Files.")
|
| 82 |
except Exception as e:
|
| 83 |
+
st.error(f"An unexpected error occurred: {e}")
|
|
|
|
|
|
|
|
|
|
|
|