From 19e6e1754242f689eb66a3617a703b4654f035eb Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Sat, 5 Apr 2025 12:47:31 +0100 Subject: [PATCH] Hardcode top 30 results, fix padding --- lib/music_library/records.ex | 2 ++ lib/music_library_web/live/stats_live/index.html.heex | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/music_library/records.ex b/lib/music_library/records.ex index 4f05cc69..b804924c 100644 --- a/lib/music_library/records.ex +++ b/lib/music_library/records.ex @@ -279,6 +279,7 @@ defmodule MusicLibrary.Records do from records, json_each(records.artists) artist group by name order by count desc + limit 30 """), select: {fragment("name"), fragment("count")} @@ -296,6 +297,7 @@ defmodule MusicLibrary.Records do from records, json_each(records.genres) genre group by name order by count desc + limit 30 """), select: {fragment("name"), fragment("count")} diff --git a/lib/music_library_web/live/stats_live/index.html.heex b/lib/music_library_web/live/stats_live/index.html.heex index 3858f1e6..29ff21ab 100644 --- a/lib/music_library_web/live/stats_live/index.html.heex +++ b/lib/music_library_web/live/stats_live/index.html.heex @@ -73,11 +73,11 @@

{gettext("Records by Artist")}

-
+
<.vertical_bar_chart data={@records_by_artist} width={600} - height={600} + height={35 * length(@records_by_artist)} bar_color="rgb(79, 70, 229)" class="w-full" /> @@ -88,11 +88,11 @@

{gettext("Records by Genre")}

-
+
<.vertical_bar_chart data={@records_by_genre} width={600} - height={600} + height={35 * length(@records_by_genre)} bar_color="rgb(244, 63, 94)" class="w-full" />