// Create an empty SVG with 960px width and 600px height.
constsvg=DOM.svg(960,600);
// Create an instance of geoPath.
constpath=d3.geoPath();
// Use the path to plot the US map based on the geometry data.
d3.select(svg)
.append('g')
.selectAll('path')
.data(data)
.enter()
.append('path')
.attr('d',path);
returnsvg;
}
html`
<style>
path {
fill: #fff;
stroke: #000;
}
</style>`
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.