Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,28 +1,42 @@
|
|
| 1 |
-
from st_pages import Page, show_pages
|
| 2 |
-
from pathlib import Path
|
| 3 |
import streamlit as st
|
|
|
|
| 4 |
|
| 5 |
# Configure page settings
|
| 6 |
st.set_page_config(
|
| 7 |
-
page_title="Social Media
|
| 8 |
page_icon="📊",
|
| 9 |
layout="wide",
|
| 10 |
initial_sidebar_state="expanded"
|
| 11 |
)
|
| 12 |
|
| 13 |
-
#
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
])
|
| 25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
# import streamlit as st
|
| 28 |
# from pathlib import Path
|
|
|
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
from pathlib import Path
|
| 3 |
|
| 4 |
# Configure page settings
|
| 5 |
st.set_page_config(
|
| 6 |
+
page_title="Social Media Addiction Insights",
|
| 7 |
page_icon="📊",
|
| 8 |
layout="wide",
|
| 9 |
initial_sidebar_state="expanded"
|
| 10 |
)
|
| 11 |
|
| 12 |
+
# Sidebar navigation
|
| 13 |
+
st.sidebar.title("Navigation")
|
| 14 |
+
page = st.sidebar.radio("Go to", [
|
| 15 |
+
"Overview",
|
| 16 |
+
"Platform Usage Patterns",
|
| 17 |
+
"Video Consumption Insights",
|
| 18 |
+
"Socioeconomic Analysis",
|
| 19 |
+
"Addiction and Satisfaction",
|
| 20 |
+
"Activity and Connection Type",
|
| 21 |
+
"Advanced Analytics"
|
|
|
|
| 22 |
])
|
| 23 |
|
| 24 |
+
# Dynamically load pages
|
| 25 |
+
pages_dir = Path("pages")
|
| 26 |
+
page_files = {
|
| 27 |
+
"Overview": "overview.py",
|
| 28 |
+
"Platform Usage Patterns": "platform_usage.py",
|
| 29 |
+
"Video Consumption Insights": "video_insights.py",
|
| 30 |
+
"Socioeconomic Analysis": "socioeconomic.py",
|
| 31 |
+
"Addiction and Satisfaction": "addiction.py",
|
| 32 |
+
"Activity and Connection Type": "activity.py",
|
| 33 |
+
"Advanced Analytics": "advanced.py"
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
if page in page_files:
|
| 37 |
+
exec(open(pages_dir / page_files[page]).read())
|
| 38 |
+
else:
|
| 39 |
+
st.error("Page not found!")
|
| 40 |
|
| 41 |
# import streamlit as st
|
| 42 |
# from pathlib import Path
|