Public
Edited
May 22
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
leafSVG = 'M 0 0 C 0.3232 -0.077 0.7387 -0.1231 1 0 C 0.7079 0.1154 0.354 0.0616 0 0 Z'
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
data = d3.groups(raw_data, d => d.indicator, d => d.country).map(d => {
// const thisData = d[1]
const thisData = d[1].map(d2 => {
const len = d2[1].length
return d2[1][len - 1]
})
const obj = {
indicator: d[0],
data: thisData
}
return obj
})
Insert cell
raw_data = d3.csvParse(await FileAttachment("HSL_05032023061412245.csv").text(), d3.autoType).map(d => {
const obj = {
country: d.Country,
indicator: d.Indicator,
time: d.Time,
value: d.Value,
flags: d['Flag Codes']
}
return obj
})
.filter(d => d.value >= 0)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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