Public
Edited
Oct 17, 2024
1 star
Insert cell
Insert cell
viewof wikipedia = Inputs.text({
datalist: wikipedias,
label: "Choose a Wikipedia page project",
value: "ar.wikipedia.org",
placeholder: "eg fr.wikipedia.org",
submit: true
})
Insert cell
project = get_shortwikipedianame(wikipedia)
Insert cell
viewof lang = Inputs.text({ label: "Choose a language", value: "en" })
Insert cell
data = fetch(
`https://humaniki.wmcloud.org/api/v1/gender/gap/latest/gte_one_sitelink/properties?project=${project}&label_lang=${lang}`
).then((d) => d.json())
Insert cell
metrics = aq.from(data.metrics[0].values).rename({ value: "count" })
Insert cell
metrics.view()
Insert cell
labels = aq.from(data.meta.bias_labels).rename({ value: "label" })
Insert cell
labels.view()
Insert cell
df = metrics
.join_left(labels, "key")
.derive({
qid: (d) => "Q" + d.key,
share: (d) => d.count / op.sum(d.count)
})
.select(["qid", "label", "count", "share"])
.orderby(aq.desc("count"))
Insert cell
Inputs.table(df, { layout: "auto", select: false })
Insert cell
Insert cell
import {
get_shortwikipedianame,
wikipedias
} from "@pac02/user-level-gender-statistics-for-wikipedia"
Insert cell
import {aq, op} from "@uwdata/arquero"
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