Live data from Hacker News

How We Built USA Today's Election Night Maps

mapbox.com

11–20 of 20 posts

Re: How We Built USA Today's Election Night Maps

#11
post #8
post #7

Earlier quoted context omitted.

Less narrative, I guess, but I think that's just a different preference of meaning for "how."

Ok, well if there's anything specific, I'm happy to post some gists.

What data source(s) did you use to display counties?

Re: How We Built USA Today's Election Night Maps

#12
post #11
post #8

Earlier quoted context omitted.

Ok, well if there's anything specific, I'm happy to post some gists.

What data source(s) did you use to display counties?

For the county shapes, the low res data is from D3: https://github.com/mbostock/d3/tree/master/examples/data and the hi res data is processed from the US census: http://www.census.gov/geo/www/cob/

Re: How We Built USA Today's Election Night Maps

#13
post #10

I learned about this: R2D3: > Since it doesn’t get bogged down with supporting legacy browsers without SVG support, we switched over to R2D3 for versions of Internet Explorer less than IE9. https://github.com/mhemesath/r2d3/ It's that easy to provide IE support for D3?

IE9 works well with D3 without any work. For IE 1. remove the use of SVG groups which are not supported in VML (though I think r2d3 has had a recent update with some level of group support) 2. Avoid selecting features paths by class (e.g. us d3.select('path') instead of d3.select('path.state') Class selectors just wouldn't work for us. 3. for performance, we used only the most simplified geographic data in IE < 9 4) 4. Avoid using d3.mouse for mouse location. Didn't work right in IE

Re: How We Built USA Today's Election Night Maps

#16
post #9
post #7

Earlier quoted context omitted.

Less narrative, I guess, but I think that's just a different preference of meaning for "how."

Personally, I loved the narrative. Which I mention not to suggest you shouldn't want something else, but so that the authors know that people liked it as is.

I also found the narrative really helpful. We run some similar products around maps, it was interesting to see how they approached this!

Re: How We Built USA Today's Election Night Maps

#18
This is a great write-up.

I love seeing your thought process on how you tackled the project. The bonus playback of realtime results and the not preloading county data are two very good examples of problems that need solving when you take on a project like this. Super write up.

Re: How We Built USA Today's Election Night Maps

#19
post #14

I really like that map with overlaid discs representing the number of EV for each state. I think it's much clearer than the usual method of distorting the map to make each state's area proportional to its number of EV.

"each state's area proportional to its number" = that class of map is called a cartogram

Re: How We Built USA Today's Election Night Maps

#20
post #3
post #2

I was hoping for some code listings.

Sure, what are you looking for?

I'd like to know more about the SVG / VML fallback for rendering. We are working on a system where we are doing SVG directly and have a "TODO" for figure out how to get it rendered in IE
Post reply on HN