Published
Edited
Apr 18, 2019
Insert cell
Insert cell
chart = {
const width = 960;
const height = 600;
const projection = d3.geoAlbers()
const geoGenerator = d3.geoPath()
.projection(projection);
const svg = d3.select(DOM.svg(width, height))
projection.fitExtent([[20, 20], [width, height]], sandiego);

svg.append('g').selectAll('path')
.data(sandiego.features)
.enter()
.append('path')
.attr('class', 'feature')
.attr('d', geoGenerator)
.attr('fill', '#ccc')
.attr('stroke','#fff')
svg.append('g').append('circle')
.attr('cy', projection(marina)[0])
.attr('cx', projection(marina)[1])
.attr('r', 5)
.attr('fill', 'red')
return svg.node()
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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