http://www.logarithmic.net/pfh-files/ghost-diagrams/ghost-diagrams-0.8.py