Library for auto-generating a rooted tree diagram