Skip to main content
100%

Neighboring Congressional Districts

✓ Published0🌍 Public
Mmbostock
Last edited Feb 9, 2016
Created on Feb 4, 2014

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 description

This 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.

gpl-3.0 Licensed

Similar vizzes