diff --git a/web/src/beanflows/dashboard/routes.py b/web/src/beanflows/dashboard/routes.py index ca8009d..a281e3b 100644 --- a/web/src/beanflows/dashboard/routes.py +++ b/web/src/beanflows/dashboard/routes.py @@ -195,9 +195,15 @@ async def countries(): analytics.COFFEE_COMMODITY_CODE, selected_codes, metric ) - # HTMX partial: return just the chart data as JSON + # HTMX partial: return just the canvas fragment (chips + chart) if request.headers.get("HX-Request"): - return jsonify({"data": comparison_data, "metric": metric}) + return await render_template( + "countries_canvas.html", + all_countries=all_countries, + selected_codes=selected_codes, + metric=metric, + comparison_data=comparison_data, + ) return await render_template( "countries.html", diff --git a/web/src/beanflows/dashboard/templates/countries.html b/web/src/beanflows/dashboard/templates/countries.html index 379da27..d946780 100644 --- a/web/src/beanflows/dashboard/templates/countries.html +++ b/web/src/beanflows/dashboard/templates/countries.html @@ -7,7 +7,6 @@ {% endblock %} {% block content %} - -
-Compare coffee metrics across {{ all_countries|length }} producing & consuming nations
Choose up to 10 coffee-producing countries from the panel on the left to visualize production, trade flows, and inventory trends.
+