Public
Edited
Jun 16, 2023
Insert cell
Insert cell
wikipedia = d3.csv(getCsvUrl("https://docs.google.com/spreadsheets/d/1nBuDIKv67qX73UXsQy-Gd_cJc609NJPugLQy3Dlp4Tw/edit#gid=0"), d3.autoType)
Insert cell
getCsvUrl = url => {
url = new URL(url);
const id = url.pathname.split("/")[3]
const gid = new URLSearchParams(url.hash.slice(1)).get("gid") || 0;
return `https://docs.google.com/spreadsheets/d/${id}/export?format=csv&gid=${gid}`
}
Insert cell
parseDate = d3.utcParse("%Y")
Insert cell
clean_wiki = wikipedia.map(d => ({...d, population: d.MSA, date: parseDate(d.Since)}))
Insert cell
Inputs.table(clean_wiki)
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