Drawing a map with D3
Although it's not difficult to draw a map using the D3 tools we already know, the d3-geo module makes it much easier to create sophisticated maps. You can quickly render data from a GeoJSON file with just a few lines of code. It also contains functions to convert between Cartesian and geographical systems and you can choose among over one hundred different map projections.
The d3-geo module is part of D3's default bundle. If your project includes the full d3.js library you don't have to load anything else. It contains 15 popular projections (from over 100 projections available in two other optional D3 modules).
The main shape generator in the d3-geo module is the d3.geoPath() function. It returns a function that takes ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access