This repository has been archived by the owner on Mar 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
CypherSearch.html
191 lines (177 loc) · 5.78 KB
/
CypherSearch.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<!doctype html>
<meta charset="utf-8"/>
<html>
<head>
<title>Neovis.js Simple Example</title>
<style type="text/css">
html, body {
font: 16pt arial;
}
#viz {
width: 100%;
height: 750px;
border: 1px solid white;
font: 22pt arial;
background: white;
}
/* Set additional styling options for the columns*/
.column {
float: left;
width: 50%;
}
.row:after {
content: "";
display: table;
clear: both;
}
</style>
</style>
<script type="text/javascript" src="https://rawgit.com/neo4j-contrib/neovis.js/master/dist/neovis.js">
</script>
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous"></script>
<script type="text/javascript">
var viz;
function draw() {
var config = {
container_id: "viz",
server_url: "bolt://localhost:7687",
server_user: "neo4j",
server_password: "1234",
physics: {
enabled: true,
barnesHut: {
springConstant: 0,
avoidOverlap: 0.5
}
},
labels: {
"Publication": {
"caption": "subtitle",
"size": "pageRank",
"community": "community",
"title_properties": [
"title",
"year",
"pageRank",
"community",
"community_INTRODUCTION",
"community_METHODS",
"community_RESULTS",
"community_DISCUSSION"
]
},
"InferedTool": {
"caption": "name",
"size": "pageRank",
"community": "community",
"title_properties": [
"name",
"keywords",
"community",
"community_INTRODUCTION",
"community_METHODS",
"community_RESULTS",
"community_DISCUSSION"
]
},
"Community": {
"caption": "mtopic",
"size": "pageRank",
"community": "ctopic",
"title_properties": [
"com_id",
"mtopic",
"mlanguage",
"mos",
"from_section",
]
}
},
relationships: {
"METAOCCUR": {
"thickness": "times",
"caption": "year"
},
"METAOCCUR_ALL": {
"thickness": "times",
"caption": "times"
},
"METAOCCUR_INTRODUCTION_ALL": {
"thickness": "times",
"caption": "times"
},
"METAOCCUR_METHODS_ALL": {
"thickness": "times",
"caption": "times"
},
"METAOCCUR_RESULTS_ALL": {
"thickness": "times",
"caption": "times"
},
"METAOCCUR_DISCUSSION_ALL": {
"thickness": "times",
"caption": "times"
},
"HAS_TOOL": {
"caption": false
} ,
"METAOCCUR_COMM": {
"thickness": "times",
"caption": "times"
}
},
initial_cypher :"" ,
arrows: false
};
viz = new NeoVis.default(config);
viz.render();
console.log(viz);
}
</script>
</head>
<body onload="draw()">
<div id="viz"></div>
<div class="row">
<div class="column">
Submit or Update the Cypher query: <textarea rows="4" cols=50 id="redocypher"></textarea><br>
<input type="submit" value="Submit" id="redoreload">
<input type="submit" value="Update" id="reload">
<input type="submit" value="Stabilize" id="stabilize">
</div>
</div>
</body>
<script>
// Submit Query
$("#redoreload").click(function() {
var cypher = $("#redocypher").val();
if (cypher.length > 3) {
viz.renderWithCypher(cypher);
} else {
console.log("redoreload");
viz.reload();
}
});
</script>
<script>
// Update Query
$("#reload").click(function() {
var cypher = $("#updatecypher").val();
if (cypher.length > 3) {
viz.updateWithCypher(cypher);
} else {
console.log("#reload");
viz.reload();
}
});
$("#stabilize").click(function() {
viz.stabilize();
})
</script>
<frameset cols="50%,50%">
<frame src="frame_a.htm" frameborder="0">
<frame src="frame_b.htm" frameborder="0">
</frameset>
</html>