Thursday, September 18, 2014

d3 uses createWindow but latest jsdom removed it?

I was trying to use d3 with node.js. It seems that d3.js uses createWindow but latest jsdom removed it, so it gave error like:
 "Object [ null ] has no method 'createWindow' d3"
In jsdom's changelog it was mentioned that jsdom.createWindow was among removed jsdom APIs in version 1.0.0-pre.1. BTW, latest version of jsdom as of this writing is 1.0.0-pre.6, so a default installation of jsdom via "npm install jsdom" will not contain support for createWindow.
Hence, it seems that to run d3.js, older jsdom must be used, i.e., version 0.11.1 which is the latest version before 1.0.0-pre.1:
sudo npm remove jsdom 
sudo npm install jsdom@0.11.1

Monday, September 15, 2014

Analyzing contribution level to a git repository

I wondered if there is a handy tool for analyzing contribution level to a git repository, and found this: gitinspector and gitstats.

gitinspector
Once you got python installed, you can fire it with command like this:
./gitinspector.py -wTHl --format=htmlembedded --file-types=cs,cshtml,js,css  /path/to/git/repo/ >/path/to/resultdir/result.html

This will produce an HTML report
More options can be found here.

gitstats
If python is ready, on Mac another install is necessary, i.e., gnuplot. The easiest way is to use MacPorts to install it, by simply doing "sudo port install gnuplot".
Then run gitstats with command like this:

./gitstats /path/to/git/repo/ /path/to/resultdir/result