Tree Diagram is not updating dynamically like http push for add nodes

Could you please format your code properly? There seem to be typos and missing characters in them too.

To format code blocks, markdown requires surrounding the code with lines consisting of triple backquote.