Neighboring Congressional Districts
This example visualizes neighboring congressional districts from the 113th congress, highlighting the hovered district in red and its adjacent districts in orange. It uses topojson.neighbors to detect shared edges between district geometries. The map is rendered with d3.geo.path and an Albers USA projection, displaying district and state borders as white meshes. Hovering triggers a mouseover event that classifies neighboring districts via d3.selectAll, while the underlying geographic data comes from two TopoJSON files.
AI-generated descriptionThis example uses topojson.neighbors to compute neighboring congressional districts (from the 113th congress) from geographic boundaries by detecting shared edges (arcs). The red district is the hovered district, and the orange district is the neighboring districts.