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

]
})
Insert cell
Insert cell

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.
Learn more