Public
Edited
Jul 27, 2024
Insert cell
Insert cell
data = d3.csv(
"https://raw.githubusercontent.com/kkakey/American_Idol/main/Songs/songs_all.csv"
)
Insert cell
data
UPDATE data
SET season = CAST(SUBSTRING(season, 8) AS SIGNED)
WHERE season LIKE 'Season_%';

Insert cell
Plot.plot({
style: {
backgroundColor: "black",
fontFamily: "Marcellus",
fontSize: 12,
fontColor: "white"
},
marginLeft: 80,
y: { label: "Frequency" },
x: { label: null },
marks: [
// Main bars
Plot.barY(data, {
x: "season",
y: 1,
inset: 0.6,
fill: (d) => {
if (d.artist === "Stevie Wonder") return "#fe218b";
if (d.artist === "The Beatles") return "#fed700";
if (d.artist === "Elton John") return "#21b0fe";
return "#495057";
},
sort: "song",
title: (d) => `${d.artist} \n song: ${d.song}`,
sort: { y: "y", reverse: true }
}),
Plot.axisX({ fill: "white" }),
Plot.axisY({ fill: "white" })
],
width: 1000,
height: 800,
color: { legend: false }
})
Insert cell
import { Plot } from "@mkfreeman/plot-tooltip"
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more