d3-geo

Generate and render maps from GeoJSON/TopoJSON data using D3 projections.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/zacharyr0th/next-starter --skill d3-geo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: d3-geo
Source: https://github.com/zacharyr0th/next-starter/tree/main/.claude/skills/d3/d3-geo
Command: npx skills add https://github.com/zacharyr0th/next-starter --skill d3-geo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Use when creating maps, working with geographic projections, or manipulating GeoJSON data. This skill provides expert guidance on world maps, choropleth maps, projection types, geo path generators, spherical geometry, and geographic feature handling.

Core Features & Use Cases

  • World maps and choropleth maps with various projections (e.g., Mercator, Natural Earth)
  • GeoJSON/TopoJSON processing and path generation
  • Projections configuration (scale, translate, rotate)
  • Geographic computations (centroids, bounds, great-circle distance)
  • Integration with graticules, clipping, and rotation for dynamic maps

Quick Start

Use this skill to get a complete example transforming GeoJSON into an SVG path, or to configure a world projection for your dataset.

Frequently Asked Questions about d3-geo

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a world map from GeoJSON data using D3 projections?

D3 projections transform geographic coordinates into screen coordinates. Load GeoJSON, select a projection (Mercator, Natural Earth, etc.), configure scale and translate, then use a path generator to render features as SVG paths on your canvas.

What's the difference between GeoJSON and TopoJSON, and when should I use each?

GeoJSON stores raw geographic features with full coordinate redundancy; TopoJSON compresses shared boundaries to reduce file size. Use TopoJSON for large datasets or network-constrained environments, GeoJSON for simpler or pre-processed data.

How do I configure D3 projection scale, rotation, and centering for regional maps?

Set projection.scale() to zoom level, projection.translate() for screen position, and projection.rotate() for axis alignment. Compute bounds from your GeoJSON and fit the projection using scale and translate to center your region.

Can I build choropleth maps and compute geographic properties like centroids and bounds?

Yes. D3 geo provides path generators for rendering features and supports spherical geometry operations including centroid and bounds computation. Join data to GeoJSON properties, apply color scales, and render with projections.

Why does my map have dateline wrapping issues or rendering artifacts?

Dateline wrapping occurs when features cross the ±180° meridian. Control it using projection.clipAngle() and projection.clipExtent(). Debug by inspecting coordinate ranges in your GeoJSON and adjusting projection rotation or clipping parameters.

How do I measure distances on a sphere or work with globe visualizations?

D3 geo includes spherical distance functions for great-circle calculations. Use orthographic or stereographic projections for globe views, apply rotation to animate the perspective, and combine with graticules for grid reference lines.