block by emeeks c5c36485442d1779581d

Choropleth 2 - d3.carto.map

Full Screen

A simple choropleth map made with d3.carto.map.

After adding a tile layer and a topojson layer, you can access the features either by using map.layers() or the layer if assigned to a variable or via d3.selectAll.data() on the appropriate elements. You can then style the features based on their properties. In this case, the size of the ward.

Some hover behavior can also be defined using D3. Here we the wards in a shared region are turned semi-transparent.

index.html

d3map.css