// The dropdown menu should let the user select from '<10', '10-19', '20-29', '30-39', '40-49', '50-59', '60-69', '70-79', '≥80'
// ... your code here.
ageRange_dropdown
Plot.plot({
width:1000,
marginLeft:80,
y:{
label:"🤑 Millions",
transform:d=>d/1_000_000
},
marks:[
Plot.barY(data,{
x:"name",
y:ageRange_dropdown,
sort:{x:"y",reverse:true},
fill:d=>d["name"]==="VA"?"red":"dodgerblue"})
]
})
Plot.plot({
width:1000,
marginLeft:80,
y:{
label:"🤑 Millions",
transform:d=>d/1_000_000
},
marks:[
Plot.barY(data,{
x:"name",
y:ageRange_dropdown,
sort:sort_toggle?{x:"y",reverse:true}:"",
fill:d=>d["name"]==="VA"?"red":"dodgerblue"})
]
})
import{toc}from"@nebrius/indented-toc"
import{imageToDo}from"@clokman/student-blocks"
imageToDo
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.