Implement #generate_tree_diagram