rairo commited on
Commit
d2a511f
·
verified ·
1 Parent(s): 1d64ba6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -16
app.py CHANGED
@@ -67,7 +67,7 @@ def user_authentication():
67
  st.image("ecomp.png", width=200)
68
  st.title("E-Complaint")
69
 
70
- st.header("User Authentication")
71
 
72
 
73
  # If the user is an existing user, prompt for email and password
@@ -117,34 +117,37 @@ def main():
117
  iconName=['dashboard', 'map', 'chat'], default_choice=0)
118
 
119
  if tabs =='Dashboard':
120
- st.title("Navigation Bar")
121
  st.header("Complaints")
122
-
 
 
 
 
123
  # Pie Chart for Resolution Status
124
- fig, ax = plt.subplots()
125
- complaints_df['resolution_status'].value_counts().plot(kind='pie', autopct='%1.1f%%', ax=ax)
126
- ax.set_ylabel('')
127
- st.pyplot(fig)
128
 
129
  # Word Cloud for Complaint Description
130
- text = " ".join(df['complaint_description'])
131
- wordcloud = WordCloud(width=800, height=400).generate(text)
132
- plt.figure(figsize=(8, 4))
133
- plt.imshow(wordcloud, interpolation='bilinear')
134
- plt.axis('off')
135
- st.pyplot(plt)
 
136
 
137
 
138
  st.dataframe(complaints_df)
139
 
140
  elif tabs == 'Map':
141
- st.title("Google Maps view of eThekwini complaints")
142
  st.markdown("""" <iframe src="https://www.google.com/maps/d/u/0/embed?mid=16Fo-30K46Sq5NbHYW6d7pWtggO-QKAU&ehbc=2E312F" width="640" height="480"></iframe> """,
143
  unsafe_allow_html=True)
144
 
145
  elif tabs == 'Chat':
146
- st.title("eThekwini Chat Powered by Gemini")
147
- st.write('Name of option is {}'.format(tabs))
148
 
149
 
150
  # Display the data
 
67
  st.image("ecomp.png", width=200)
68
  st.title("E-Complaint")
69
 
70
+ st.header("Admin Dashboard")
71
 
72
 
73
  # If the user is an existing user, prompt for email and password
 
117
  iconName=['dashboard', 'map', 'chat'], default_choice=0)
118
 
119
  if tabs =='Dashboard':
 
120
  st.header("Complaints")
121
+
122
+ # Create two columns
123
+ col1, col2 = st.columns(2)
124
+
125
+ with col1:
126
  # Pie Chart for Resolution Status
127
+ fig, ax = plt.subplots()
128
+ complaints_df['resolution_status'].value_counts().plot(kind='pie', autopct='%1.1f%%', ax=ax)
129
+ ax.set_ylabel('')
130
+ st.pyplot(fig)
131
 
132
  # Word Cloud for Complaint Description
133
+ with col2:
134
+ text = " ".join(complaints_df['complaint_description'])
135
+ wordcloud = WordCloud(width=800, height=400).generate(text)
136
+ plt.figure(figsize=(8, 4))
137
+ plt.imshow(wordcloud, interpolation='bilinear')
138
+ plt.axis('off')
139
+ st.pyplot(plt)
140
 
141
 
142
  st.dataframe(complaints_df)
143
 
144
  elif tabs == 'Map':
145
+ st.header("Google Maps view of eThekwini complaints")
146
  st.markdown("""" <iframe src="https://www.google.com/maps/d/u/0/embed?mid=16Fo-30K46Sq5NbHYW6d7pWtggO-QKAU&ehbc=2E312F" width="640" height="480"></iframe> """,
147
  unsafe_allow_html=True)
148
 
149
  elif tabs == 'Chat':
150
+ st.header("eThekwini Chat Powered by Gemini")
 
151
 
152
 
153
  # Display the data