Public
Edited
Mar 1, 2023
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
rawdata = fetchp("https://fred.stlouisfed.org/graph/fredgraph.csv?id=UNRATE").then(response => response.text())
Insert cell
data = d3.csvParse(rawdata)
Insert cell
Insert cell
url = "https://fred.stlouisfed.org/graph/fredgraph.csv?id=UNRATE"
Insert cell
proxy_url = 'https://corsproxy.io?' + encodeURIComponent(url)
Insert cell
myrawdata = fetch(proxy_url).then(response => response.text())
Insert cell
mydata = d3.csvParse(myrawdata,d3.autoType)
Insert cell
import {LineChart} from "@jwolfers/line-chart"
Insert cell
chart = LineChart(mydata, {
x: d => d.DATE,
y: d => d.UNRATE,
yLabel: "Unemployment rate (%)",
width: 800,
height: 500,
color: "steelblue",
chartTitle: "Unemployment Rate"
})
Insert cell
console.log(chart)
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