meatballs / DjAxelrod

A repository to reproduce Axelrod's iterated prisoner's dilemma as a Django based web application.
MIT License
5 stars 4 forks source link

Tournament Results Page #29

Closed meatballs closed 9 years ago

meatballs commented 9 years ago
meatballs commented 9 years ago

Work so far is on branch 29

meatballs commented 9 years ago

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?

mmcardle commented 9 years ago

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.

meatballs commented 9 years ago

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.

drvinceknight commented 9 years ago

For info: @martinjc (who wrote the original d3 stuff) said he'd take a look this weekend :)

mmcardle commented 9 years ago

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:

meatballs commented 9 years ago

@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

martinjc commented 9 years ago

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?

mmcardle commented 9 years ago

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?

meatballs commented 9 years ago

I've pushed some tidying up to the urls and views

meatballs commented 9 years ago

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.

drvinceknight commented 9 years ago

Guys, I've just run #29: SO FRICKING COOL!!! :dancer: :+1: :fireworks: :trophy: :smiley_cat: :dog: etc...

Really looking great already.