You have some real data about farmer's markets joined with the hexagons, but you can’t use it yet. All your data is still tucked away in the array of objects per hexagon. Let’s roll this data up.
The measure we want to visualize is the number of farmer's markets in each hexagonal area. Hence, all we need to do is to count the objects that have their datapoint value set to 1. While we’re at it, let’s also remove the layout point objects, that is, the objects with datapoint value 0; we won’t need them anymore.
We will add our task to the ready() function:
function ready(error, us) { // … previous steps var hexPointsRolledup = rollupHexPoints(hexPoints);}
Primarily, rollupHexPoints() will roll up the number ...