To create the data for the map, the only geoprocessing that was required was changing the projection into WGS 84, which initially gave me some problems, but I was able to solve them. There may be sampling bias in this data, because eagles are only reported where they are SEEN, so there may be eagles counted multiple times or totally missed all together because there were no people around to actually see them. Additionally, people may fail to report an eagle sighting which can further skew the data.
I chose to use natural breaks, because this is a heavily skewed data set, and I believed that natural breaks would represent the data appropriately over a different data classification. There are 5 classes, with breakpoints at 145, 490, 1151, 2465, and 5405..
There does not appear to be a strong distribution pattern in this data set. It mostly appears to be pretty evenly distributed across the country, with a lighter gradient up through the middle of the country, which may indicate that eagle habitat may not be in that area, or that there is lower population so sightings may be less. If we see this pattern because of eagle habitat, it may be because that area is a dryer desert and lacks water sources eagles need to survive.
To create a legend, model your code after the second line of svg.append("g") above. You can move the legend from right to left by changing the x coordinate that are next to translate in the code above. To move it up and down, change the y coordinate. Call your colors that you defined for color, title is dictated by the title you wrote earlier in the data line, width determines the width of the legen, and the tickFormat determines the amount of decimal places. Just change the number next to f to do so.
SVG is basically the canvas you use that you add all of the parts of a map to like the legend. It reads from the TopoJson and helps determine the polygons on you map. There are several properties you can use to add detail to your map.
To change the stroke line width, look above at the third SVG paragraph of code. You can change the number where it says .attr("stroke-width", 1) to change the line widths! To change the color, you can change where mine says white on the line .attr("stroke", "white").
You can change the values that appear when you hover over polygons on the map by editing the line above that looks like: .text(d => "Eagle Counts: " + data.get(+d.properties.GEOID));. Change the title by editing where I have eagle counts, and make sure to change where it says GEOID with what your using that is an identifier on both your topojson and csv file (like FIPS, etc). This line pulls the information from your data line down and see what polygon you are asking information for, and shows the matching number that you defined earlier.
Geometries between the csv file and the topojson file are joined by using a common property that is present in both files; in my case, I used GEOID. We can check that our topojson file has this by clicking the drop-down arrow in the counties line, and seeing that properties are present and that GEOID is available. You can actually open the csv data sheet in excel and see that that is a column. I made sure that the GEOID's matched between both files so that they would properly match up on observable. Then, when creating the csv line, I made sure to define GEOID and then use it and Join_Count to be displayed later, such as in the data line after this.
To use colors from color brewer, simply go to the website! You can choose the number of classes from the drop-down menu on the top, and pick between sequential, diverging, and qualitative. Qualitative is best when order doesn't matter between your data sets. Then you pick a color scheme! You can copy and paste the codes for the colors into observable, and create a name for you scheme.
When using the colors, you will choose your color scheme by defining it as described above, and then when creating the classification for the map, you can simply call the color scheme into that line, and observable will use that color scheme to make the classification scheme. You will also use the colors on the legend and to make the actual chloropleth map using your classification, and the legend.