Innovation Session: The History of NFL Win Percentages – Part 4
As I dove in tonight I realized that the way I was doing things wasn’t going to work. D3.csv() loops over every row in the csv that is loaded and performs the described operations on it. I was looping over the season data which meant that I was doing things hundreds of times rather than 32.
I decided to refactor my code so that I now loop over the team data csv and then for each team go pull the season data as part of the process.
The second roadblock was with the way I am accessing the second csv, the one with the season data. Because it is asynchronous, I wasn’t able to return the formula for the line to the place that calls it – I then tried plotting from within the call and ended up with hundreds of the same line.
I think I need to load the second csv using a different process.
Nothing is working right now, so I haven’t updated the live code, but I updated the code on github if anyone feels like taking a look and helping me out of this jam.