darthPanda commited on
Commit
ec4f424
β€’
1 Parent(s): d09b322
Files changed (1) hide show
  1. app.py +16 -4
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
- make_dashboard(tweet_df, bar_color="#1F77B4", wc_color="Blues")
 
 
 
192
  with tab2:
193
  tweet_df = st.session_state.df.query("Sentiment == 'Positive'")
194
- make_dashboard(tweet_df, bar_color="#54A24B", wc_color="Greens")
 
 
 
195
  with tab3:
196
  tweet_df = st.session_state.df.query("Sentiment == 'Negative'")
197
- make_dashboard(tweet_df, bar_color="#FF7F0E", wc_color="Oranges")
 
 
 
198
  with tab4:
199
  tweet_df = st.session_state.df.query("Sentiment == 'Neutral'")
200
- make_dashboard(tweet_df, bar_color="#1F77B4", wc_color="Blues")
 
 
 
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