Published
Edited
Oct 12, 2018
1 star
Insert cell
Insert cell
projection = d3CompositeProjections.geoAlbersUsaTerritories().scale(scale)
Insert cell
Insert cell
svgMap = {
const path = d3.geoPath(projection);
const svg = d3.select(DOM.svg(width, height))
.style("width", "100%")
.style("height", "auto");
svg.append("path")
.datum(land)
.attr("fill", "#ccc")
.style("stroke", "#555")
.attr("d", path);
svg.append("path")
.style("fill","none")
.style("stroke","#000")
.attr("d", projection.getCompositionBorders());
return svg.node();
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
d3 = require("d3-fetch@1", "d3-geo@1", "d3-selection@1")
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