D3 Choropleth map not passing tests

My D3 Choropleth map is only passing 5 tests even though it “works”.


The tests it is failing are:
4. There should be at least 4 different fill colors used for the counties.
I tested this and found there to be 263 unique fill colors
5. My counties should each have “data-fips” and “data-education” properties containing their corresponding fips and education values.
I inspected many (but not all) county elements and they all have the data-fips and data-education properties corresponding to their county.
6. My Choropleth should have a county for each provided data point.
I’m pretty sure this works considering I’m not getting any errors and counties appear to have generated properly.
7. The counties should have data-fips and data-education values that match the sample data
9. There should be at least 4 different fill colors used for the legend.
I’m using a linear gradient with 6 stops so there are definitely 4 different colors used.

It also fails the 2 tooltip tests. Functionally it works, when I mouseover a county it shows all of the relevant information.

  1. I can mouse over an area and see a tooltip with a corresponding id=“tooltip” which displays more information about the area.
  2. My tooltip should have a “data-education” property that corresponds to the “data-education” of the active area.

The class county attribute should be placed after you append the path, otherwise, I think the class will apply to the group as a whole, and not to the individual counties. This will make your Choropleth map pass all but the legend color test, which I think is not passing because your using a linear gradient as opposed to individual, discrete colors. However, passing the tests I do not think is that important - your map IS totally functional without the changes I described, and looks quite good.