|
Prototype
Notes on the original Processing sketch in /tags/prototype/code_swarm.
The Processing prototype will not be developed or supported by this project. It is kept in tags for historical reference. Use at your own risk. Go to http://processing.org/learning for help with the Processing language. Source Files
So far only code_swarm.pde has been cleaned (mildly) and commented. DataThe files I use as input, which contain the commit events, are in event format.
There are other formats supported in the prototype, but these are deprecated. Configuring code_swarm.pdeYou will need to make a few changes inside code_swarm.pde in order to suit your program :
Executing code_swarmOnce you are ready, just click the "play/run" button and wait. This operation could take up to several hours for large activity logs. To give a rough idea, it takes 2 hours using one processor of a dual-core 1.3GHz for an activity log of about 15000 commits (spread over 4 years). Executing for PHP projectFor PHP projects (or any language that is not currently supported) you will need to:
void phpColors() {
//code (red)
colorAssigner.addRule( ".*\\.php", color(0,255,255), color(15,255,255) );
//documentation (blue)
colorAssigner.addRule( ".*/documentation/.*|.*/lang/.*|.*\\.html|.*\\.htm", color(150,255,255), color(170,255,255) );
//media (turquoise)
colorAssigner.addRule( ".*\\.gif|.*\\.jpg|.*\\.jpeg|.*\\.png|.*\\.css|.*\\.swf", color(120,255,255), color(135,255,255) );
//alternative code (orange)
colorAssigner.addRule( ".*\\.js|.*\\.jar|.*\\.war|.*\\.java|.*\\.class|.*\\.lzx", color(25,255,255), color(40,255,255) );
//anything else (purple)
colorAssigner.addRule( ".*", color(200,255,255), color(215,255,255) );
}Be careful that the color code is very tricky. We might need more information here, but the basic idea is that it's not a normal RGB code and it's not either a RGB color code mask. I added comments before every line so you can get an idea of what to use for at least five colors. Assigning ColorsThe ColorAssigner object is created at construction time and is a flexible way to color your file nodes. It's addRule() method takes one regular expression and two colors, essentially defining a map of file path to color range. During the event loop, when files are introduced to the system, the ColorAssigner.getColor() method looks at the files's path and tries to match it with a regular expression in its list. The getColor() method then returns a randomly chosen color from a linear interpolation of the range (in RGB space). Caveats:
RunningDownload and run the Processing IDE from http://processing.org. Open code_swarm.pde. |
Sign in to add a comment
looking at void loadRepository( XMLElement xml, String path, String filename ) could help figure out the format of postgres-repository.xml
Exists any tool to get the XML structure from a subversion repository? BTW, very impressive the result of your project, congratulations
try: svn log -v --xml > my_repo_log.xml
Here's a script I wrote to construct an event-formatted file (use loadRepEvents, not loadRepository) from a git repository: http://methlab42.itee.uq.edu.au/~jonathan/git-code-swarm.pl
I've tested this with a couple of projects and it seems to work.
Here is a nice and easy way to make a movie with mencoder:
And for a better quality movie:
After this is done, it is safe to delete the divx2pass.log and tmp.out files. The bitrate value is the final size of the movie you want. Make sure it's a negative value. Mencoder will use that value to calculate the bitrate needed to produce a movie of that size.
What does the Frame Rate actually do? One thing I was thinking was:
Which would allow you to specify how many snapshots / day. Wasn't sure how FRAME_RATE was being used, so created a new variable.
Another thing I saw had to do with the histogram. Might want to do:
// restrict history to drawable area while ( history.size() > (WIDTH / 2) ) history.remove();Which would allow the histogram to scale to larger resolution sizes.
Re: Comment by notverysmart, Jun 21, 2008
The git-log line in your perl script should be the author name, not the committer. The committer may be the person that merged the change into the canonical repository and may not have written the code.
Kind Regards.