Let's add path elements for each element in our dataset. Add the following code to the bottom of app.js:
var path = d3.select('g').selectAll('path')
.data(dataset)
.enter()
.append('path')
.attr('fill', function(d) {
return colorScale(d.label);
});
If we examine our elements in the developer tools, we'll see that the paths were added, and each path has a fill value, as determined by colorScale(d.label), which is mapping the label of each data object to a color:
![](https://static.packt-cdn.com/products/9781789342383/graphics/assets/44c97e7f-30fd-4b1e-9c1d-3382e11fbc2d.png)