Public
Edited
Dec 8, 2022
Insert cell
Insert cell
{
const context = DOM.context2d(width, height);
yield context.canvas;
const path = d3.geoPath(projection, context);
const source = await shapefile.open(await FileAttachment("UScounties.shp").stream(), null);
while (true) {
const result = await source.read();
if (result.done) break;
context.beginPath(), path(result.value), context.stroke();
}
}
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