Plot.plot({
margin: 40,
inset: 20,
width:750,
height: 500,
style: {
color: "black"
},
x: {label: "Durée du morceau",
grid: true},
y: {label: "Popularité"},
marks: [
Plot.dot(top_tracks_global_2008_2023, {
x: (d) => parseInt(d["Duration (seconds)"]),
y: (d) => parseInt(d["Popularity"]),
fill: color,
fillOpacity: 0.5
}),
Plot.density(top_tracks_global_2008_2023, {
x: (d) => parseInt(d["Duration (seconds)"]),
y: (d) => parseInt(d["Popularity"]),
stroke: "Density",
thresholds: threshold,
bandwidth : bandwith
}),
]
})