Ashar086 commited on
Commit
63eaae0
Β·
verified Β·
1 Parent(s): af6fd62

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +45 -109
app.py CHANGED
@@ -1,118 +1,54 @@
 
 
1
  import streamlit as st
2
  from pathlib import Path
3
 
4
- # Set page configuration at the very beginning
5
  st.set_page_config(
6
- page_title="Social Media Insights Dashboard",
7
  page_icon="πŸ“Š",
8
- layout="wide"
 
9
  )
10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  # Dynamically load pages
12
  pages_dir = Path("pages")
13
- page_files = {i: f for i, f in enumerate(sorted(pages_dir.glob("*.py")))}
14
-
15
- # Sidebar for navigation
16
- page = st.sidebar.selectbox("Select a Page", list(page_files.keys()), format_func=lambda x: page_files[x].stem)
17
-
18
- # Execute the selected page script
19
- exec(open(pages_dir / page_files[page]).read())
20
-
21
-
22
-
23
- # import streamlit as st
24
- # from pathlib import Path
25
-
26
- # # Configure page settings
27
- # st.set_page_config(
28
- # page_title="Social Media Addiction Insights",
29
- # page_icon="πŸ“Š",
30
- # layout="wide",
31
- # initial_sidebar_state="expanded"
32
- # )
33
-
34
- # # Sidebar navigation
35
- # st.sidebar.title("Navigation")
36
- # page = st.sidebar.radio("Go to", [
37
- # "Overview",
38
- # "Platform Usage Patterns",
39
- # "Video Consumption Insights",
40
- # "Socioeconomic Analysis",
41
- # "Addiction and Satisfaction",
42
- # "Activity and Connection Type",
43
- # "Advanced Analytics",
44
- # "Chatbot"
45
- # ])
46
- # st.markdown(
47
- # """
48
- # <style>
49
- # [data-testid="stSidebarNav"] {
50
- # display: none;
51
- # }
52
-
53
- # </style>
54
- # """,
55
- # unsafe_allow_html=True,
56
- # )
57
-
58
- # # Dynamically load pages
59
- # pages_dir = Path("pages")
60
- # page_files = {
61
- # "Overview": "overview.py",
62
- # "Platform Usage Patterns": "platform_usage.py",
63
- # "Video Consumption Insights": "video_insights.py",
64
- # "Socioeconomic Analysis": "socioeconomic.py",
65
- # "Addiction and Satisfaction": "addiction.py",
66
- # "Activity and Connection Type": "activity.py",
67
- # "Advanced Analytics": "advanced.py",
68
- # "Chatbot": "chatbot.py"
69
- # }
70
-
71
- # if page in page_files:
72
- # exec(open(pages_dir / page_files[page]).read())
73
- # else:
74
- # st.error("Page not found!")
75
-
76
- # import streamlit as st
77
- # from pathlib import Path
78
-
79
- # # Configure page settings
80
- # st.set_page_config(
81
- # page_title="Social Media Insights Dashboard",
82
- # page_icon="πŸ“Š",
83
- # layout="wide",
84
- # initial_sidebar_state="expanded"
85
- # )
86
-
87
- # # Sidebar navigation
88
- # st.sidebar.title("Navigation")
89
- # page = st.sidebar.radio("Go to", [
90
- # "Overview",
91
- # "Platform Usage Patterns",
92
- # "Video Consumption Insights",
93
- # "Socioeconomic Analysis",
94
- # "Addiction and Satisfaction",
95
- # "Activity and Connection Type",
96
- # "Advanced Analytics",
97
- # "ChatBot",
98
- # "HomePage"
99
- # ])
100
-
101
- # # Dynamically load pages
102
- # pages_dir = Path("pages")
103
- # page_files = {
104
- # "Overview": "overview.py",
105
- # "Platform Usage Patterns": "platform_usage.py",
106
- # "Video Consumption Insights": "video_insights.py",
107
- # "Socioeconomic Analysis": "socioeconomic.py",
108
- # "Addiction and Satisfaction": "addiction.py",
109
- # "Activity and Connection Type": "activity.py",
110
- # "Advanced Analytics": "advanced.py",
111
- # "ChatBot": "chatbot.py",
112
- # "Homepage": "homepage.py"
113
- # }
114
-
115
- # if page in page_files:
116
- # exec(open(pages_dir / page_files[page]).read())
117
- # else:
118
- # st.error("Page not found!")
 
1
+
2
+
3
  import streamlit as st
4
  from pathlib import Path
5
 
6
+ # Configure page settings
7
  st.set_page_config(
8
+ page_title="Social Media Addiction Insights",
9
  page_icon="πŸ“Š",
10
+ layout="wide",
11
+ initial_sidebar_state="expanded"
12
  )
13
 
14
+ # Sidebar navigation
15
+ st.sidebar.title("Navigation")
16
+ page = st.sidebar.radio("Go to", [
17
+ "Overview",
18
+ "Platform Usage Patterns",
19
+ "Video Consumption Insights",
20
+ "Socioeconomic Analysis",
21
+ "Addiction and Satisfaction",
22
+ "Activity and Connection Type",
23
+ "Advanced Analytics",
24
+ "Chatbot"
25
+ ])
26
+ st.markdown(
27
+ """
28
+ <style>
29
+ [data-testid="stSidebarNav"] {
30
+ display: none;
31
+ }
32
+
33
+ </style>
34
+ """,
35
+ unsafe_allow_html=True,
36
+ )
37
+
38
  # Dynamically load pages
39
  pages_dir = Path("pages")
40
+ page_files = {
41
+ "Overview": "overview.py",
42
+ "Platform Usage Patterns": "platform_usage.py",
43
+ "Video Consumption Insights": "video_insights.py",
44
+ "Socioeconomic Analysis": "socioeconomic.py",
45
+ "Addiction and Satisfaction": "addiction.py",
46
+ "Activity and Connection Type": "activity.py",
47
+ "Advanced Analytics": "advanced.py",
48
+ "Chatbot": "chatbot.py"
49
+ }
50
+
51
+ if page in page_files:
52
+ exec(open(pages_dir / page_files[page]).read())
53
+ else:
54
+ st.error("Page not found!")