Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

B#262 #1

Merged
merged 7 commits into from
May 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,6 @@ WSGIScriptAlias / /path_to_GraphSpace/graphspace/wsgi.py

Refer to https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/modwsgi/ if any problems occur with the setup.

Testing the GraphSpace REST API
=================================

1. Follow the instructions above to run GraphSpace locally or on Apache2.
2. Navigate to the tests directory in GraphSpace: `cd tests`
2. Enter python command to run test cases: `python restapi_test.py`

This script will test all the REST API commands supported by the GraphSpace server. If something fails, it will display the error.

Contributing
=================
Expand Down
26 changes: 18 additions & 8 deletions static/js/graphs_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,21 +430,36 @@ var graphPage = {

utils.initializeTabs();

$('#saveOnExitLayoutBtn').click(function () {
graphPage.cyGraph.contextMenus('get').destroy(); // Destroys the cytocscape context menu extension instance.

cytoscapeGraph.showGraphInformation(graphPage.cyGraph);
// display node data as a popup
graphPage.cyGraph.unbind('tap').on('tap', graphPage.onTapGraphElement);

graphPage.saveLayout($('#saveOnExitLayoutNameInput').val(), '#saveOnExitLayoutModal');
});

$('#saveLayoutBtn').click(function () {
graphPage.cyGraph.contextMenus('get').destroy(); // Destroys the cytocscape context menu extension instance.

cytoscapeGraph.showGraphInformation(graphPage.cyGraph);
// display node data as a popup
graphPage.cyGraph.unbind('tap').on('tap', graphPage.onTapGraphElement);

graphPage.saveLayout($('#layoutNameInput').val());
graphPage.saveLayout($('#saveLayoutNameInput').val(), '#saveLayoutModal');
});

$('#layoutEditorBtn').click(function () {
graphPage.layoutEditor.init();
});

$('#exitLayoutEditorBtn').click(function () {
$('#exitLayoutBtn').removeClass('hidden');
$('#saveOnExitLayoutModal').modal('show');
});

$('#saveLayoutEditorBtn').click(function () {
$('#exitLayoutBtn').removeClass('hidden');
$('#saveLayoutModal').modal('show');
});
Expand All @@ -457,11 +472,6 @@ var graphPage = {
graphPage.cyGraph.unbind('tap').on('tap', graphPage.onTapGraphElement);
});

$('#saveLayoutModalBtn').click(function () {
$('#exitLayoutBtn').addClass('hidden');
$('#saveLayoutModal').modal('show');
});

$('#ConfirmRemoveLayoutBtn').click(graphPage.layoutsTable.onConfirmRemoveGraph);
$('#ConfirmUpdateLayoutBtn').click(graphPage.layoutsTable.onConfirmUpdateGraph);

Expand Down Expand Up @@ -584,7 +594,7 @@ var graphPage = {
graphPage.cyGraph.layout(layout);

},
saveLayout: function (layoutName) {
saveLayout: function (layoutName, modalNameId) {
graphPage.cyGraph.elements().unselect();

if (_.trim(layoutName).length === 0) {
Expand Down Expand Up @@ -636,7 +646,7 @@ var graphPage = {
}
},
successCallback = function (response) {
$('#saveLayoutModal').modal('toggle');
$(modalNameId).modal('toggle');
$('#PrivateLayoutsTable').bootstrapTable('refresh');
$('#SharedLayoutsTable').bootstrapTable('refresh');
},
Expand Down
41 changes: 35 additions & 6 deletions templates/graph/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ <h4 class="modal-title" id="myModalLabel">Share Graph</h4>
</div>
</div>
</div>

<!-- Save Layout Modal -->
<div class="modal fade" id="saveLayoutModal" tabindex="-1" role="dialog" aria-labelledby="saveLayoutModalLabel"
<!-- Save on Exit Layout Modal -->
<div class="modal fade" id="saveOnExitLayoutModal" tabindex="-1" role="dialog" aria-labelledby="saveOnExitLayoutModalLabel"
aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
Expand All @@ -89,14 +89,13 @@ <h4 class="modal-title" id="myModalLabel">Save Layout</h4>
<div class="layout_fields">
<div class="control-group">
<label for="layoutNameInput">Layout Name</label>
<input id="layoutNameInput" class="form-control" type="text" name="layout_name"
<input id="saveOnExitLayoutNameInput" class="form-control" type="text" name="layout_name"
autocomplete="off"/>
</div>
<br>
<div class="form-group">
<button name="saveLayoutBtn" id="saveLayoutBtn"
<button name="saveOnExitLayoutBtn" id="saveOnExitLayoutBtn"
class="btn btn-success sidebar-nav-pills" data-target="#defaultSideBar">Save
Layout
</button>
<button type="button" id="exitLayoutBtn"
class="btn btn-success hidden sidebar-nav-pills" data-target="#defaultSideBar"
Expand All @@ -111,6 +110,36 @@ <h4 class="modal-title" id="myModalLabel">Save Layout</h4>
</div>
</div>

<!-- Save Layout Modal -->
<div class="modal fade" id="saveLayoutModal" tabindex="-1" role="dialog" aria-labelledby="saveLayoutModalLabel"
aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="myModalLabel">Save Layout</h4>
</div>
<div class="modal-body">

<div class="layout_fields">
<div class="control-group">
<label for="layoutNameInput">Layout Name</label>
<input id="saveLayoutNameInput" class="form-control" type="text" name="layout_name"
autocomplete="off"/>
</div>
<br>
<div class="form-group">
<button name="saveLayoutBtn" id="saveLayoutBtn"
class="btn btn-success sidebar-nav-pills" data-target="#layoutEditorSideBar">Save
</button>
<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
</div>
</div>

</div>
</div>
</div>
</div>

</div>
<!--- Modals end here--->
<div class="container-fluid zero-margin zero-padding">
Expand Down
6 changes: 6 additions & 0 deletions templates/graph/layout_editor_sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
<a id="exitLayoutEditorBtn" class="btn btn-xs d-inline-block" href="#">
<i class="fa fa-chevron-left"></i> Exit Layout Editor
</a>
<a id="saveLayoutEditorBtn" class="btn btn-xs d-inline-block" href="#">
Save
</a>
</li>

<li>
<a id="startTourBtn" class="btn btn-xs d-inline-block" href="#">
Start Tour
</a>
Expand Down
4 changes: 2 additions & 2 deletions templates/upload_graph/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ <h1 class="text-center">Upload Graph</h1>
<div class="input-group col-xs-12">
<input type="text" class="browse form-control"
placeholder="Required">
<span class="input-group-btn">
<span class="browse input-group-btn">
<button class="browse btn btn-default" type="button">
<i class="glyphicon glyphicon-search"></i> Browse
</button>
Expand All @@ -75,7 +75,7 @@ <h1 class="text-center">Upload Graph</h1>
<div class="input-group col-xs-12">
<input type="text" class="browse form-control"
placeholder="Optional">
<span class="input-group-btn">
<span class="browse input-group-btn">
<button class="browse btn btn-default" type="button">
<i class="glyphicon glyphicon-search"></i> Browse
</button>
Expand Down