forked from timmson/java-interview
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
59 lines (47 loc) · 1.19 KB
/
index.js
File metadata and controls
59 lines (47 loc) · 1.19 KB
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
51
52
53
54
55
56
57
58
59
import "./index.scss";
import go from "gojs";
import MindMap from "../../lib/mindmap";
import questions from "../../lib/questions";
const mindMap = new MindMap(questions);
const $ = go.GraphObject.make;
let nodeTemplate = $(go.Node, "Auto", {
locationSpot: go.Spot.Center
},
$(go.Shape, "RoundedRectangle",
{
//fill: "white",
portId: "",
cursor: "pointer",
fromLinkable: true,
fromLinkableSelfNode: true,
fromLinkableDuplicates: true,
toLinkable: true,
toLinkableSelfNode: true,
toLinkableDuplicates: true
},
new go.Binding("fill", "color")
),
$(go.TextBlock,
{
font: "bold 14px Lucida Console",
cursor: "pointer",
stroke: "#333",
margin: 6,
isMultiline: false,
editable: false
},
new go.Binding("text", "text").makeTwoWay()
)
);
const myDiagram = $(go.Diagram, "diagram", {
layout: $(go.ForceDirectedLayout)
});
// myDiagram.addDiagramListener("ObjectSingleClicked",
// function (e) {
// //console.log(e);
// });
const map = mindMap.getMap();
myDiagram.model = new go.GraphLinksModel(map.nodes, map.links);
myDiagram.nodeTemplate = nodeTemplate;
//myDiagram.isEnabled = false;
document.getElementById("currentYear").innerText = new Date().getFullYear().toString();