GZielinski commited on
Commit
d08d45d
Β·
verified Β·
1 Parent(s): b4439e3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -466,7 +466,7 @@ def render_kpi_cards() -> str:
466
  </div>"""
467
 
468
  kpi_config = [
469
- ("n_titles", "πŸ“š", "Book Titles", "#a48de8"),
470
  ("n_months", "πŸ“…", "Time Periods", "#7aa6f8"),
471
  ("total_units_sold", "πŸ“¦", "Units Sold", "#6ee7c7"),
472
  ("total_revenue", "πŸ’°", "Revenue", "#3dcba8"),
@@ -576,7 +576,7 @@ def build_sentiment_chart() -> go.Figure:
576
  ))
577
  fig.update_layout(**_styled_layout(
578
  height=max(400, len(df) * 28), barmode="stack",
579
- title=dict(text="Sentiment Distribution by Book"),
580
  ))
581
  fig.update_xaxes(title="Number of Reviews")
582
  fig.update_yaxes(autorange="reversed")
@@ -597,7 +597,7 @@ def build_top_sellers_chart() -> go.Figure:
597
  ))
598
  fig.update_layout(**_styled_layout(
599
  height=max(400, len(df) * 30),
600
- title=dict(text="Top Selling Titles"), showlegend=False,
601
  ))
602
  fig.update_yaxes(autorange="reversed")
603
  fig.update_xaxes(title="Total Units Sold")
@@ -926,7 +926,7 @@ with gr.Blocks(title="AIBDM 2026 Workshop App") as demo:
926
  gr.Markdown("#### Interactive Charts")
927
  chart_sales = gr.Plot(label="Monthly Overview")
928
  chart_sentiment = gr.Plot(label="Sentiment Distribution")
929
- chart_top = gr.Plot(label="Top Sellers")
930
 
931
  gr.Markdown("#### Static Figures (from notebooks)")
932
  gallery = gr.Gallery(
 
466
  </div>"""
467
 
468
  kpi_config = [
469
+ ("n_titles", "πŸ“¦", "Products", "#a48de8"),
470
  ("n_months", "πŸ“…", "Time Periods", "#7aa6f8"),
471
  ("total_units_sold", "πŸ“¦", "Units Sold", "#6ee7c7"),
472
  ("total_revenue", "πŸ’°", "Revenue", "#3dcba8"),
 
576
  ))
577
  fig.update_layout(**_styled_layout(
578
  height=max(400, len(df) * 28), barmode="stack",
579
+ title=dict(text="Sentiment Distribution by Product"),
580
  ))
581
  fig.update_xaxes(title="Number of Reviews")
582
  fig.update_yaxes(autorange="reversed")
 
597
  ))
598
  fig.update_layout(**_styled_layout(
599
  height=max(400, len(df) * 30),
600
+ title=dict(text="Top Products by Demand"), showlegend=False,
601
  ))
602
  fig.update_yaxes(autorange="reversed")
603
  fig.update_xaxes(title="Total Units Sold")
 
926
  gr.Markdown("#### Interactive Charts")
927
  chart_sales = gr.Plot(label="Monthly Overview")
928
  chart_sentiment = gr.Plot(label="Sentiment Distribution")
929
+ chart_top = gr.Plot(label="Top Products")
930
 
931
  gr.Markdown("#### Static Figures (from notebooks)")
932
  gallery = gr.Gallery(