Help/learning request with automatic color scaling

16 views
Skip to first unread message

Jim

unread,
Sep 4, 2017, 7:39:52 AM9/4/17
to d3-js
Hey all,

I am kind of a new d3 user, and running into a roadblock with color scaling. My attempts thus far have focused around d3.scaleQuantize and d3.scaleQuantile, not with the best of results. I am making as practice a map of US Census 2015 state pop as found here. I turned it into a csv and produced this code to merge the two and produce a choropleth. If you run the code, it only shows the extremes of the scale. For a long time, I was wondering if it was entirely my code's fault, but after grabbing a different csv from my d3 book, I realized that my code was working just fine as all 9 of my scales (a constantly expanding number made in attempt to see some differentiation) were showing. 

Obviously I don't understand something about scaleQuantize or scaleQuantile, and the frustrating thing is that I have no idea what it might be. Is there a max limit on what numbers you might use for these scales? Is there something about the arrangement of the numbers that is making the  scales not work? Something completely different? 

Anyhow, nice to meet you all and thank you in advance. Hope you're having a good week. 
us-state-pop-2015.csv
us-states.json
Reply all
Reply to author
Forward
0 new messages