This small CoffeeScript script draws the wordcloud into a Raphaël canvas. The source is well documented (for my standards anyway) and is very short so it should be very easy to follow and understand.
The algorithm was stolen^Wcopied from PyTagCloud.
Before you open index.html, please make sure to compile the wordcloud.coffee
coffee -c wordcloud.coffee.