This editable organizational chart sample color-codes the Nodes according to the tree level in the hierarchy.

Double click on a node in order to add a person or the diagram background to add a new boss. Double clicking the diagram uses the ClickCreatingTool with a custom ClickCreatingTool.insertPart to assign an ID.

Drag a node onto another in order to change relationships. You can also draw a link from a node's background to other nodes that have no "boss". Links can also be relinked to change relationships. Right-click or tap-hold a Node to bring up a context menu which allows you to:

Deleting a Node or Link will orphan the child Nodes and generate a new tree. A custom SelectionDeleting DiagramEvent listener will clear out the boss info when the parent becomes undefined.

Select a node to edit/update node data values. This sample uses the Data Inspector extension to display and modify Part data.

To learn how to build an org chart from scratch with GoJS, see the Getting Started tutorial.

Diagram Model saved in JSON format: