From e04fcaa338acee2d44f175c253e8d1561877a3ad Mon Sep 17 00:00:00 2001 From: Ewan Croft Date: Thu, 13 Aug 2026 15:36:51 +0100 Subject: [PATCH] feat(tourmaline): add cumulative top-artists line chart MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Running cumulative scrobble total per month for the top 10 artists by play count, one line per artist, 10-color fixed palette. Registers LineController in chart.ts (bar/radar were registered, line wasn't). Built by a background subagent (worktree-isolated), merged in by hand: the agent's worktree branched before monthlyArtistPlays was exposed on ListenerProfile, so it independently re-added the same field — only the LineController registration, the new component, and the +page.svelte wiring were taken; the duplicate field/wiring re-addition was dropped since it already existed on main. --- packages/tourmaline/src/lib/chart.ts | 2 + .../src/routes/profile/[did]/+page.svelte | 14 +++ .../profile/[did]/CumulativeItemsChart.svelte | 115 ++++++++++++++++++ 3 files changed, 131 insertions(+) create mode 100644 packages/tourmaline/src/routes/profile/[did]/CumulativeItemsChart.svelte diff --git a/packages/tourmaline/src/lib/chart.ts b/packages/tourmaline/src/lib/chart.ts index d1a9e24..4eb4338 100644 --- a/packages/tourmaline/src/lib/chart.ts +++ b/packages/tourmaline/src/lib/chart.ts @@ -11,6 +11,7 @@ import { BarController, BarElement, RadarController, + LineController, PointElement, LineElement, RadialLinearScale, @@ -25,6 +26,7 @@ Chart.register( BarController, BarElement, RadarController, + LineController, PointElement, LineElement, RadialLinearScale, diff --git a/packages/tourmaline/src/routes/profile/[did]/+page.svelte b/packages/tourmaline/src/routes/profile/[did]/+page.svelte index 9c22d09..7502593 100644 --- a/packages/tourmaline/src/routes/profile/[did]/+page.svelte +++ b/packages/tourmaline/src/routes/profile/[did]/+page.svelte @@ -24,6 +24,7 @@ import ServiceOrigins from './ServiceOrigins.svelte'; import MinutesListened from './MinutesListened.svelte'; import MusicEvolution from './MusicEvolution.svelte'; + import CumulativeItemsChart from './CumulativeItemsChart.svelte'; import RemarkableDays from './RemarkableDays.svelte'; import Discovery from './Discovery.svelte'; import Milestones from './Milestones.svelte'; @@ -421,6 +422,19 @@ {/if} + {#if profile.monthlyArtistPlays.length >= 3 && profile.topArtists.length > 0} +
+

Cumulative Top Artists

+

+ Running scrobble totals for your top 10 artists, month over month +

+ +
+ {/if} + {#if profile.phases.length >= 2}
diff --git a/packages/tourmaline/src/routes/profile/[did]/CumulativeItemsChart.svelte b/packages/tourmaline/src/routes/profile/[did]/CumulativeItemsChart.svelte new file mode 100644 index 0000000..46021b1 --- /dev/null +++ b/packages/tourmaline/src/routes/profile/[did]/CumulativeItemsChart.svelte @@ -0,0 +1,115 @@ + + +
+ +
-- 2.51.2