Commit ·
cd080af
1
Parent(s): d261ec8
start
Browse files- __pycache__/app.cpython-312.pyc +0 -0
- app.py +5 -0
__pycache__/app.cpython-312.pyc
CHANGED
|
Binary files a/__pycache__/app.cpython-312.pyc and b/__pycache__/app.cpython-312.pyc differ
|
|
|
app.py
CHANGED
|
@@ -5,6 +5,7 @@ import json
|
|
| 5 |
import os
|
| 6 |
|
| 7 |
st.set_page_config(page_title="Crypto Dash", layout="wide")
|
|
|
|
| 8 |
|
| 9 |
def load_report_data() -> dict:
|
| 10 |
"""Load report data from data.json next to app.py.
|
|
@@ -76,6 +77,10 @@ else:
|
|
| 76 |
st.warning(f"Plotly не отрисован ({exc}). Показываю fallback-график Streamlit.")
|
| 77 |
st.area_chart(df_cohorts.set_index("cohort_day")["user_count"])
|
| 78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
with debug_col:
|
| 80 |
st.caption("Chart debug")
|
| 81 |
st.metric("Rows", len(df_cohorts))
|
|
|
|
| 5 |
import os
|
| 6 |
|
| 7 |
st.set_page_config(page_title="Crypto Dash", layout="wide")
|
| 8 |
+
IS_HF_SPACE = bool(os.getenv("SPACE_ID") or os.getenv("SPACE_REPO_NAME"))
|
| 9 |
|
| 10 |
def load_report_data() -> dict:
|
| 11 |
"""Load report data from data.json next to app.py.
|
|
|
|
| 77 |
st.warning(f"Plotly не отрисован ({exc}). Показываю fallback-график Streamlit.")
|
| 78 |
st.area_chart(df_cohorts.set_index("cohort_day")["user_count"])
|
| 79 |
|
| 80 |
+
if IS_HF_SPACE:
|
| 81 |
+
st.caption("HF fallback chart")
|
| 82 |
+
st.area_chart(df_cohorts.set_index("cohort_day")["user_count"])
|
| 83 |
+
|
| 84 |
with debug_col:
|
| 85 |
st.caption("Chart debug")
|
| 86 |
st.metric("Rows", len(df_cohorts))
|