Skip to content
Maps

County Choropleth

A US county choropleth rendered as inline SVG from a caller-supplied TopoJSON, with theme diverging or sequential ramps, state borders, and a hover tooltip. Use it for print-quality county maps in articles; for zoomable, high-cardinality maps reach for the MapLibre engine instead.

Theme

County Choropleth

Installshow
viz add d3/geo/county-choropleth-v1

Props

PropTypeDescription
dataCountyChoroplethData{ topology (counties TopoJSON), counties: {fips, value, label?, sub?}[], domain?: [lo,mid,hi], unit?, title?, subtitle?, source? }.
domainnumber[]Override the color domain. [lo, mid, hi] = diverging; [lo, hi] = sequential.

See full TypeScript interface on GitHub for all props.

Usageshow
TypeScript
import CountyChoropleth from '@/viz/components/d3/geo/county-choropleth-v1';

Metadata

  • FrameworkD3 / SVG
  • CategoryMaps
  • Sourced3/geo/county-choropleth-v1
geographic choropleth county topojson d3

Dependencies

topojson-clientd3-geod3-scale