Final Project

This is the chart we’ve been building toward: every song as its own little record, all in one grid. We’ll build it together, picking up where Chapter 2 left off.

Drawing the Music Chart

We pick up the grid from the end of Chapter 2: every song as a record disc, sized by popularity and draw the whole dataset at once. So the loop is just data, straight through:

6-final-vinyl-disc.svelte
{#each data as row, i (row["title"] + row["artist"] + row["year"])}
	<g transform={cellPosition(i)}>
		<rect x="0" y="0" width={CELL} height={CELL} fill={genreColors[row["genre"]]} stroke="#fff" />
		<circle cx="100" cy="100" r={scale(row["popularity"])} fill="#351D13" />
		<circle cx="100" cy="100" r={scale(row["popularity"]) * 0.3} fill={genreColors[row["genre"]]} stroke="#fff" stroke-width="4" />
	</g>
{/each}

This is our canvas for the rest of the chapter. Open the file and follow along - we’ll build everything else right here.

edit src/exercises/6-final-vinyl-disc.svelte
Hey, Soul SisterTrainLove The Way You LieEminemTiK ToKKeshaBad RomanceLady GagaJust the Way You AreBruno MarsBabyJustin BieberDynamiteTaio CruzSecretsOneRepublicEmpire State of Mind (Part II) Broken DownAlicia KeysOnly Girl (In The World)RihannaClub Can't Handle Me (feat. David Guetta)Flo RidaMarry YouBruno MarsCooler Than Me - Single MixMike PosnerTelephoneLady GagaLike A G6Far East MovementOMG (feat. will.i.am)UsherEenie MeenieSean KingstonThe Time (Dirty Bit)The Black Eyed PeasAlejandroLady GagaYour Love Is My DrugKeshaMeet Me HalfwayThe Black Eyed PeasWhataya Want from MeAdam LambertTake It OffKeshaMiseryMaroon 5All The Right MovesOneRepublicAnimalNeon TreesNaturallySelena Gomez & The SceneI Like ItEnrique IglesiasTeenage DreamKaty PerryCalifornia GurlsKaty Perry3Britney SpearsMy First Kiss - feat. Ke$ha3OH!3Blah Blah Blah (feat. 3OH!3)KeshaImma BeThe Black Eyed PeasTry Sleeping with a Broken HeartAlicia KeysSexy Bitch (feat. Akon)David GuettaBound To You - Burlesque Original Motion Picture SoundtrackChristina AguileraIf I Had YouAdam LambertRock That BodyThe Black Eyed PeasDog Days Are OverFlorence + The MachineSomething's Got A Hold On Me - Burlesque Original Motion Picture SoundtrackChristina AguileraDoesn't Mean AnythingAlicia KeysHardRihannaLocaShakiraYou Lost MeChristina AguileraNot Myself TonightChristina AguileraWritten in the Stars (feat. Eric Turner)Tinie TempahDJ Got Us Fallin' In Love (feat. Pitbull)UsherCastle Walls (feat. Christina Aguilera)T.I.Break Your HeartTaio CruzHelloMartin SolveigA Thousand YearsChristina PerriSomeone Like YouAdeleGive Me EverythingPitbullJust the Way You AreBruno MarsRolling in the DeepAdeleRun the World (Girls)BeyoncéMoves Like Jagger - Studio Recording From The Voice PerformanceMaroon 5Love On TopBeyoncéGrenadeBruno MarsTonight TonightHot Chelle RaeWhat the HellAvril LavigneBorn This WayLady GagaMonsterKanye WestMarry YouBruno MarsBest Thing I Never HadBeyoncéParty Rock AnthemLMFAOWe R Who We RKeshaPrice TagJessie JGood LifeOneRepublicJust Can't Get EnoughThe Black Eyed PeasOn The FloorJennifer LopezWhat's My Name?RihannaYeah 3xChris BrownWithout You (feat. Usher)David GuettaSexy And I Know ItLMFAOThe Edge Of GloryLady GagaE.T.Katy PerryTill the World EndsBritney SpearsI Wanna GoBritney SpearsBlowKeshaYou And ILady GagaJudasLady GagaTonight (I'm Fuckin' You)Enrique IglesiasPlease Don't GoMike PosnerWe Found LoveRihannaMarry The NightLady Gaga1+1BeyoncéHold It Against MeBritney SpearsI'm Into YouJennifer LopezPapiJennifer LopezCheers (Drink To That)RihannaS&M RemixRihannaWritten in the Stars (feat. Eric Turner)Tinie TempahJar of HeartsChristina PerriCastle Walls (feat. Christina Aguilera)T.I.Turning PageSleeping At LastSuper BassNicki MinajRaise Your GlassP!nkInvading My MindJennifer LopezMoment 4 Life - Album Version (Edited)Nicki MinajLast Friday Night (T.G.I.F.)Katy PerryFireworkKaty PerryMuny - Album Version (Edited)Nicki MinajTitanium (feat. Sia)David GuettaLocked Out of HeavenBruno MarsParadiseColdplayPayphoneMaroon 5What Makes You BeautifulOne DirectionI Knew You Were Trouble.Taylor SwiftCall Me MaybeCarly Rae JepsenLove You Like A Love SongSelena Gomez & The SceneSet Fire to the RainAdeleWe Are Never Ever Getting Back TogetherTaylor SwiftStronger (What Doesn't Kill You)Kelly ClarksonTryP!nkStarshipsNicki MinajOne More NightMaroon 5Good TimeOwl CityGlad You CameThe WantedBeauty And A BeatJustin BieberInternational LovePitbullSome Nightsfun.BoyfriendJustin BieberPart Of MeKaty PerryDominoJessie JWhere Have You BeenRihannaWide AwakeKaty PerryThe One That Got AwayKaty PerryDance AgainJennifer LopezTurn Up the MusicChris BrownLights - Single VersionEllie GouldingWe Are Young (feat. Janelle Monáe)fun.DiamondsRihannaDon't Stop the Party (feat. TJR)PitbullYou Da OneRihannaStereo Hearts (feat. Adam Levine)Gym Class HeroesIt Will RainBruno Mars

AI Assisted Custom Viz

You’ve got a working chart - now let’s make it yours without writing every line by hand. Drop the file from the last section into an AI coding agent (Claude Code, Cursor, Copilot, or similar) and describe the tweak you want in plain English. The agent already sees your scales, your {#each} loop, and your styles, so small, specific asks work best.

Keep the changes minor and visual - we’re polishing the same vinyl-disc grid, not building a new chart. Make one change at a time, look at the result, then ask for the next.

Try a few of these prompts:

  • “Change all the colours to a more muted, earthy palette.”
  • “On hover, dim all the other tiles to 30% opacity so the one I’m pointing at stands out.”
  • “Add a staggered fade-in animation when the chart first loads, so the discs appear one after another.”
  • “Make the grooves on each record more realistic by adding a few thin concentric rings.”
  • “Add a subtle drop shadow under each disc so they look like they’re floating.”
  • “Spin the record slowly on hover, like it’s playing.”
  • “Sort the grid by genre and add a faint label above each genre group.”
  • “Give the highest-popularity song a small glowing accent so it pops out from the rest.”
  • “Round the corners of the tile backgrounds and add a little gap between them.”
  • “Switch the layout from a square grid to a single horizontal row that scrolls.”

Tips for prompting:

  • Be specific about what and where - “dim the other tiles” beats “make it look nicer”.
  • If something breaks, paste the error back to the agent; it can usually fix its own mistakes.
  • Ask it to explain a change you like - that’s how you learn the next trick yourself.

There’s no right answer here - poke at it, keep what you like, undo what you don’t, and end up with a chart that feels like yours.