Public
Edited
Mar 28
Insert cell
Insert cell
Andrapradesh = FileAttachment("andhra-pradesh.geojson").json()
Insert cell
{
const width = 900;
const height = 600;

const projection = d3.geoEquirectangular()
.fitExtent([[0, 0], [width, height]], Andrapradesh);

const geoGenerator = d3.geoPath().projection(projection);

const svg = d3.create("svg")
.attr("width", width)
.attr("height", height);

svg.selectAll("path")
.data(Andrapradesh.features)
.enter()
.append("path")
.attr("d", geoGenerator)
.attr("fill", "black")
.attr("stroke", "white")
.attr("stroke-width", 1);

return svg.node();
}

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