Note: This is an BinaryTreeDrawer which can draw a general binarytree and save it as png file with pure javascript.
This is my first runnable program with javascript. So DON'T PANIC when you notice some strange codes.
I'll be glad if someone could give me advice on my program with best practice on javascript.
You can have a glance at this program with the link below : http://binarythink.net/project/BinaryTreeDrawer/
Thanks to nihilogic for providing a converter from canvas to img file. This solves the problem of non-firefox browser.