UNPKG

gojs

Version:

Interactive diagrams, charts, and graphs, such as trees, flowcharts, orgcharts, UML, BPMN, or business diagrams

49 lines (47 loc) 2.14 kB
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Minimal GoJS Sample</title> <meta name="description" content="An almost minimal diagram using a very simple node template and the default link template." /> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- Copyright 1998-2020 by Northwoods Software Corporation. --> <script src="../samples/assets/require.js"></script> <script src="../assets/js/goSamples.js"></script> <!-- requires minimal.js, built from minimal.ts --> <script> function init() { require(["minimal"], function(app) { app.init(); }); } </script> </head> <body onload="init()"> <div id="sample"> <!-- The DIV for the Diagram needs an explicit size or else we won't see anything. This also adds a border to help see the edges of the viewport. --> <div id="myDiagramDiv" style="border: solid 1px black; width:400px; height:400px"></div> <p> This isn't a truly <i>minimal</i> demonstration of <b>GoJS</b>, because we do specify a custom Node template, but it's pretty simple. The whole source for the sample is shown below if you click on the link. </p> <p> This sample sets the <a>Diagram.nodeTemplate</a>, with a <a>Node</a> 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 <a href="../learn/index.html">Getting Started tutorial.</a> </p> <p> Using the mouse and common keyboard commands, you can pan, select, move, copy, delete, and undo/redo. On touch devices, use your finger to act as the mouse, 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. </p> <p> For a more elaborate and capable sample, see the <a href="basic.html">Basic</a> sample. For a sample that loads JSON data from the server, see the <a href="minimalJSON.html">Minimal JSON</a> sample. </p> </div> </body> </html>