Public
Edited
Jun 2, 2023
Insert cell
Insert cell
Plot.plot({
width: Math.min(width, 800),
color: {
legend: true
},
y: {
reverse: false
},
fy: {
reverse: true
},
marginLeft: 250,
marginBottom: 50,
marginRight: 50,
marks: [
Plot.barX(dataAugmented, Plot.groupY({x: "sum"},{x: "count_requests_received", y: "type", fy: "year", fill: "type", tip: true})),
Plot.ruleX([0])
]
})
Insert cell
data = fetch("https://raw.githubusercontent.com/github/transparency/main/data/requests_to_disclose_user_information/requests_received_and_disclosed.csv").then((response) => response.text()).then(rawText => d3.csvParse(rawText, d3.autoType))
Insert cell
dataAugmented = [2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021].map(year => data.filter(d => d.year === 2021).map(d => ({ ...d, count_requests_received: Math.floor(Math.random() * 5 * d.count_requests_received), year: year }))).flat().concat(data)
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