Tournament Results Page
Closed this issue ยท 12 comments
- Create a page to show the results of a given tournament
- Return a link to the results page when a tournament completes rather than the current raw results data
- Show the results data on that page instead
- Pipe the results to the d3 graph and show that on the results page instead of the raw data
- Add a quick summary to show winner, loser etc
- Add a link to give raw results data
Work so far is on branch 29
Anyone got any thoughts on the best way to replace the csv files in vis.js with the actual results data from a tournament?
Do we subclass DetailView and add the results as json into the context object or is there a better way?
How big do the results sets get? I think that will determine how to serve them.
If they get big rendering them in the template wouldn't scale very well, serving them via the webserver instead of django would probably be needed.
Perhaps converting to json and loading via an ajax request, and using XSendFile if authentication if required. I can have a look if you want.
Until #38 is in place, they could be anything. But practically, it's usually a 60x200 matrix.
If you have a chance to have a look, that would be much appreciated. I'll be offline for the next few days.
For info: @martinjc (who wrote the original d3 stuff) said he'd take a look this weekend :)
I have pushed some updates to #29 branch, made a new url which returns the results data and changed the javascript to load from this url via a data-tournament-results-url attribute in the tournament details page.
Could you take a look to see if its what is required?
Still needed:
- Add a quick summary to show winner, loser etc
- Add a link to give raw results data
@mmcardle That's really starting to look the part! Excellent piece of work.
I think the URLs need tidying up a bit - it's odd for the results to appear at /tournament/PK/edit and for tournament/PK to bring up a create page.
Probably needs to be:
tournament/create - to create a new tournament
tournament/PK - to show the results page
I think @mmcardle's solution for the vis is good - an API endpoint that returns JSON version of the results seems like the neat way of doing things. Perhaps another endpoint for the names of the cheating players would be a good idea - then all the csv files can be eliminated.
Might also be nice to have an endpoint for the TournamentDefinition object, so we can make the visualisation labels dynamic (i.e. can get the number of repetitions etc.) - Or this could be included in the Tournament results JSON?
Yes i agree, the urls have become a bit muddled, does there even need to be a Tournament edit view?
It seems you wouldn't want to change the parameters of an existing Tournament but instead rerun with different parameters, creating a new Tournament object?
I've pushed some tidying up to the urls and views
Perhaps another endpoint for the names of the cheating players would be a good idea - then all the csv files can be eliminated.
I think we ought to able to get this list directly from the axelrod library without having to create another endpoint.
Guys, I've just run #29: SO FRICKING COOL!!! ๐ ๐ ๐ ๐ ๐บ ๐ถ etc...
Really looking great already.