D3 | Choropleth Map

D3 | Choropleth Map
0

#1

Hello Everybody, i just completed my d3 project no 4 Choropleth Map
here is the link:


give me any feedback or advice


#2

This is really good, i would suggest making the bar with the percentages bigger.


#3

Hi Michael,
thanks for your feedback and please check it again i tried to fix it. :sweat:


#4

Great map! I liked the transparency on the hover popover background.

  • Why the “don’t look at my code” comment? The code seemed very readable and not ugly at all. It was all nicely indented with newlines in useful places like inRange callback on Line 65.
  • Why lets instead of consts for the promise declarations on Lines 19 and 26? I think const is preferred if the variable is never reassigned.
  • The code could be DRY’d up a little more for those Promise bodies too. Could jQuery’s .ajax help with sending the request and automatically parsing the JSON formatted response body? http://api.jquery.com/jquery.ajax/

Happy coding!


#5

thanks for your feedback Dave,
i forget to remove the comment “don’t look at my code” and i write it cos i think that my code is so ugly,
i use let cos its short in spelling from const,
i don’t know that how can i use jQuery’s .ajax but thanks for link its so helpful
:relaxed::blush:


#6

(hit the reply button or i do not get a notification)


#7

Hey there!

Nice work. I would make a few improvements here and there, though.

  1. The website is not responsive. Keep in mind a big percentage of people surf the web behind their phones.
  2. The tooltip is visible (at least in my phone) in the top left corner, before clicking on any county. See the screenshot.
  3. When I click on a county, the tooltip shows up correctly, but I miss some feedback on what county I clicked exactly. Changing the fill or giving it a stroke would help. This is specially useful when two or more adjacent counties are in the same range of education; they will look like a single county and, when clicking on one of them, you the user won’t know exactly where he/she clicked.
    Have a look at my Choropleth map to see what I’m talking about. Click on any county to check the difference.
  4. The most important of all. The counties are not correctly displayed on the map. For example, where it should say San Diego County, in California, it says Vinton County, in Ohio! :smiley:

Other than that, great job. D3 has a steep learning curve in my opinion and you’re doing great.


#8

hi, Yago your choropleth map looks great its perfect and thanks for your advice
i tried a lot to make my choropleth responsive but i dont fix it sooo
i created a new choropleth map here it is:


its responsive , tooltip is invisible on mouseout and i think it shows correct county
but how can you add the stroke?
i don’t know how to add it, i need your help to add stroke


#9

maybe its better than first one


#10

Thanks for the compliments!

Now, that’s a good Choropleth Map! Good job!

To highlight the selected county, you can change the fill property on the state hover selector, for example. This way, whenever you hover over a county it will highlight and also when tapping on a phone.


#11

Okay thanks for your feedback and help i would work tommorow on it


#12

hi yago, i fix it check it again


#13

Much better, yeah :wink: