Public
Edited
Mar 13, 2023
Insert cell
Insert cell
top20songs_1970s2000s = FileAttachment("top20songs_1970s-2000s.json").json()
Insert cell
viewof table = Inputs.table(top20songs_1970s2000s)
Insert cell
top20songs_1970s-2000s.json
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
decade = [...new Set(top20songs_1970s2000s.map(item => item.Decade))];
Insert cell
country = [...new Set(top20songs_1970s2000s.map(item => item.Country))];
Insert cell
Insert cell
Plot.plot({
marks: [
Plot.dot(top20songs_1970s2000s, {x: "speechiness", y: "loudness", fill: "Decade", title: "Name"})
],
color: {
domain: decade,
legend: true
}
})
Insert cell
chart = ScatterplotMatrix(top20songs_1970s2000s, {
columns: [
"Rank",
"danceability",
"energy",
"loudness",
"key",
"speechiness",
"acousticness",
"instrumentalness",
"liveness",
"valence",
"tempo",
"duration_ms"
],
z: d => d.Decade
})
Insert cell
Plot.plot({
marks: [
Plot.boxX(top20songs_1970s2000s, {x: "valence", y: "Decade", sort: {y: "y"}}, )
]
})
Insert cell
Plot.plot({
marks: [
Plot.rectY(top20songs_1970s2000s, Plot.binX({y: "count"}, {x: "duration_ms"}, {z: "Decade"})),
Plot.ruleY([0])
]
})
Insert cell
Plot.plot({
marks: [
Plot.tickX(top20songs_1970s2000s, {x: "acousticness", y: "Decade"})
]
})
Insert cell
top20songs_1970s2000s.filter
Insert cell
Plot.plot({
facet: {
data: top20songs_1970s2000s,
y: "Decade",
height: 1500,
},
marks: [
Plot.frame(),
Plot.dot(top20songs_1970s2000s, {x: "energy", y: "key"})
]
})
Insert cell
Plot.plot({
height: 180,
marks: [
Plot.dot(cars, Plot.dodgeY({x: "weight (lb)"}))
]
})
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