Public
Edited
Apr 20, 2023
Insert cell
Insert cell
viewof chosen_lang = Inputs.checkbox(
languages.filter((a) => a[1] > 1e6).map((d) => d[0]),
{ value: ["chi", "dut", "eng", "ita", "heb", "ukr", "slv"] }
)
Insert cell
languages = [
...d3
.rollup(
data,
(d) => d3.sum(d, (d) => d.WordCount),
(d) => d.languages
)
.entries()
]
Insert cell
Plot.plot({
x: { type: "log" },
marks: [
Plot.text(tb, {
x: "tokens",
text: (d) => d3.format(".2s")(d["tokens"]).replace("G", "B"),
y: "languages",
sort: { y: "x", reverse: true, limit: 100 }
}),
/*
Plot.circle(tb, {
x: "tokens",
y: "languages",
sort: { y: "x", reverse: true, limit: 100 }
}),*/
Plot.ruleX([0])
]
})
Insert cell
tb = [
...aq
.from(data)
.groupby("languages")
.rollup({ tokens: (d) => 3 * aq.op.sum(d.WordCount) })
.orderby("tokens")
]
Insert cell
Insert cell
untitled (1).csv
Type Table, then Shift-Enter. Ctrl-space for more options.

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