UNPKG

gojs

Version:

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

38 lines (35 loc) 1.42 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="../assets/js/goSamples.js"></script> <!-- requires minimalModule.js, built from minimalModule.ts --> <script type="module"> import { init } from "./minimalModule.js"; // lib needs: export const go = self.go; window.onload = function() { init(); } </script> </head> <body> <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 sample uses <code>&lt;script type="module"&gt;&lt;/script&gt;</code> to import from <code>minimalModule.js</code>, which imports GoJS from <code>go-module.js</code> </p> <p> In some browsers, you may need to serve this file from localhost to allow ES6 imports. </p> <p> There are many more samples using <code>go-module.js</code> in the <code>../extensionsJSM</code> directory. </p> </body> </html>