Mapping

D3 is a great tool for generating maps. To do so, we use specially formatted JSON data to generate <path> SVG elements. This specially formatted JSON data is called GeoJSON, and in this chapter, we'll use it to create a map of the world.

In this chapter, we will cover the following topics: 

  • Creating a map
  • Defining GeoJSON
  • Using a projection
  • Generating a <path> using a projection and GeoJSON data

The complete code for this chapter can be found at https: https://github.com/PacktPublishing/D3.js-Quick-Start-Guide/tree/master/Chapter08.

Get D3.js Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.