Public
Edited
Sep 27, 2023
Insert cell
Insert cell
topoData = FileAttachment("OR_SDs_simplified@6.topojson").json()
Insert cell
{
const width = 960;
const height = 600;

const svg = d3.select(DOM.svg(width, height));

const projection = d3.geoMercator().fitSize([width, height], topojson.feature(topoData, topoData.objects.OR_SDs_merged));
const pathGenerator = d3.geoPath().projection(projection);

svg.selectAll("path")
.data(topojson.feature(topoData, topoData.objects.OR_SDs_merged).features)
.enter().append("path")
.attr("d", pathGenerator)
.attr("fill", d => d.properties.NAME === "School District Not Defined" ? "#ff0000" : "lightgray")
.attr("stroke", "black");

return svg.node();
}

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