Public
Edited
May 21, 2023
Importers
1 star
Insert cell
Insert cell
Insert cell
test-counts.parquet
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function tokenCounts(n, gt = 0){
return Plot.plot({
caption: `Count of documents with less than ${n} tokens` + (gt ? ` and more than ${gt} tokens.` : ``),
marks: [
Plot.barX(
counts.filter(d => d.tokens <= n && d.tokens > gt),
Plot.groupY(
{ x: "count", title: "count" },
{
y: "pile_set_name",
x: "tokens",
fill: "pile_set_name",
sort: { y: "x", reverse: true, limit: 22 }
}
)
),
Plot.ruleX([0])
],
marginLeft: 120,
marginRight: 80,
fy: {
domain: ["sub200", "sub4k", "sub8k", "sub32k", "lots"]
},
y: {
label: null
},
color: { domain: colors.domain },
grid: true,
height: 300
})
}
Insert cell
nformat = d3.format(",d")
Insert cell
colors = totals.scale("color")
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