### GoJS Tree View

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 properties on the TreeLayout are set.

The node template makes use of a "TreeExpanderButton" panel to implement the expand/collapse button. It also implements a custom doubleClick function to allow nodes to be expanded/collapsed on double-click. Lastly, the source of the picture on each node is bound to two different properties, Node.isTreeLeaf and Node.isTreeExpanded; the imageConverter function is used to select the correct image based on these properties.

There are two link templates in the source code, one which uses no lines, and one which connects the items with dotted lines.

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