Published
Edited
Sep 25, 2019
Insert cell
Insert cell
{
const context = DOM.context2d(width, height);
const files = ["AL062018_lin", "AL062018_pts", "AL062018_radii", "AL062018_windswath"];
yield context.canvas;
let a = [];
mutable z = 0;
const path = d3.geoPath(projection, context);
const source = await shapefile.open("https://pbogden.com/mapping/data/florence/" + files[1] + ".shp", null);
while (true) {
const result = await source.read();
if (result.done) break;
a.push([result.value]);
mutable z++;
context.beginPath(), path(result.value), context.stroke();
}
}
Insert cell
mutable z = 0;
Insert cell
projection2 = d3.geoAlbersUsa()
.scale(1285)
.translate([width / 2, height / 2])
Insert cell
projection = d3.geoOrthographic().rotate([110, -40]) // See: https://observablehq.com/@d3/orthographic
Insert cell
height = 600
Insert cell
d3 = require("d3-geo@1")
Insert cell
shapefile = require("shapefile@0.6")
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