This chapter covers
- Manipulating GeoJSON and TopoJSON data
- Comparing projections and their effect on map layouts
- Drawing points on a map
- Enabling a zoom and pan functionality
- Listening to the brushing event
The last type of visualization that we’ll discuss in this section is maps. Maps are a symbolic interpretation of geospatial data. They use different projections to draw the surface of the globe we live on onto a flat 2D plane.
Because mapmaking and geographic information systems (GIS) and geographic information science (GIScience) have been in practice for so long, well-developed methods exist for representing this kind of data. D3 has robust built-in functions to load and display geospatial data, and most of them are included in the d3-geo module.
In this chapter, we’ll use two types of geographic data: GeoJSON and TopoJSON. We’ll study different projections from which we’ll create maps. We’ll also add standard functionalities, such as allowing users to zoom and pan the map, and less common ones, such as listening to a brushing event to filter the data visualized by the map.