Skip to main content
100%

Merging States

✓ Published0🌍 Public
Aackuser
Last edited Feb 9, 2016
Created on Jul 1, 2023

A choropleth of U.S. states highlights a selected subset in orange while the remaining states appear gray with white interior boundaries. The example demonstrates `topojson.merge`, which combines multiple polygon geometries into one unified path, removing shared borders between selected states. It uses D3 v3 with `d3.geo.albersUsa` projection, `d3.geo.path` for rendering, and TopoJSON to load the U.S. state data. The selected states are chosen by a hardcoded set of state IDs, and the merged result is drawn as a single SVG path.

AI-generated description

This demonstrates using topojson.merge, a new feature in TopoJSON 1.6, to merge multiple polygons into a single polygon whilst removing interior borders. (An alternative approach is to draw the polygons twice.)

This example is in response to a Stack Overflow question.

gpl-3.0 Licensed

Similar vizzes