-
Notifications
You must be signed in to change notification settings - Fork 0
/
visualisation.html
253 lines (211 loc) · 13.7 KB
/
visualisation.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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Stylesheets -->
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/visualisation.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<!-- Fonts -->
<link href="https://fonts.googleapis.com/css?family=Lato&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Rubik:wght@300;400&display=swap" rel="stylesheet">
<link rel='stylesheet' href='css/all.css'>
<title>MiRANA</title>
</head>
<body>
<!-- Error modal -->
<div class="modal" tabindex="-1" role="dialog" id='modal-errors'>
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">We found an error</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<p id='modal-text'>Modal body text goes here.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- Content container and bootstrap row -->
<div class="container-fluid">
<div class="row">
<!-- Sidebar -->
<div class="col-md-3" id="sidebar">
<div class="d-flex h-100 flex-column">
<!-- Logo at top of sidebar-->
<div class='h-10 text-center justify-content-center align-items-center'>
<div>
<a href="index.html" style="text-decoration: none;">
<span class="navbar-brand">
<img class="icon-brand" src="img/MiRANA_white.png">
</span>
</a>
<br>
<a style='color: white;' href='https://github.com/CMorenoStokoe/network-mr-vis-tool/blob/master/LICENSE' target='_blank'>
<i class="fas fa-balance-scale"></i> License: GNU GPL v3.0
</a>
</div>
</div>
<!-- Upload data button -->
<div class='mt-auto h-30 text-center justify-content-center align-items-center'>
<div class='my-auto p-2'>
<label for="upload-mr" class="sidebar-button-style" id='upload-label'>
<i class="fas fa-file-upload p-2" style='font-size:4em;' id='upload-label-icon'></i>
<h5 id='upload-label-txt'>Upload data</h5>
</label>
<form enctype="multipart/form-data" id="uploadForm" style="display: none"><br>
<input id="upload-mr" type="file" onchange="
// Upload file
var filename = document.getElementById('upload-mr').value;
// Verify that the file is correctly formatted and compatible
errorWithUpload(
function(errors){
if(errors){
// Display error
document.getElementById('upload-label-txt').innerHTML = `ERROR with: ${filename.substr(filename.lastIndexOf('\\') + 1)}`;
document.getElementById('upload-label-txt').style = 'font-size: 12px;';
document.getElementById('upload-label-icon').className = 'fas fa-times-circle p-2';
}else{
// Display success
document.getElementById('upload-label-txt').innerHTML = filename.substr(filename.lastIndexOf('\\') + 1);
document.getElementById('upload-label-txt').style = 'font-size: 12px;';
document.getElementById('upload-label-icon').className = 'fas fa-check-circle p-2';
}
}
)
"/><br><br>
</form>
</div>
</div>
<!-- Settings -->
<div class='mt-auto h-40 text-center justify-content-center align-items-center''>
<!-- Set Pval -->
<div class='my-auto p-2'>
<h5> Options </h5><hr>
Pval=<input type="text" id="pval_limit" value='auto' size='4' class='sidebar-form'>
</div>
<div class="dropdown p-2">
<button class="btn sidebar-button-style2 dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Style: <span class="badge badge-warning" id='preset-text'>Default</span>
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<button class="dropdown-item active" style="cursor: pointer;" id='preset-0'>Default</button>
<button class="dropdown-item" style="cursor: pointer;" id='preset-1'>Academic</button>
<button class="dropdown-item" style="cursor: pointer;" id='preset-2'>Clinical</button>
<button class="dropdown-item" style="cursor: pointer;" id='preset-3'>Industrial</button>
<button class="dropdown-item" style="cursor: pointer;" id='preset-4'>Designer 1</button>
<button class="dropdown-item" style="cursor: pointer;" id='preset-5'>Designer 2</button>
<div class="dropdown-divider"></div>
<!-- Advanced settings button -->
<button class='btn sidebar-button-style2 h-100 w-100' id='btn-settings'>
<i class="fas fa-cogs"></i>
Advanced settings
</button>
</div>
</div>
<br><br>
</div>
<div class='mt-auto h-10 text-center justify-content-center align-items-center'>
<div class='my-auto p-2'>
<!-- Generate graph button -->
<button class="btn sidebar-button-style3" id="btn-action">Generate graph</button>
<!-- User guide button -->
<br><br><a class='sidebar-link' href='https://osf.io/tr62v/wiki/home/' target="_blank" ><i class="fas fa-info-circle"></i> User guide</a>
</div>
</div>
<!-- Content at bottom of sidebar -->
<div class="mt-auto h-10 text-center justify-content-center align-items-center" id="sidebar-end">
<div>
<!--
<a href="http://www.bristol.ac.uk/integrative-epidemiology/" target="_blank"><img class="icon-footer" src="img/ieu.png"></a>
-->
<a href="https://dynamicgenetics.org/" target="_blank" ><img class="icon-footer p-1" src="img/dynamicgenetics-white.png"></a>
</div>
</div>
</div>
</div>
<!-- Graph -->
<div class="col-md-9" style='position: relative;'>
<!-- Grey film before graph is drawn -->
<div class='w-100 h-100' id='film-panel' style='position: absolute; top:0; left:0;'>
<img src='img/MiRANA_white.png' id='film-logo'>
<h5 id='film-text'>Graph making tool</h5>
</div>
<!-- On graph buttons -->
<div class="dropleft" style='position: absolute; top: 10; right: 10;'>
<div class="btn-group" role="group" aria-label="Button group">
<!-- Save buttons -->
<button id='saveButton' title="Save image" type="button" class="btn btn-secondary">
Save <i class="fas fa-file-image"></i>
</button>
<a id='save-button-json' download='MiRANA_data.json' >
<button title="Save JSON code" type="button" class="btn btn-secondary" style='border-left: 0.25pt solid #666; border-bottom-left-radius: 0; border-top-left-radius: 0; height: 100%; width: 100%'>
<i class="far fa-file-code"></i>
</button>
</a>
</div>
<!-- Cite button -->
<button type="button" title="View reference" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-quote-right"></i> Cite
</button>
<div class="dropdown-menu p-2">
Moreno-Stokoe, C.M. (2020). MiRANA: Network visualisation tool. Accessible: www.morenostok.io/mirana.
</div>
</div>
<!-- svg -->
<svg height='600' width='800' id="svg-main"></svg>
<!-- Legend -->
<div id='div-legend'></div>
<!-- Advanced settings -->
<div class='settings' id='settings-panel' style='overflow-y: auto; max-height: 90%;'>
<div class='row py-2 pl-3'>
<h5>Advanced settings (<a href='https://osf.io/tr62v/wiki/home/' target='_blank'><i class="fas fa-info-circle"></i> User guide </a>)</h5>
</div>
<div class='row' id='div-settings' style='flex: 1 0 33%; '></div>
<div class='p-1 m-2 d-flex flex-row align-items-center justify-content-center'>
<small>Items marked with * require editing the spreadsheet input file first</small>
</div>
</div>
</div>
</div>
<!-- External dependencies -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<script src="https://d3js.org/d3.v5.min.js"></script>
<script src="https://d3js.org/d3-color.v1.min.js"></script>
<script src="https://d3js.org/d3-interpolate.v1.min.js"></script>
<script src="https://d3js.org/d3-scale-chromatic.v1.min.js"></script>
<script src="scripts/PapaParse/papaparse.min.js"></script>
<script src="scripts/ExportD3Vis/export-visualisation.js"></script>
<script src='scripts/FileSaver.js/dist/FileSaver.min.js'></script>
<script src='scripts/JavaScript-Canvas-to-Blob/js/canvas-to-blob.min.js'></script>
<!-- MR web app GUI library -->
<script src="scripts/mr-webapp/edit-element.js"></script>
<script src="scripts/mr-webapp/create-element.js"></script>
<script src="scripts/mr-webapp/event-handling.js"></script>
<!-- MiRANA scripts -->
<!-- Settings -->
<script src="scripts/settings-defaults.js"></script>
<script src="scripts/settings-options.js"></script>
<!-- Data ops-->
<script src="scripts/csvToJson.js"></script>
<script src="scripts/data-cleaning.js"></script>
<script src="scripts/node-properties.js"></script>
<script src="scripts/edge-properties.js"></script>
<!-- GUI -->
<script src="scripts/settings-btn-builder.js"></script>
<script src="scripts/legend-builder.js"></script>
<!-- Graph -->
<script src="scripts/graph.js"></script>
<!-- Main -->
<script src="scripts/main.js"></script>
</body>
</html>