This isn't a truly minimal demonstration of GoJS, because we do specify a custom Node template and turn on undo/redo support, but it's pretty simple. The whole source for the sample is shown below if you click on the link.

This sample sets the Diagram.nodeTemplate, with a Node template that data binds both the text string and the shape's fill color. For an overview of building your own templates and model data, see the Getting Started tutorial.

Using the mouse and common keyboard commands, you can pan, select, move, copy, delete, undo, and redo. On touch devices, use your finger to act as the mouse, and press and hold your finger stationary to bring up a context menu. The default context menu supports most of the standard commands that are enabled at that time for the selected object.

For a more elaborate sample, supporting grouping and tooltips and custom context menus, see the Basic sample.


GoJS Features in this sample