`.
- **Model** — holds the data (plain JS objects). You mutate the model via
`Diagram.set` or `Model.set`, never directly, so GoJS knows of the changes.
Modifying the model updates the Diagram
- **Template** — a `Node` / `Link` / `Group` with bindings, used as a factory
for parts. Assigned to `diagram.nodeTemplate`, etc.
- **Binding** — declarative link between a data property and a GraphObject
property. Created with `.bind()`, `.bindTwoWay()`, `.bindModel()`.
- **Panel** — a container GraphObject with a layout type (Auto, Vertical,
Horizontal, Spot, Table, etc.).
- **Tool** — a handler for a specific kind of user interaction (dragging,
resizing, linking, etc.). Registered on the `ToolManager`.
- **Layout** — positions nodes automatically. Common: `TreeLayout`,
`LayeredDigraphLayout`, `ForceDirectedLayout`, `GridLayout`.
## Common gotchas
- The host `
` must have explicit `width` and `height` set by CSS. A collapsed div
renders a blank diagram.
- Except for one-off Parts like legends and titles, do not construct `Node` or `Link`
instances and add them directly to a Diagram. Add _data_ to the model;
GoJS constructs Nodes and Links from your templates.
- To modify the model, wrap changes in `diagram.model.commit(m => { ... })`.
This ensures a transaction that can be undone via the `UndoManager`.
- Direct writes to JS objects in `Model.nodeDataArray` will not update the diagram.
You must use `Model.set`
- In `.bind(target, source)`, the **target** is the GraphObject property and
the **source** is the data property. `.bind("text", "label")` sets
`TextBlock.text` from `data.label`.