Public
Edited
Apr 16
Importers
2 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
rawdata = fetchp(csv_url).then((response) => response.text())
Insert cell
// data = d3.csvParse(rawdata, d3.autoType)
// data = await d3.csv(CORS_PROXY + url, d3.autoType)
data = FileAttachment("mom_co2@19.csv").csv()
Insert cell
Insert cell
FileAttachment("mom_co2@19.csv").csv({ typed: true })
Insert cell
co2_variation_vs_2019_m2m = {
// THIS used to work
// const v = await d3.csv(`${csv_url}`, d3.autoType);

// THIS for Attached File
// const data = d3.csvParse(
// await FileAttachment("mom_co2@10.csv").text(),
// d3.autoType
// );

// THIS does not work because of CORS
// const data = await d3.csv(
// "https://www.eurocontrol.int/performance/data/download/csv/mom_co2.csv",
// d3.autoType
// );

// rename MOM_GROWTH_CO2 to variation
// var res = obj.map(item => {
// item.data = item.WishListItems;
// delete item.WishListItems;
// return item;
// });

return data.map(({ MOM_GROWTH_CO2, ...rest }) => ({
...rest,
variation: MOM_GROWTH_CO2
}));
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
properties.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function proxifyUrl(url) {
return "https://corsproxy.io/?" + encodeURIComponent(url);
// return "https://crossorigin.me/" + encodeURIComponent(url);
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import { get as getURL } from "@spensaur/cors-anywhere"
Insert cell
Insert cell
mom_co2@19.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

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