-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·366 lines (336 loc) · 15.1 KB
/
index.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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>The Observatory</title>
<link href='http://fonts.googleapis.com/css?family=Crete+Round' rel='stylesheet' type='text/css'>
<script src="js/lib/d3.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/lib/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/lib/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/lib/bootstrap-switch.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/lib/typeahead.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/lib/hogan-2.0.0.min.js" type="text/javascript" charset="utf-8"></script>
<script type='text/javascript' src='json/nodes_links.js'></script>
<script type='text/javascript' src='js/ALL.js'></script>
<script type='text/javascript' src='js/Net.js'></script>
<script type='text/javascript' src='js/Force.js'></script>
<!-- <script type='text/javascript' src='js/Compartments.js'></script> -->
<script type='text/javascript' src='js/sunburst.js'></script>
<script type='text/javascript' src='js/helpers.js'></script>
<script type="text/javascript" src="js/lib/jquery.avgrund.min.js"></script>
<script type="text/javascript" src="js/lib/spin.min.js"></script>
<script type="text/javascript" src="js/lib/ladda.min.js"></script>
<link rel="stylesheet" href="css/lib/avgrund.css">
<link rel="stylesheet" href="css/lib/ladda.min.css">
<link rel="stylesheet" href="css/lib/bootstrap.min.css" type="text/css" media="screen" charset="utf-8">
<link rel="stylesheet" href="css/lib/bootstrap-switch.css" type="text/css" media="screen" charset="utf-8">
<link rel="stylesheet" href="css/themes/stellar/theme.css" type="text/css" media="screen" charset="utf-8" id="css_theme">
<link rel="stylesheet" href="css/hr.css" type="text/css" media="screen" charset="utf-8">
<link rel="stylesheet" href="css/observatory.css" type="text/css" media="screen" charset="utf-8">
<link rel="stylesheet" href="css/radial.css" type="text/css" media="screen" charset="utf-8">
<link rel="stylesheet" href="css/static_footer.css" type="text/css" media="screen" charset="utf-8">
<link rel="stylesheet" href="css/typeahead.css" type="text/css" media="screen" charset="utf-8">
<script type="text/javascript">
var Settings = function(){
return {
drawOrigo: false,
rotateLabels: true,
drawAngles: false,
svg2pngserver: 'http://localhost:3000/' /* trailing slash !important; */
}
}();
$(function() {
// catch window resize and reinstantiate svg container and force network
$(window).resize(function() {
var w = $(window).width(),
h = $(window).height()-42*2;
d3.select("#observatory").attr("width", w).attr("height", h);
Force.force().size([w, h]);
update();
});
// Slider for tweaking the force layout 'pull'
d3.select("#linkConstant")
.on("change",function() {
d3.select("#linkLabel").text("Repel: "+(Force.linkConstantUpdate(this.value)));
update();
});
$('#rotateLabels').bootstrapSwitch('setAnimated', true);
$('#rotateLabels').popover({animation:false, placement: "top", trigger: "hover", title: "", content: "Each label's angle is calculated from the positions of neighbouring nodes, hoping to reduce clutter."});
$('#rotateLabels').on('switch-change', function (e, data) {
Settings.rotateLabels = data.value
update(true);
setCookie("selectedRotation", data.value, 365);
});
$('#themeswitcher').on('change', function (e, data) {
var base_path = "css/themes/"
document.getElementById('css_theme').href=base_path+this.value+'/theme.css';
setCookie("selectedCSS", this.value, 365);
});
$('#jumpref').click(function(){
$('html, body').animate({
scrollTop: $( $.attr(this, 'href') ).offset().top
}, 500);
return false;
});
$('#reset').click(function(){
Net.importN([]);
$('#buttonbar').hide();
});
});
$(document).ready(function() {
$('#q').focus();
$('#themeswitcher')[0].value = getCookie("selectedCSS") ? getCookie("selectedCSS") : "stellar";
var base_path = "css/themes/"
document.getElementById('css_theme').href=base_path+$('#themeswitcher')[0].value+'/theme.css';
var rot = getCookie("selectedRotation");
if (rot == "true") {
$('#rotateLabels').bootstrapSwitch('setState', true);
}
});
function setCookie(c_name, value, exdays) {
var exdate = new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value = escape(value) + ((exdays == null) ? "" : "; expires=" + exdate.toUTCString());
document.cookie = c_name + "=" + c_value;
}
function getCookie(c_name) {
var i, x, y, ARRcookies = document.cookie.split(";");
for (i = 0; i < ARRcookies.length; i++) {
x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("="));
y = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1);
x = x.replace(/^\s+|\s+$/g, "");
if (x == c_name) {
return unescape(y);
}
}
}
function derive(node_id) {
Net.derive(node_id);
console.log("2got here");
$('#myModal').modal();
}
// Save-as-image feature:
$('#filemodal').avgrund();
$(function() {
$('#filemodal').avgrund({
height: 200,
showClose: true,
showCloseText: 'close',
onBlurContainer: '.w',
onLoad: function() {
$.ajax({
type:'POST',
data: $('#background').html(),
success: function(data) {
$('#imagelink').html("<a target=\"_blank\" style=\"color:#fff\" href=\"http://localhost/visarch/svg2png/"+data+"\"><img class=\"ladda-imagelink\" height=\"61px\" src=\"http://localhost/visarch/svg2png/"+data+"\"></a>");
l.stop();
},
error: function () {
$('#image_instruction').html("<h1>Never mind</h1><strong>Seems there's no image server at the back-end.</strong><p>In the meantime, save the green bookmarklet (your design) and send an e-mail to [email protected]. (And yes, you can close this window.)</p>")
},
url: Settings.svg2pngserver+'?t='+$('#themeswitcher').val(),
cache: false
});
setTimeout('var l = Ladda.create(document.querySelector(\'#laddare\'));l.start();', 400);
},
template: '<div class="text-center"><h4>Save as image...</h4>'+
'<small id="image_instruction">Drag this to your desktop:</small><p id="imagelink" class="ladda-padding"><button id="laddare" class="ladda-button" data-size="l" data-style="expand-right"><span class="ladda-label">Creating image...</span></button></p></div>'
});
});
</script>
</head>
<body>
<!-- default invisible objects (modals...) -->
<!--
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">Add a Node</h4>
</div>
<div class="modal-body">Please enter the name of the new node.</div>
<input style="text-align:left;width:300px;" class=" btn btn-default btn-lg" type="text" id="q" autocomplete="off" placeholder="Name...">
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Add</button>
</div>
</div>
-->
<!-- /default -->
<nav class="navbar navbar-inverse" role="navigation">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" style="font-weight: normal; font-size:2em; padding-top:13px; margin-left:15px !important" href="#">The Observatory</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<!-- <li class="active"><a href="#">Link</a></li>
<li><a href="#">Link</a></li> -->
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Options <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="docs/index.html" target="_blank">Documentation</a></li>
<li><a id="filemodal" href="#">Save as image...</a></li>
<li class="divider"></li>
<li><a href="#"><input type="checkbox" id="toggleFixedGlobal" onClick="Net.toggleFixedGlobal()"/> <label for="toggleFixedGlobal">Freeze</label></a></li>
<li><a href="#"><label for="linkConstant" id="linkLabel">Repel: 25</label><br/><input type="range" min="0" max="30" value="25" id="linkConstant" step="0.01"/></a></li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<form class="navbar-form navbar-left" role="search">
<div class="form-group">
<input id="q" autocomplete="off" spellcheck="false" dir="auto" type="text" class="form-control" placeholder="Search...">
<script>
$('#q').on('typeahead:selected', onAdd);
/* autoselect first match on enter */
$('#q').keypress(function (e) {
if (e.which == 13) {
try {
var node = $('#q').data().ttView.dropdownView.getFirstSuggestion().datum;
} catch (e) {
// no such node, create a new one:
// var node = {"name":$('#q').val(), "id":$('#q').val(), description:"user added", "group":"ExternalSystems", size:"20"}
}
if(node) {
onAdd(null, node);
}
$(this).typeahead('setQuery', '');
}
});
function onAdd (e, datum) {
if(datum.description == "group") { // add entire group
var ns = ALL.nsByGroup(datum.id);
ns.forEach(function (n, i) {
/*if (n.size>0)*/ Net.add(ALL.n(n.id));
});
} else if (datum.description=="user added") { // add custom system
Net.add(datum);
}
else Net.add(ALL.n(datum.id)); // add RSA system
update();
$(this).typeahead('setQuery', '');
}
</script>
</div>
</form>
</li>
</ul>
</div><!-- /.navbar-collapse -->
</nav>
<div id="wrap" oncontextmenu="return false;">
<div id="main" class="clear-top" style=" border-bottom:1px gray">
<div class="row">
<div class="col-sm-12" id="background">
</div>
</div>
<div class="row">
<div class="col-xs-4"></div>
<div class="col-xs-4 text-center jump">
<a id="jumpref" href="#jump">
<i class="glyphicon glyphicon-chevron-down"></i>
<strong>scroll down for more info</strong>
<i class="glyphicon glyphicon-chevron-down"></i>
</a>
</div>
<div class="col-xs-4">
<span id="buttonbar" class="pull-right">
<a href="#" class="btn-sm btn-danger" id="reset">reset</a><a href="#" id="bookmarklet"></a>
</span>
</div>
</div>
</div>
</div>
<hr> <!-- styled in hr.css -->
<div class="container-fluid content">
<div class="row-fluid">
<span class="col-sm-12">
<div class="page-header">
<h1 id="jump">
The Observatory <small> — A Solution Architecture Overview <sup><small><a target="_blank" href="docs/index.html">[docs]</a></sup></small></small>
</h1>
</div>
</span>
<div class="col-sm-12 lead">The Observatory lets you visualize arbitrary SEB systems, along with their integrations, in a <a href="http://en.wikipedia.org/wiki/Force-directed_graph_drawing">force-directed network</a>. The Observatory gets its data directly from the "<abbr title="Defining a Solution Architecture Overview is an initiative within Application Infrastructure">SAO</abbr> <abbr title="IBM RSA is a UML tool for describing enterprise architecture">RSA</abbr>" model, maintained by SEB's <abbr title="Solution Area Architect, a role within Application Infrastructure">SAA's.</abbr></div>
</div>
<div class="row-fluid">
<div class="col-sm-4">
<h2>
Searching
</h2>
<p>
Enter the name of any system(s) into the seach field and press <span class="label label-primary">RETURN</span> on your keyboard. Each system you add will be represented by a star, along with integrations to other (visualized) systems.
</p>
<p>
You can add entire compartments by passing its name within square brackets, e.g. <span class="label label-info">[Processing Support]</span>. </p>
</div>
<div class="col-sm-4">
<h2>
Navigating
</h2>
<p>Nodes are layed out using a force-directed system. You can tweak the layout by dragging nodes into place.</p><p><span class="label label-warning">Right-clicking</span> any system brings up a context menu, allowing you to delete, add or explode ("supernova") that system, effectively bringing all its integrations into view.
</div>
<div class="col-sm-4">
<h2>
Saving
</h2>
<p>
Currently, the Observatory supports saving <em>links</em> to layouts (i.e. not images). The <span class="label label-success">save</span> link beside the search bar is a <em>bookmarklet</em> which represents the current state of your layout. Drag this button into the bookmarks bar of your browser to save the state.</p><p> The <span class="label label-danger">< back</span> link represents the previous state, and effectively serves as an <em>undo</em> button.</p>
</p>
</div>
</div>
<div style="height:20px"></div>
<div class="row-fluid">
<div class="col-sm-12">
<div class="col-sm-4 bs-callout bs-callout-info">
<div class="col-sm-6">
<div>
<label>Rotate labels</label>
</div>
<div id="rotateLabels" class="make-switch switch-mini">
<input type="checkbox" checked>
</div> <i class="glyphicon glyphicon-question-sign"></i>
</div>
<div class="col-sm-6">
<label>Theme</label>
<div>
<select class="input-small" id="themeswitcher">
<option value="stellar">Stellar</option>
<option value="cartographer">Cartographer</option>
<option value="meadow">Meadow</option>
<option value="paper">Paper</option>
<option value="whiteboard">Whiteboard</option>
<option value="laplander">Laplander</option>
</select>
</div>
</div>
</div>
<div class="col-sm-4"></div>
<blockquote class="pull-right">
<p>
Idea, design & implementation
</p> <small><a href="mailto:[email protected]">Christian Lagerkvist</a>, SAA Processing Support</small>
</blockquote>
</div>
</div>
</div>
<script>
function JsonReady() {
// for displaying default nodes on page load:
// var c = Compartments.all[4];
// c.id = c.compartment;
// onAdd(null, c);
// var c = ALL.nByName("CGI (Logica)");
// Net.add(c[0]);
}
</script>
<script type='text/javascript' src='js/draw.js'></script>
</body>
</html>