Web based live graphs?

Status
Not open for further replies.

madjoe

Ars Scholae Palatinae
735
Subscriptor
I was really impressed with the NYTimes election coverage website and am curious if anyone knows what they used to update their graphs in real time.

http://www.nytimes.com/elections/forecast/president

Anyone have any idea? I'm more interested in what they did on the client side, not how something like this could be done on the backend.

Thanks
 

Mile Zero

Ars Praetorian
578
Subscriptor++
The NYT's graphing code is not obfuscated, so you can read through it pretty easily. In this case, they built it on top of D3, which is what they use for almost all of their graphing.

I also dug into this a little, because I worked on an election dashboard myself, and so the "needle jitter" intrigued me. I got confirmation later from Jeremy Bowers at the Times that it was just Math.random(), scaled to the expected polling error at that time in the night, and added to the current model prediction value. (see also: https://twitter.com/jeremybowers/status ... 5777952771)

The results themselves came in via standard Associated Press feeds, and were updated once every 30 seconds. NYT/NPR open-sourced their AP election data client, Elex, earlier this year. But you'll need a costly API key to use it.
 
[url=http:/civis/viewtopic.php?p=32353881#p32353881:30ognadl said:
Mile Zero[/url]":30ognadl]The NYT's graphing code is not obfuscated, so you can read through it pretty easily. In this case, they built it on top of D3, which is what they use for almost all of their graphing.

I also dug into this a little, because I worked on an election dashboard myself, and so the "needle jitter" intrigued me. I got confirmation later from Jeremy Bowers at the Times that it was just Math.random(), scaled to the expected polling error at that time in the night, and added to the current model prediction value. (see also: https://twitter.com/jeremybowers/status ... 5777952771)

The results themselves came in via standard Associated Press feeds, and were updated once every 30 seconds. NYT/NPR open-sourced their AP election data client, Elex, earlier this year. But you'll need a costly API key to use it.

Fun Fact: the NYT graphics team employed Mike Bostock, the creator of D3.js. His website is a great resource: https://bost.ocks.org/mike/
 
Status
Not open for further replies.