Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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("
|
| 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 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
|
| 129 |
# Word Cloud for Complaint Description
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
|
|
|
| 136 |
|
| 137 |
|
| 138 |
st.dataframe(complaints_df)
|
| 139 |
|
| 140 |
elif tabs == 'Map':
|
| 141 |
-
st.
|
| 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.
|
| 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
|