data4 = {
const data = await FileAttachment(
"access-to-clean-fuels-and-technologies-for-cooking.csv"
).csv({
typed: true
});
const countriesToShow = ["Togo", "Sri Lanka", "Malawi", "India", "World"];
return data
.filter((d) => d["Year"] >= 2000)
.map((d) => ({
year: new Date(d["Year"], 0, 1),
yearInt: d["Year"],
percent:
d[
"Indicator:Proportion of population with primary reliance on clean fuels and technologies for cooking (%) - Residence Area Type:Total"
],
country: d["Entity"]
}))
.filter((d) => countriesToShow.includes(d.country));
}