Code
Inputs.table(data)Explore the raw data.
Run your own analysis by creating a Codespace and opening the Quarto notebook that powers the charts below.
index.qmd)Cmd+Shift+K or Ctrl+Shift+K to render the notebook.Ordinarily, you’d need to install Quarto first, but the prebuild configuration for this repo’s Codespaces uses an image with Quarto pre-installed for you.
Read more about Quarto and writing Observable JS (ojs) cells.
Inputs.table(data)governmentHistogram = Plot.plot({
marginLeft: 180,
y: {
insetTop: 5,
domain: governmentsByFrequencyDesc,
},
marks: [
Plot.barX(data, Plot.groupY({ x: "count" }, { y: "Government" })),
]
})regionHistogram = Plot.plot({
marginLeft: 200,
y: {
insetTop: 5,
domain: regionsByFrequencyDesc,
},
marks: [
Plot.barX(data, Plot.groupY({ x: "count" }, { y: "Region" })),
]
})issuingAreaHistogram = Plot.plot({
marginBottom: 50,
marginRight: 90,
x: {
tickRotate: -45,
tickFormat: "d",
},
y: {
insetTop: 5,
},
facet: {
data,
y: "Issuing Area of Government",
marginRight: 90,
},
marks: [
Plot.frame(),
Plot.barY(data, Plot.groupX({ y: "count" }, { x: "Date" })),
]
})issuingAreaByRegionHistogram = Plot.plot({
marginBottom: 90,
marginRight: 200,
x: {
tickRotate: -45
},
y: {
insetTop: 5,
},
facet: {
data,
y: "Region",
marginRight: 200,
},
marks: [
Plot.frame(),
Plot.barY(data, Plot.groupX({ y: "count" }, { x: "Issuing Area of Government" })),
]
})actionHistogram = Plot.plot({
marginBottom: 50,
marginRight: 150,
x: {
tickRotate: -45,
tickFormat: "d",
},
y: {
insetTop: 5,
},
facet: {
data,
y: "Action",
marginRight: 150,
},
marks: [
Plot.frame(),
Plot.barY(data, Plot.groupX({ y: "count" }, { x: "Date" })),
]
})actionByRegionHistogram = Plot.plot({
marginBottom: 110,
marginRight: 200,
x: {
tickRotate: -45
},
y: {
insetTop: 5,
},
facet: {
data,
y: "Region",
marginRight: 200,
},
marks: [
Plot.frame(),
Plot.barY(data, Plot.groupX({ y: "count" }, { x: "Action" })),
]
})statusHistogram = Plot.plot({
marginBottom: 50,
marginRight: 90,
x: {
tickRotate: -45,
tickFormat: "d",
},
y: {
insetTop: 5,
},
facet: {
data,
y: "Status",
marginRight: 90,
},
marks: [
Plot.frame(),
Plot.barY(data, Plot.groupX({ y: "count" }, { x: "Date" })),
]
})statusByRegionHistogram = Plot.plot({
marginBottom: 50,
marginRight: 200,
y: {
insetTop: 5,
},
facet: {
data,
y: "Region",
marginRight: 200,
},
marks: [
Plot.frame(),
Plot.barY(data, Plot.groupX({ y: "count" }, { x: "Status" })),
]
})typeHistogram = Plot.plot({
marginBottom: 50,
marginRight: 150,
x: {
tickRotate: -45,
tickFormat: "d",
},
y: {
insetTop: 5,
},
facet: {
data,
y: "Type",
marginRight: 150,
},
marks: [
Plot.frame(),
Plot.barY(data, Plot.groupX({ y: "count" }, { x: "Date" })),
]
})typeByRegionHistogram = Plot.plot({
marginBottom: 110,
marginRight: 200,
x: {
tickRotate: -45
},
y: {
insetTop: 5,
},
facet: {
data,
y: "Region",
marginRight: 200,
},
marks: [
Plot.frame(),
Plot.barY(data, Plot.groupX({ y: "count" }, { x: "Type" })),
]
})modernizationHistogram = Plot.plot({
marginBottom: 50,
marginRight: 90,
x: {
tickRotate: -45,
tickFormat: "d",
},
y: {
insetTop: 5,
},
facet: {
data,
y: "Stated Objective: Modernization",
marginRight: 90,
},
marks: [
Plot.frame(),
Plot.barY(data, Plot.groupX({ y: "count" }, { x: "Date" })),
]
})costHistogram = Plot.plot({
marginBottom: 50,
marginRight: 90,
x: {
tickRotate: -45,
tickFormat: "d",
},
y: {
insetTop: 5,
},
facet: {
data,
y: "Stated Objective: Cost",
marginRight: 90,
},
marks: [
Plot.frame(),
Plot.barY(data, Plot.groupX({ y: "count" }, { x: "Date" })),
]
})sovereigntyHistogram = Plot.plot({
marginBottom: 50,
marginRight: 90,
x: {
tickRotate: -45,
tickFormat: "d",
},
y: {
insetTop: 5,
},
facet: {
data,
y: "Stated Objective: Sovereignty",
marginRight: 90,
},
marks: [
Plot.frame(),
Plot.barY(data, Plot.groupX({ y: "count" }, { x: "Date" })),
]
})nationalIndustryHistogram = Plot.plot({
marginBottom: 50,
marginRight: 90,
x: {
tickRotate: -45,
tickFormat: "d",
},
y: {
insetTop: 5,
},
facet: {
data,
y: "Stated Objective: Support for National Industry",
marginRight: 90,
},
marks: [
Plot.frame(),
Plot.barY(data, Plot.groupX({ y: "count" }, { x: "Date" })),
]
})transparencyHistogram = Plot.plot({
marginBottom: 50,
marginRight: 90,
x: {
tickRotate: -45,
tickFormat: "d",
},
y: {
insetTop: 5,
},
facet: {
data,
y: "Stated Objective: Transparency",
marginRight: 90,
},
marks: [
Plot.frame(),
Plot.barY(data, Plot.groupX({ y: "count" }, { x: "Date" })),
]
})securityHistogram = Plot.plot({
marginBottom: 50,
marginRight: 90,
x: {
tickRotate: -45,
tickFormat: "d",
},
y: {
insetTop: 5,
},
facet: {
data,
y: "Stated Objective: Security",
marginRight: 90,
},
marks: [
Plot.frame(),
Plot.barY(data, Plot.groupX({ y: "count" }, { x: "Date" })),
]
})data = await FileAttachment("./data/OSS.Dataset.-.December.2022.v3.csv").csv({ typed: true })governmentsByFrequencyDesc = d3.rollups(data, v => v.length, d => d['Government'])
.sort(([, a], [, b]) => d3.descending(a, b))
.map(([key]) => key)governmentsByFrequencyDescregionsByFrequencyDesc = d3.rollups(data, v => v.length, d => d.Region)
.sort(([, a], [, b]) => d3.descending(a, b))
.map(([key]) => key)regionsByFrequencyDesc