-
Notifications
You must be signed in to change notification settings - Fork 0
/
go.html
50 lines (46 loc) · 1.35 KB
/
go.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Statechart Diagram</title>
<script src="https://unpkg.com/gojs"></script>
<style>
#myDiagramDiv {
width: 800px;
height: 600px;
border: 1px solid black;
}
</style>
</head>
<body>
<div id="myDiagramDiv"></div>
<script>
const $ = go.GraphObject.make;
const myDiagram = $(go.Diagram, "myDiagramDiv", {
initialContentAlignment: go.Spot.Center,
"undoManager.isEnabled": true
});
myDiagram.nodeTemplate =
$(go.Node, "Auto",
$(go.Shape, "RoundedRectangle", { strokeWidth: 0, fill: "lightblue" }),
$(go.TextBlock, { margin: 8 }, new go.Binding("text", "key"))
);
myDiagram.linkTemplate =
$(go.Link, { routing: go.Link.AvoidsNodes, curve: go.Link.JumpOver },
$(go.Shape),
$(go.Shape, { toArrow: "Standard" })
);
myDiagram.model = new go.GraphLinksModel(
[
{ key: "Stage 1" },
{ key: "Stage 2" },
{ key: "Stage 3" }
],
[
{ from: "Stage 1", to: "Stage 2" },
{ from: "Stage 2", to: "Stage 3" }
]
);
</script>
</body>
</html>