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:

- Vacate Position - remove the information specfic to the current person in that role
- Remove Role - removes the role entirely and reparents any children
- Remove Department - removes the role and the whole subtree

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 is removed.

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.

If you want to have some "assistant" nodes on the side, above the regular reports, see the Org Chart Assistants sample, which is a copy of this sample that uses a custom TreeLayout to position "assistants" that way.

Diagram Model saved in JSON format:
{ "class": "go.TreeModel", "nodeDataArray": [ {"key":1, "name":"Stella Payne Diaz", "title":"CEO"}, {"key":2, "name":"Luke Warm", "title":"VP Marketing/Sales", "parent":1}, {"key":3, "name":"Meg Meehan Hoffa", "title":"Sales", "parent":2}, {"key":4, "name":"Peggy Flaming", "title":"VP Engineering", "parent":1}, {"key":5, "name":"Saul Wellingood", "title":"Manufacturing", "parent":4}, {"key":6, "name":"Al Ligori", "title":"Marketing", "parent":2}, {"key":7, "name":"Dot Stubadd", "title":"Sales Rep", "parent":3}, {"key":8, "name":"Les Ismore", "title":"Project Mgr", "parent":5}, {"key":9, "name":"April Lynn Parris", "title":"Events Mgr", "parent":6}, {"key":10, "name":"Xavier Breath", "title":"Engineering", "parent":4}, {"key":11, "name":"Anita Hammer", "title":"Process", "parent":5}, {"key":12, "name":"Billy Aiken", "title":"Software", "parent":10}, {"key":13, "name":"Stan Wellback", "title":"Testing", "parent":10}, {"key":14, "name":"Marge Innovera", "title":"Hardware", "parent":10}, {"key":15, "name":"Evan Elpus", "title":"Quality", "parent":5}, {"key":16, "name":"Lotta B. Essen", "title":"Sales Rep", "parent":3} ] }