-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeteor-graph.html
228 lines (193 loc) · 6.38 KB
/
meteor-graph.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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
<body>
{{> nav}}
<div class="container">
<div class="row">
<div class="col-xs-6">
<div id="create_node_container">
<h1>create a node</h1>
{{> create_node}}
</div>
<div id="edit_node_container">
<h1>edit a node</h1>
{{> edit_node}}
</div>
</div>
<div class="col-xs-6">
<div id="create_edge_container">
<h1>create a relationship</h1>
{{> create_edge}}
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12 graph-container">
<div id="cy"></div>
<div class="graph-layouts">
<a href="#" class="graph-mode" title="cose">cose</a>
<a href="#" class="graph-mode" title="circle">circle</a>
<a href="#" class="graph-mode" title="concentric">concentric</a>
<a href="#" class="graph-mode" title="grid">grid</a>
<a href="#" class="graph-mode" title="breadthfirst">breadthfirst</a>
<a href="#" class="graph-mode" title="arbor">arbor</a>
<a href="#" class="graph-mode" title="random">random</a>
</div>
<a id="fullscreen" href="">⊕</a>
<a id="exit-fullscreen" href="">⊗</a>
</div>
</div>
<div class="row">
<div class="col-sm-6 col-sm-push-3">
<div class="details-panel panel panel-default">
<div class="panel-body">
<div id="details" class="text-center"></div>
</div>
</div>
</div>
</div>
<div class="row" style="margin-top:50px;">
<div class="col-xs-12">
<p class="text-center"><a id="toggle-data-tables" href="#">toggle graph details <span class="caret"></span></a></p>
</div>
</div>
<div id="data-tables">
<div class="row">
<div class="col-xs-6">
{{> nodes}}
</div>
<div class="col-xs-6">
{{> edges}}
</div>
</div>
<div class="row">
<div class="col-xs-6">
{{> graphs}}
</div>
</div>
</div>
<blockquote class="text-center" style="margin:100px 0px;">
<p class="lead">a collaborative medium to create and display<br>arbitrary data structures, and their relationships</p>
</blockquote>
</div>
</body>
<template name="graphs">
<h1>create a graph</h1>
<div class="well">
<input id="new_graph_name" placeholder="graph name" type="text">
<a href="#" id="create_graph" class="btn btn-primary">create</a>
</div>
<table class="table table-striped">
<thead>
<tr><th>name</th><th>id</th></tr>
</thead>
<tbody>
{{#each graphs}}
{{> graph}}
{{/each}}
</tbody>
</table>
</template>
<template name="graph">
<tr id="{{_id}}">
<td class="name" contenteditable>{{name}}</td>
<td class="">{{_id}}</td>
<td><a href="#" class="show">show</a></td>
<td><a href="#" class="update">update</a></td>
<td><a href="#" class="delete">delete</a></td>
</tr>
</template>
<template name="edges">
<h1>relationships</h1>
<table class="table table-striped">
<thead>
<tr><th>node 1</th><th>relation</th><th>node 2</th></tr>
</thead>
<tbody>
{{#each edges}}
{{> edge}}
{{/each}}
</tbody>
</table>
</template>
<template name="create_edge">
<div class="well">
<input id="create_edge_n1_id" class="form-control" placeholder="node 1 ID" type="text" value="">
<input id="create_edge_name" class="form-control" type="text" value="" placeholder="relation"/>
<input id="create_edge_n2_id" class="form-control" placeholder="node 2 ID" type="text" value="">
<input type="submit" value="create edge" class="btn btn-primary"/>
</div>
</template>
<template name="edge">
<tr id="{{_id}}">
<td class="n1">{{node_name n1}}</td>
<td class="name" contenteditable>{{name}}</td>
<td class="n2">{{node_name n2}}</td>
<td><a href="#" class="update">update</a></td>
<td><a href="#" class="delete">delete</a></td>
</tr>
</template>
<template name="nodes">
<h1>nodes</h1>
<table class="table table-striped">
<thead>
<tr><th>name</th><th class="hidden-sm">id</th></tr>
</thead>
<tbody>
{{#each nodes}}
{{> node}}
{{/each}}
</tbody>
</table>
</template>
<template name="create_node">
<div class="well">
<input id="new_node_name" class="form-control" type="text" value="" placeholder="node name"/>
<div class="kv_pairs_container"></div>
<a href="#" id="create_node_add_kv_pair" class="label label-info">add key:value</a>
<div id="kv_pair_template" class="kv_pair">
<input class="create_node_add_key" type="text" placeholder="key">
<input class="create_node_add_value" type="text" placeholder="value">
</div>
<input type="submit" value="create node" class="btn btn-primary"/>
</div>
</template>
<template name="edit_node">
<div class="well">
<input id="edit_node_name" class="form-control" type="text" value="" placeholder="node name"/>
<div class="edit_kv_pairs_container"></div>
<a href="#" id="edit_node_add_kv_pair" class="label label-info">add key:value</a>
<input type="submit" id="update_node" value="update node" class="btn btn-primary"/>
</div>
</template>
<template name="node">
<tr id="{{_id}}">
<td class="name" contenteditable>{{name}}</td>
<td class="hidden-sm">{{_id}}</td>
<td><a href="#" class="edit">edit</a></td>
<!-- <td><a href="#" class="update">update</a></td> -->
<td><a href="#" class="full">show</a></td>
<td><a href="#" class="delete">delete</a></td>
</tr>
</template>
<template name="nav">
<nav class="navbar navbar-default" role="navigation">
<div class="container">
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
Select <span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
{{#each graphs}}
<li>
<a href="#" class="show">{{name}}</a>
</li>
{{/each}}
</ul>
</div>
<span class="current_graph_name">{{ current_graph.name }}</span>
</div>
</nav>
</template>
<!-- <div class="create_graph_container">
<input id="new_graph_name" class="form-control" placeholder="graph name" type="text">
<a href="#" class="btn btn-default" id="create_graph">create</a>
</div> -->