Skip to content

Instantly share code, notes, and snippets.

@tswistak
Last active June 4, 2018 09:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tswistak/720c69479bf5198b02e9c5841a6f288e to your computer and use it in GitHub Desktop.
Save tswistak/720c69479bf5198b02e9c5841a6f288e to your computer and use it in GitHub Desktop.
GoJS tutorial part 1, listing 2
diagram = (function(){
var $ = go.GraphObject.make;
var diagram;
var initDiagram = function () {
diagram = $(go.Diagram,
'diagram-content', {
initialContentAlignment: go.Spot.Center
});
}
return { initDiagram };
})();
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gojs/1.8.12/go.js"></script>
<script src="diagram.js"></script>
</head>
<body>
<div id="diagram-content" style="height: 800px; border: 1px solid black;"></div>
<script>
window.onload = function() {
diagram.initDiagram();
};
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment