Draws a dynamic may tree using canvas and javascript