Public
Edited
Sep 20, 2024
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
query = `SELECT DISTINCT ?item ?itemLabel ?date ?author ?authorLabel ?sitelinks
WHERE {
?item wdt:P50 ?author;
wdt:P577 ?date;
wikibase:sitelinks ?sitelinks .
?author wdt:P106 wd:Q2306091;
wdt:P27 wd:Q142.
SERVICE wikibase:label { bd:serviceParam wikibase:language "fr,en,mul". }
}
ORDER BY DESC(?date)`
Insert cell
output = fetch(
`https://query-main.wikidata.org/sparql?query=${encodeURIComponent(query)}`,
{ headers: { accept: "application/sparql-results+json" } }
).then((d) => d.json())
Insert cell
data = aq.from(
output.results.bindings.map((d) => ({
item: d.item.value,
itemLabel: d.itemLabel.value,
author: d.author.value,
authorLabel: d.authorLabel.value,
date: new Date(d.date.value),
sitelinks: d.sitelinks.value
}))
)
Insert cell
tsdata = data
.derive({ year: (d) => op.year(d.date) })
.groupby("year")
.count()
.orderby("year")
Insert cell
authors = data
.groupby(["author", "authorLabel"])
.count()
.orderby(aq.desc("count"))
Insert cell
authors.view()
Insert cell
Plot.plot({
height: 80,

color: {
interpolate: palette,
legend: false,
label: "Number of publications"
},
marks: [Plot.barX(tsdata, { x: (d) => d.year, fill: "count" })]
})
Insert cell
import { aq, op } from "@uwdata/arquero"
Insert cell
import { interpolateOklch } from "@jwolondon/hello-modern-colour-spaces"
Insert cell
palette = interpolateOklch([
"oklch(0% 0 0)",
"oklch(40% 0.1 10)",
"oklch(70% 0.3 60)",
"oklch(100% 0.3 90)"
])
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