Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -27,7 +27,7 @@ from ui_generators import (
|
|
27 |
# Corrected import for analytics_data_processing
|
28 |
from analytics_data_processing import prepare_filtered_analytics_data
|
29 |
from analytics_plot_generator import (
|
30 |
-
generate_posts_activity_plot,
|
31 |
generate_mentions_activity_plot, generate_mention_sentiment_plot,
|
32 |
generate_followers_count_over_time_plot,
|
33 |
generate_followers_growth_rate_plot,
|
@@ -95,11 +95,12 @@ def update_analytics_plots_figures(token_state_value, date_filter_option, custom
|
|
95 |
# individual_plot_times[plot_name] = time.time() - plot_start_time
|
96 |
# logging.info(f"Generated {plot_name} in {individual_plot_times[plot_name]:.2f}s")
|
97 |
|
98 |
-
plot_figs.append(generate_engagement_type_plot(filtered_merged_posts_df))
|
99 |
-
fig_mentions_activity_shared = generate_mentions_activity_plot(filtered_mentions_df, date_column=date_column_mentions)
|
100 |
-
fig_mention_sentiment_shared = generate_mention_sentiment_plot(filtered_mentions_df)
|
101 |
-
plot_figs.append(fig_mentions_activity_shared)
|
102 |
-
|
|
|
103 |
plot_figs.append(generate_followers_count_over_time_plot(date_filtered_follower_stats_df, type_value='follower_gains_monthly'))
|
104 |
plot_figs.append(generate_followers_growth_rate_plot(date_filtered_follower_stats_df, type_value='follower_gains_monthly'))
|
105 |
plot_figs.append(generate_followers_by_demographics_plot(raw_follower_stats_df, type_value='follower_geo', plot_title="Followers by Location"))
|
@@ -218,10 +219,10 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="blue", secondary_hue="sky"),
|
|
218 |
)
|
219 |
|
220 |
plot_configs = [
|
221 |
-
{"label": "Posts Activity Over Time", "id": "posts_activity", "section": "Posts & Engagement Overview"},
|
222 |
-
{"label": "Post Engagement Types", "id": "engagement_type", "section": "Posts & Engagement Overview"},
|
223 |
-
{"label": "Mentions Activity Over Time", "id": "mentions_activity", "section": "Mentions Overview"},
|
224 |
-
{"label": "Mention Sentiment Distribution", "id": "mention_sentiment", "section": "Mentions Overview"},
|
225 |
{"label": "Followers Count Over Time", "id": "followers_count", "section": "Follower Dynamics"},
|
226 |
{"label": "Followers Growth Rate", "id": "followers_growth_rate", "section": "Follower Dynamics"},
|
227 |
{"label": "Followers by Location", "id": "followers_by_location", "section": "Follower Demographics"},
|
|
|
27 |
# Corrected import for analytics_data_processing
|
28 |
from analytics_data_processing import prepare_filtered_analytics_data
|
29 |
from analytics_plot_generator import (
|
30 |
+
generate_posts_activity_plot,
|
31 |
generate_mentions_activity_plot, generate_mention_sentiment_plot,
|
32 |
generate_followers_count_over_time_plot,
|
33 |
generate_followers_growth_rate_plot,
|
|
|
95 |
# individual_plot_times[plot_name] = time.time() - plot_start_time
|
96 |
# logging.info(f"Generated {plot_name} in {individual_plot_times[plot_name]:.2f}s")
|
97 |
|
98 |
+
# plot_figs.append(generate_engagement_type_plot(filtered_merged_posts_df))
|
99 |
+
# fig_mentions_activity_shared = generate_mentions_activity_plot(filtered_mentions_df, date_column=date_column_mentions)
|
100 |
+
# fig_mention_sentiment_shared = generate_mention_sentiment_plot(filtered_mentions_df)
|
101 |
+
# plot_figs.append(fig_mentions_activity_shared)
|
102 |
+
|
103 |
+
# plot_figs.append(fig_mention_sentiment_shared)
|
104 |
plot_figs.append(generate_followers_count_over_time_plot(date_filtered_follower_stats_df, type_value='follower_gains_monthly'))
|
105 |
plot_figs.append(generate_followers_growth_rate_plot(date_filtered_follower_stats_df, type_value='follower_gains_monthly'))
|
106 |
plot_figs.append(generate_followers_by_demographics_plot(raw_follower_stats_df, type_value='follower_geo', plot_title="Followers by Location"))
|
|
|
219 |
)
|
220 |
|
221 |
plot_configs = [
|
222 |
+
# {"label": "Posts Activity Over Time", "id": "posts_activity", "section": "Posts & Engagement Overview"},
|
223 |
+
# {"label": "Post Engagement Types", "id": "engagement_type", "section": "Posts & Engagement Overview"},
|
224 |
+
# {"label": "Mentions Activity Over Time", "id": "mentions_activity", "section": "Mentions Overview"},
|
225 |
+
# {"label": "Mention Sentiment Distribution", "id": "mention_sentiment", "section": "Mentions Overview"},
|
226 |
{"label": "Followers Count Over Time", "id": "followers_count", "section": "Follower Dynamics"},
|
227 |
{"label": "Followers Growth Rate", "id": "followers_growth_rate", "section": "Follower Dynamics"},
|
228 |
{"label": "Followers by Location", "id": "followers_by_location", "section": "Follower Demographics"},
|