Plot.text(diamonds,Plot.groupX({text:"count",y:"count"},{// can access "count" within group transform output
x:"cut",
dy:-8,
sort:{x:"y"}
}))
]
})
wrangled=aq.from(diamonds)
.groupby("cut")
.count()
.objects()
Plot.plot({
marginLeft:50,
marks:[
Plot.barY(wrangled,{
x:"cut",
y:"count",
fill:"purple"
}),
Plot.text(wrangled,{
x:"cut",
y:"count",
text:"count",
dy:-8,
sort:{x:"y"}
}),
]
})
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.