Revize 26feb57f
Přidáno uživatelem Pavel Fidranský před více než 6 roky(ů)
sources/src/main/webapp/css/main.css | ||
---|---|---|
6 | 6 |
overflow: hidden; |
7 | 7 |
} |
8 | 8 |
|
9 |
.hidden { |
|
10 |
display: none !important; |
|
9 |
ul { |
|
10 |
list-style: none; |
|
11 |
padding-left: 0; |
|
11 | 12 |
} |
12 | 13 |
|
13 |
.header { |
|
14 |
width: 100%; |
|
15 |
background: -webkit-linear-gradient(top, #f0f9ff 0%,#cbebff 47%,#a1dbff 100%); |
|
14 |
.hidden { |
|
15 |
display: none !important; |
|
16 | 16 |
} |
17 | 17 |
|
18 | 18 |
.row { |
19 | 19 |
display: flex; |
20 | 20 |
} |
21 | 21 |
|
22 |
.upload-content {
|
|
23 |
text-align: center;
|
|
22 |
.form-field {
|
|
23 |
margin-bottom: 20px;
|
|
24 | 24 |
} |
25 | 25 |
|
26 |
.upload-content ul { |
|
27 |
list-style: none; |
|
28 |
padding-left: 0; |
|
29 |
} |
|
26 |
/** |
|
27 |
* UPLOAD SCREEN |
|
28 |
*/ |
|
30 | 29 |
|
31 |
#logged_user_menu {
|
|
30 |
.upload-form {
|
|
32 | 31 |
width: 200px; |
33 |
padding: 20px 10px; |
|
34 |
float: left; |
|
35 |
text-align: left; |
|
36 |
height: 500px; |
|
37 |
background: #CFEAFE; |
|
38 |
box-shadow: 3px 3px 10px #888; |
|
39 |
} |
|
40 |
|
|
41 |
.upload-forms { |
|
42 |
display: inline-block; |
|
43 |
min-height: 150px; |
|
44 |
text-align: left; |
|
45 | 32 |
margin: 20px auto; |
46 | 33 |
padding: 10px; |
47 | 34 |
background-color: #CFEAFE; |
48 | 35 |
box-shadow: 3px 3px 10px #888; |
49 | 36 |
} |
50 | 37 |
|
51 |
.upload-forms input[type="submit"] {
|
|
38 |
.upload-form button[type="submit"] {
|
|
52 | 39 |
display: block; |
53 |
width: 200px; |
|
54 |
margin: 0 auto; |
|
40 |
width: 100%; |
|
55 | 41 |
} |
56 | 42 |
|
57 |
#uploadedComponent li { |
|
58 |
padding: 8px 5px; |
|
59 |
min-width: 450px; |
|
60 |
background: #f5f4f4; |
|
43 |
.diagrams-menu { |
|
44 |
width: 200px; |
|
45 |
margin: 20px auto; |
|
46 |
padding: 10px; |
|
47 |
background-color: #CFEAFE; |
|
48 |
box-shadow: 3px 3px 10px #888; |
|
61 | 49 |
} |
62 | 50 |
|
63 |
#uploadedComponent li:nth-child(odd) { |
|
64 |
background: #e0dfdf; |
|
51 |
.diagrams-menu li button { |
|
52 |
float: right; |
|
53 |
width: 20px; |
|
54 |
height: 20px; |
|
55 |
padding: 0; |
|
65 | 56 |
} |
66 | 57 |
|
67 |
#uploadedComponent #deleteAll {
|
|
68 |
margin-bottom: 20px;
|
|
58 |
.diagrams-menu li img {
|
|
59 |
max-width: 100%;
|
|
69 | 60 |
} |
70 | 61 |
|
71 |
.imgDelete { |
|
72 |
width: 16px; |
|
73 |
height: 16px; |
|
74 |
float: right; |
|
62 |
/** |
|
63 |
* HEADER |
|
64 |
*/ |
|
65 |
|
|
66 |
.header { |
|
67 |
position: relative; |
|
68 |
width: 100%; |
|
69 |
background: -webkit-linear-gradient(top, #f0f9ff 0%,#cbebff 47%,#a1dbff 100%); |
|
75 | 70 |
} |
76 | 71 |
|
77 | 72 |
.header-logo { |
... | ... | |
148 | 143 |
line-height: 30px; |
149 | 144 |
} |
150 | 145 |
|
146 |
/** |
|
147 |
* NAVBAR |
|
148 |
*/ |
|
149 |
|
|
151 | 150 |
.navbar { |
152 | 151 |
background: -webkit-linear-gradient(top, #1e5799 0%,#7db9e8 100%); |
153 | 152 |
color: #cceefc; |
... | ... | |
224 | 223 |
vertical-align: middle; |
225 | 224 |
} |
226 | 225 |
|
226 |
/** |
|
227 |
* LOADER |
|
228 |
*/ |
|
229 |
|
|
227 | 230 |
.loader { |
228 | 231 |
position: absolute; |
229 | 232 |
top: 0; |
... | ... | |
248 | 251 |
display: none; |
249 | 252 |
} |
250 | 253 |
|
254 |
/** |
|
255 |
* GRAPH |
|
256 |
*/ |
|
257 |
|
|
251 | 258 |
.graph-content { |
252 | 259 |
display: flex; |
253 | 260 |
height: calc(100vh - 60px - 43px); |
... | ... | |
341 | 348 |
pointer-events: bounding-box; |
342 | 349 |
} |
343 | 350 |
|
351 |
/** |
|
352 |
* CONTEXT MENU |
|
353 |
*/ |
|
354 |
|
|
344 | 355 |
.context-menu { |
345 | 356 |
position: absolute; |
346 | 357 |
font-family: 'Arial', sans-serif; |
... | ... | |
378 | 389 |
vertical-align: -3px; |
379 | 390 |
} |
380 | 391 |
|
381 |
.popover { |
|
392 |
/** |
|
393 |
* POPOVER |
|
394 |
*/ |
|
395 |
|
|
396 |
.popover { |
|
382 | 397 |
position: absolute; |
383 | 398 |
z-index: 1; |
384 | 399 |
font-family: 'Arial', sans-serif; |
... | ... | |
401 | 416 |
padding: 0 0.5em 0.5em 0.5em; |
402 | 417 |
} |
403 | 418 |
|
404 |
.viewport .neighbour-node-symbol { |
|
419 |
/** |
|
420 |
* VIEWPORT |
|
421 |
*/ |
|
422 |
|
|
423 |
.viewport .neighbour-node-symbol { |
|
405 | 424 |
stroke: #000; |
406 | 425 |
stroke-width: 1; |
407 | 426 |
} |
... | ... | |
414 | 433 |
user-select: none; |
415 | 434 |
} |
416 | 435 |
|
436 |
.viewport .group .group-viewport { |
|
437 |
stroke: #000; |
|
438 |
stroke-width: 0; |
|
439 |
} |
|
440 |
|
|
417 | 441 |
.viewport .group .group-symbol { |
418 | 442 |
font-size: 48px; |
419 | 443 |
} |
... | ... | |
450 | 474 |
display: none; |
451 | 475 |
} |
452 | 476 |
|
477 |
.viewport .group:not(.group--expanded) .group-viewport { |
|
478 |
display: none; |
|
479 |
} |
|
480 |
|
|
453 | 481 |
.viewport .group--expanded .expand-button { |
454 | 482 |
display: none; |
455 | 483 |
} |
... | ... | |
462 | 490 |
width: 220px; |
463 | 491 |
} |
464 | 492 |
|
493 |
/** |
|
494 |
* SIDEBAR |
|
495 |
*/ |
|
496 |
|
|
465 | 497 |
.sidebar { |
466 | 498 |
display: flex; |
467 | 499 |
flex-basis: 350px; |
... | ... | |
706 | 738 |
display: none; |
707 | 739 |
} |
708 | 740 |
|
741 |
/* sorting */ |
|
742 |
|
|
709 | 743 |
.sort-list { |
710 | 744 |
font-size: 0.8em; |
711 | 745 |
list-style: none; |
... | ... | |
733 | 767 |
content: "▼"; |
734 | 768 |
} |
735 | 769 |
|
770 |
/* minimap */ |
|
771 |
|
|
736 | 772 |
.minimap { |
737 | 773 |
border-top: 1px solid #7db9e8; |
738 | 774 |
background-color: #fff; |
... | ... | |
750 | 786 |
stroke: #000; |
751 | 787 |
} |
752 | 788 |
|
789 |
/* status bar */ |
|
790 |
|
|
753 | 791 |
.status-bar { |
754 | 792 |
font-size: 11px; |
755 | 793 |
z-index: 1; |
... | ... | |
768 | 806 |
cursor: pointer; |
769 | 807 |
} |
770 | 808 |
|
771 |
/** |
|
772 |
* MODAL WINDOW |
|
773 |
**/ |
|
774 |
|
|
775 |
.modal { |
|
776 |
position: absolute; |
|
777 |
top: 0; |
|
778 |
bottom: 0; |
|
779 |
left: 0; |
|
780 |
right: 0; |
|
781 |
padding: 20px 40px; |
|
782 |
background: rgba(255, 255, 255, 0.7); |
|
783 |
} |
|
784 |
|
|
785 |
.modal-content { |
|
786 |
position: relative; |
|
787 |
height: 100%; |
|
788 |
background-color: #fff; |
|
789 |
border: 1px solid #7db9e8; |
|
790 |
} |
|
791 |
|
|
792 |
.modal-content .close-button { |
|
793 |
position: absolute; |
|
794 |
top: 10px; |
|
795 |
right: 10px; |
|
796 |
display: block; |
|
797 |
width: 20px; |
|
798 |
height: 20px; |
|
799 |
padding: 0; |
|
800 |
} |
|
801 |
|
|
802 | 809 |
/** |
803 | 810 |
* TOOLTIP |
804 | 811 |
**/ |
sources/src/main/webapp/js/app.js | ||
---|---|---|
268 | 268 |
document.getElementById('applyLayoutImg').setAttribute('src', 'images/layout_on.png'); |
269 | 269 |
|
270 | 270 |
layouting = true; |
271 |
layoutingInterval = window.setInterval(app.viewportComponent.forceDirected.run, 10);
|
|
271 |
layoutingInterval = window.setInterval(self.viewportComponent.forceDirected.run, 10);
|
|
272 | 272 |
} |
273 | 273 |
}); |
274 | 274 |
|
sources/src/main/webapp/js/components/attribute.js | ||
---|---|---|
1 | 1 |
/** |
2 |
* TODO: jsDoc
|
|
2 |
* Class representing an attribute of vertex/edge. Output is formatted based on attribute name and datatype of its value.
|
|
3 | 3 |
* @constructor |
4 | 4 |
* @param {array} props Details of the attribute. |
5 | 5 |
*/ |
sources/src/main/webapp/js/components/group.js | ||
---|---|---|
163 | 163 |
* @returns {array<Edge>} List of all edges related to vertices added to the group. |
164 | 164 |
*/ |
165 | 165 |
this.getEdgeList = function() { |
166 |
// TODO: some edges get duplicated in the resulting array this way |
|
167 |
|
|
166 | 168 |
return [].concat(this.getInEdgeList(), this.getOutEdgeList()); |
167 | 169 |
}; |
168 | 170 |
|
sources/src/main/webapp/js/components/minimap.js | ||
---|---|---|
1 | 1 |
/** |
2 |
* Class representing minimap of the viewport displayed in sidebar. It is used to have a quick overview of the current viewport layout. |
|
2 | 3 |
* @constructor |
3 | 4 |
*/ |
4 | 5 |
function Minimap() { |
5 | 6 |
var rootElement; |
6 | 7 |
var viewportElement; |
7 | 8 |
|
8 |
var zoom = 0.1;
|
|
9 |
var scale = 0.1;
|
|
9 | 10 |
var useElement = '#graph'; |
10 | 11 |
|
11 | 12 |
/** |
12 |
* |
|
13 |
* Resizes the minimap viewport using current viewport size and minimap scale.
|
|
13 | 14 |
* @param {object} size Object holding current dimensions of the viewport component. |
14 | 15 |
*/ |
15 | 16 |
this.setViewportSize = function(size) { |
16 |
viewportElement.setAttribute('width', size.width * zoom);
|
|
17 |
viewportElement.setAttribute('height', size.height * zoom);
|
|
17 |
viewportElement.setAttribute('width', size.width * scale);
|
|
18 |
viewportElement.setAttribute('height', size.height * scale);
|
|
18 | 19 |
}; |
19 | 20 |
|
20 | 21 |
/** |
... | ... | |
28 | 29 |
}; |
29 | 30 |
|
30 | 31 |
/** |
31 |
* TODO: jsDoc
|
|
32 |
* Moves the minimap viewport to a new position based on current viewport position and minimap scale.
|
|
32 | 33 |
* @param {Coordinates} coords Coordinates of the viewport. |
33 | 34 |
*/ |
34 | 35 |
this.setViewportPosition = function(coords) { |
35 |
viewportElement.setAttribute('x', coords.x * -1 * zoom);
|
|
36 |
viewportElement.setAttribute('y', coords.y * -1 * zoom);
|
|
36 |
viewportElement.setAttribute('x', coords.x * -1 * scale);
|
|
37 |
viewportElement.setAttribute('y', coords.y * -1 * scale);
|
|
37 | 38 |
}; |
38 | 39 |
|
39 | 40 |
/** |
... | ... | |
48 | 49 |
}); |
49 | 50 |
|
50 | 51 |
var graphElement = app.dom.createSvgElement('use', { |
51 |
'transform': `scale(${zoom})`,
|
|
52 |
'transform': `scale(${scale})`,
|
|
52 | 53 |
}); |
53 | 54 |
graphElement.setAttributeNS('http://www.w3.org/1999/xlink', 'href', useElement); |
54 | 55 |
rootElement.appendChild(graphElement); |
... | ... | |
78 | 79 |
viewportElement.setAttribute('x', minimapViewportPosition.x - offset.x); |
79 | 80 |
viewportElement.setAttribute('y', minimapViewportPosition.y - offset.y); |
80 | 81 |
|
81 |
app.viewportComponent.setPosition(new Coordinates(viewportPosition.x + (1 / zoom) * offset.x, viewportPosition.y + (1 / zoom) * offset.y));
|
|
82 |
app.viewportComponent.setPosition(new Coordinates(viewportPosition.x + (1 / scale) * offset.x, viewportPosition.y + (1 / scale) * offset.y));
|
|
82 | 83 |
} |
83 | 84 |
|
84 | 85 |
function mouseUp(e) { |
sources/src/main/webapp/js/utils/utils.js | ||
---|---|---|
53 | 53 |
|
54 | 54 |
/** |
55 | 55 |
* Returns a new promise that is resolved at the moment when all promises passed as function parameter are resolved. |
56 |
* https://stackoverflow.com/a/35825493
|
|
56 |
* {@link https://stackoverflow.com/a/35825493}
|
|
57 | 57 |
* |
58 | 58 |
* @param promises Array of promises to wait for. |
59 | 59 |
* @return New promise. |
sources/src/main/webapp/uploadFiles.jsp | ||
---|---|---|
27 | 27 |
<%@ include file="userMenu.jsp" %> |
28 | 28 |
</header> |
29 | 29 |
|
30 |
<main class="upload-content"> |
|
31 |
<div class="upload-forms"> |
|
30 |
<main> |
|
31 |
<div class="upload-form"> |
|
32 |
<h3>New diagram</h3> |
|
33 |
|
|
32 | 34 |
<c:if test="${not empty errorMessage}"> |
33 | 35 |
<p class="alert">${errorMessage}</p> |
34 | 36 |
</c:if> |
35 | 37 |
|
36 |
<strong>Upload SPADe data:</strong> |
|
37 |
|
|
38 | 38 |
<form method="post" enctype="multipart/form-data"> |
39 | 39 |
<div class="form-field"> |
40 |
<input type="file" name="file"> |
|
40 |
<label for="file">Select SPADe data file:</label><br> |
|
41 |
<input type="file" name="file" id="file"> |
|
41 | 42 |
</div> |
42 | 43 |
|
43 |
<input type="submit" value="Start visualization">
|
|
44 |
<button type="submit">Start visualization</button>
|
|
44 | 45 |
</form> |
45 | 46 |
</div> |
46 | 47 |
|
Také k dispozici: Unified diff
minor frontend changes