Minimal GoJS Sample

This isn't a truly minimal demonstration of GoJS, because we do specify a custom Node template, but it's pretty simple. Click on the link below to see source code for this page, or use your browser's "View Page Source" command.

The Node template data-binds both the text string and the shape's fill color.

You can select, move, copy, delete, and undo/redo.

The Diagram.initialContentAlignment setting causes the diagram's contents to appear in the center of the diagram's viewport.

On touch devices, 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 that object.

For a more elaborate and capable sample, see the Basic sample.

For a sample that loads JSON data from the server, see the Minimal JSON sample.