Spaces:
Runtime error
Runtime error
darthPanda
commited on
Commit
β’
ec4f424
1
Parent(s):
d09b322
first
Browse files
app.py
CHANGED
@@ -188,16 +188,28 @@ if "df" in st.session_state:
|
|
188 |
tab1, tab2, tab3, tab4 = st.tabs(["All", "Positive π", "Negative βΉοΈ", "Neutral π"])
|
189 |
with tab1:
|
190 |
tweet_df = st.session_state.df
|
191 |
-
|
|
|
|
|
|
|
192 |
with tab2:
|
193 |
tweet_df = st.session_state.df.query("Sentiment == 'Positive'")
|
194 |
-
|
|
|
|
|
|
|
195 |
with tab3:
|
196 |
tweet_df = st.session_state.df.query("Sentiment == 'Negative'")
|
197 |
-
|
|
|
|
|
|
|
198 |
with tab4:
|
199 |
tweet_df = st.session_state.df.query("Sentiment == 'Neutral'")
|
200 |
-
|
|
|
|
|
|
|
201 |
except:
|
202 |
st.error("No plots to display.")
|
203 |
|
|
|
188 |
tab1, tab2, tab3, tab4 = st.tabs(["All", "Positive π", "Negative βΉοΈ", "Neutral π"])
|
189 |
with tab1:
|
190 |
tweet_df = st.session_state.df
|
191 |
+
if tweet_df.shape[0] > 0:
|
192 |
+
make_dashboard(tweet_df, bar_color="#1F77B4", wc_color="Blues")
|
193 |
+
else:
|
194 |
+
st.write("No tweets to display.")
|
195 |
with tab2:
|
196 |
tweet_df = st.session_state.df.query("Sentiment == 'Positive'")
|
197 |
+
if tweet_df.shape[0] > 0:
|
198 |
+
make_dashboard(tweet_df, bar_color="#54A24B", wc_color="Greens")
|
199 |
+
else:
|
200 |
+
st.write("No tweets to display.")
|
201 |
with tab3:
|
202 |
tweet_df = st.session_state.df.query("Sentiment == 'Negative'")
|
203 |
+
if tweet_df.shape[0] > 0:
|
204 |
+
make_dashboard(tweet_df, bar_color="#FF7F0E", wc_color="Oranges")
|
205 |
+
else:
|
206 |
+
st.write("No tweets to display.")
|
207 |
with tab4:
|
208 |
tweet_df = st.session_state.df.query("Sentiment == 'Neutral'")
|
209 |
+
if tweet_df.shape[0] > 0:
|
210 |
+
make_dashboard(tweet_df, bar_color="#1F77B4", wc_color="Blues")
|
211 |
+
else:
|
212 |
+
st.write("No tweets to display.")
|
213 |
except:
|
214 |
st.error("No plots to display.")
|
215 |
|