Hey so is the first major roadblock I have encountered as far as projects on this sit goes and after spending weeks on decided to look at source code and make sure I understand every line.
I think I get it for the most part but there is one thing I am a little unclear on and was wondering if anyone could explain to me what two sections of the code pen listed in the project actually does. Here is code pen: https://codepen.io/freeCodeCamp/pen/EZKqza
So early on in the code a variable called path is declared like so on line 22:
var path = d3.geoPath();
According to docs if my understanding is correct this generates a n svg path or d attribute based on geojson object since no argument given this uses Albers Usa projection which looks exactly like the projection listed.
Where i get confused are lines 127 and 165 where the attribute d is assigned to path like so:
.attr(“d”, path);
So if I am understanding correctly path is the d3.geoPath() wiht no args which is Albers USA projection. But how does tool tip, and this assignement know how to differentiate the counties and draw only that counties based on this. There doesn’t seem to be any logic written for accounting for this and my understanding so far is that geopath with no args just draws the projection as a whole but there is no way to interact with it with things like tool tips unless you modify it but that doesn’t seem to happen in this code.
Any help with clearing this up would be greatly appreciated thank you guys so much for your help in the past as well!