Ashar086 commited on
Commit
c72a9c6
·
verified ·
1 Parent(s): 41ef4a1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +57 -55
app.py CHANGED
@@ -1,30 +1,6 @@
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 Insights Dashboard",
8
- # page_icon="📊",
9
- # layout="wide",
10
- # initial_sidebar_state="expanded"
11
- # )
12
-
13
- # # Manually define pages (prevents Streamlit from auto-listing)
14
- # show_pages([
15
- # Page("app.py", "Home"),
16
- # Page("pages/overview.py", "Overview"),
17
- # Page("pages/platform_usage.py", "Platform Usage Patterns"),
18
- # Page("pages/video_insights.py", "Video Consumption Insights"),
19
- # Page("pages/socioeconomic.py", "Socioeconomic Analysis"),
20
- # Page("pages/addiction.py", "Addiction and Satisfaction"),
21
- # Page("pages/activity.py", "Activity and Connection Type"),
22
- # Page("pages/advanced.py", "Advanced Analytics"),
23
- # ])
24
-
25
-
26
- import streamlit as st
27
  from pathlib import Path
 
28
 
29
  # Configure page settings
30
  st.set_page_config(
@@ -34,35 +10,61 @@ st.set_page_config(
34
  initial_sidebar_state="expanded"
35
  )
36
 
37
- # Sidebar navigation
38
- st.sidebar.title("Navigation")
39
- page = st.sidebar.radio("Go to", [
40
- "Overview",
41
- "Platform Usage Patterns",
42
- "Video Consumption Insights",
43
- "Socioeconomic Analysis",
44
- "Addiction and Satisfaction",
45
- "Activity and Connection Type",
46
- "Advanced Analytics",
47
- "ChatBot",
48
- "HomePage"
49
  ])
50
 
51
- # Dynamically load pages
52
- pages_dir = Path("pages")
53
- page_files = {
54
- "Overview": "overview.py",
55
- "Platform Usage Patterns": "platform_usage.py",
56
- "Video Consumption Insights": "video_insights.py",
57
- "Socioeconomic Analysis": "socioeconomic.py",
58
- "Addiction and Satisfaction": "addiction.py",
59
- "Activity and Connection Type": "activity.py",
60
- "Advanced Analytics": "advanced.py",
61
- "ChatBot": "chatbot.py",
62
- "Homepage": "homepage.py"
63
- }
64
 
65
- if page in page_files:
66
- exec(open(pages_dir / page_files[page]).read())
67
- else:
68
- st.error("Page not found!")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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(
 
10
  initial_sidebar_state="expanded"
11
  )
12
 
13
+ # Manually define pages (prevents Streamlit from auto-listing)
14
+ show_pages([
15
+ Page("app.py", "Home"),
16
+ Page("pages/overview.py", "Overview"),
17
+ Page("pages/platform_usage.py", "Platform Usage Patterns"),
18
+ Page("pages/video_insights.py", "Video Consumption Insights"),
19
+ Page("pages/socioeconomic.py", "Socioeconomic Analysis"),
20
+ Page("pages/addiction.py", "Addiction and Satisfaction"),
21
+ Page("pages/activity.py", "Activity and Connection Type"),
22
+ Page("pages/advanced.py", "Advanced Analytics"),
23
+ Page("pages/homepage.py", "HomePage"),
24
+
25
  ])
26
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
 
28
+ # import streamlit as st
29
+ # from pathlib import Path
30
+
31
+ # # Configure page settings
32
+ # st.set_page_config(
33
+ # page_title="Social Media Insights Dashboard",
34
+ # page_icon="📊",
35
+ # layout="wide",
36
+ # initial_sidebar_state="expanded"
37
+ # )
38
+
39
+ # # Sidebar navigation
40
+ # st.sidebar.title("Navigation")
41
+ # page = st.sidebar.radio("Go to", [
42
+ # "Overview",
43
+ # "Platform Usage Patterns",
44
+ # "Video Consumption Insights",
45
+ # "Socioeconomic Analysis",
46
+ # "Addiction and Satisfaction",
47
+ # "Activity and Connection Type",
48
+ # "Advanced Analytics",
49
+ # "ChatBot",
50
+ # "HomePage"
51
+ # ])
52
+
53
+ # # Dynamically load pages
54
+ # pages_dir = Path("pages")
55
+ # page_files = {
56
+ # "Overview": "overview.py",
57
+ # "Platform Usage Patterns": "platform_usage.py",
58
+ # "Video Consumption Insights": "video_insights.py",
59
+ # "Socioeconomic Analysis": "socioeconomic.py",
60
+ # "Addiction and Satisfaction": "addiction.py",
61
+ # "Activity and Connection Type": "activity.py",
62
+ # "Advanced Analytics": "advanced.py",
63
+ # "ChatBot": "chatbot.py",
64
+ # "Homepage": "homepage.py"
65
+ # }
66
+
67
+ # if page in page_files:
68
+ # exec(open(pages_dir / page_files[page]).read())
69
+ # else:
70
+ # st.error("Page not found!")