Public
Edited
Mar 20, 2023
3 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
fetch(
"https://raw.githubusercontent.com/simonepri/geo-maps/releases/download/v0.6.0/countries-coastline-1km.geo.json"
).then((res) => res.json())
Insert cell
countriesCoastline1kmGeo = FileAttachment("countries-coastline-1km.geo.json").json()
Insert cell
v.map((d) => ({ name: "poly_2", x: d[1], y: d[0] }))
Insert cell
v = countriesCoastline1kmGeo.features
.filter((d) => d.properties.A3 == "NOR")[0]
.geometry.coordinates.filter((d) => d[0].length >= 4553)[0][0]
Insert cell
DOM.download(export_CSV(v), "graph_data", "Save data as CSV")
Insert cell
// See https://observablehq.com/@palewire/saving-csv
function export_CSV(data) {
let parser = new json2csv.Parser();
let csv = parser.parse(data);
return new Blob([csv], { type: "text/csv" });
}
Insert cell
json2csv = require("json2csv@5.0.7/dist/json2csv.umd.js")
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