This shows how to create a traditional "TreeView" in a GoJS diagram. There are 500 nodes in the tree.

Look at this page's source code to see how the TreeLayout is customized.

The node template makes use of a "TreeExpanderButton" panel to implement the expand/collapse button.

See the Intro page on Buttons for more GoJS button information.