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

Conversion backend change to REST API #2

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
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
17 changes: 2 additions & 15 deletions installation_manual.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
* Enable cgi module on Apache (https://code-maven.com/set-up-cgi-with-apache)
* add skript sugarsketcher.cgi to /usr/lib/cgi-bin/ and make it executable (chmod +x ...)
* reload apache configuration (service apache2 reload)
* make skript GlycoCT2string.sh executable (chmod +x)
* edit /usr/lib/cgi-bin/sugarsketcher.cgi and set correct path to GlycoCT2string.sh skript (SCRIPTPATH)
* install cmake
* create some temporary folder
* create folder where to install obabel (/opt/obabel)
* install Open Babel (using included skript installObabel.sh <path_to_temporary_folder> <installation_path>)
* if you choosed another installation path, you must change every occurence in GlycoCT2string.sh skript
* install marvin:
- wget http://dl.chemaxon.com/marvin/18.25.0/marvin_linux_18.25.deb
- sudo dpkg -i marvin_linux_18.25.deb
* deploy js app (2 options)
* deploy js app (2 options):
a) edit menu.js (variable smilesinchiconvertbackendurl to correct backend url), build (gulp webpack) and copy js app files to designated location
b) copy already buil js app files to designated location and edit menu.js (variable smilesinchiconvertbackendurl to correct backend url)
b) copy already built js app files to designated location and edit menu.js (variable smilesinchiconvertbackendurl to correct backend url)
82 changes: 0 additions & 82 deletions scripts/GlycoCTToString.sh

This file was deleted.

28 changes: 0 additions & 28 deletions scripts/installObabel.sh

This file was deleted.

80 changes: 0 additions & 80 deletions scripts/sugarsketcher.cgi

This file was deleted.

20 changes: 20 additions & 0 deletions src/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,26 @@ div.tooltip {
margin-bottom:2em;
}

#loading{
left: 0;
right: 0;
width: 100%;
height: 100%;
position: fixed;
top: 0;
bottom: 0;
background-color: rgba(204, 204, 204, 0.6);
}

#loading img{
left: 0;
right: 0;
margin: auto auto;
width: 100px;
top: 40vh;
display: block;
position: fixed;
}
#hiddenMsg {
opacity:0;
}
Expand Down
12 changes: 11 additions & 1 deletion src/css/menu.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@
fill:white;
}

.labelSmall {
font-family: arial,helvetica,'sans-serif';
font-size: 16px;
text-anchor: middle;
alignment-baseline: text-before-edge;
dominant-baseline: text-before-edge;
stroke:white;
fill:white;
}

.labelMonoChoice, .helpLabel {
stroke:black;
fill:black;
Expand Down Expand Up @@ -225,4 +235,4 @@ textarea {
width: 100px;
margin-right:auto;
margin-left:auto;
}
}
2 changes: 1 addition & 1 deletion src/js/sb.js.map

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions src/js/views/app.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
function usedAsPlugin(){
return document.location.search.replace("?", "").toLowerCase().indexOf("plugin") >= 0
&& document.location.search.replace("?", "").toLowerCase().indexOf("plugin=false") == -1
&& document.location.search.replace("?", "").toLowerCase().indexOf("plugin=0") == -1;
}

var treeData = {};
var shapes = {};
var clickedNode = null;
Expand All @@ -7,7 +13,7 @@ var copiedNode = null;
var rootDonorPosition, rootAcceptorPosition;

const gap = 50; // Distance between two nodes
const origin = [200, 600];
const origin = [(usedAsPlugin())?70:200, 600];
const circleRadius = 15; // Radius of a circle shape

var ctrl; // Boolean if ctrl is held
Expand Down Expand Up @@ -170,15 +176,14 @@ function getSelectedNodeIndex(node)
return -1;
}


var zoomListener = d3.behavior.zoom().scaleExtent([0.1, 3]).on("zoom", zoom);

// Create the svgTree svg with fixed width and height
var vis = d3.select('#viz')
.append('svg')
.attr('id', 'svgTree')
.attr('width', 1000)
.attr('height', 550)
.attr('height', (usedAsPlugin())?200:550)
.call(zoomListener) // Listener for the svg
.append("svg:g").attr("transform", "translate(50, 20)");

Expand Down
9 changes: 5 additions & 4 deletions src/js/views/eventManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,13 @@ function manageHoverAddNode(menuItem,actions) {
d3.select("#svgMenu").select("#addNode").remove(); // Remove the add Node rect
d3.select("#repeatUnit").style("opacity", "0.2"); // Lower opacity of add Structure
d3.select("#updateNode").style("opacity", "0.2"); // Lower opacity of update Node
d3.select("#help").style("opacity", "0.2"); // Lower opacity of update Node

// Add Monosaccharide rect and label
actions.append("rect")
.attr("class", "bar choice")
.attr("id", menuItem.subDivisions[1].division)
.attr("width", 1000/6) // Width is 1/6 of the total menu width
.attr("width", 1000/8) // Width is 1/6 of the total menu width
.attr("height", 40) // Height is the same as the menu one
.attr("x", x) // Place this rect at the same x as the addNode title
.attr("rx", 15) // Corners for the rect
Expand All @@ -238,8 +239,8 @@ function manageHoverAddNode(menuItem,actions) {
actions.append("rect")
.attr("class", "bar choice")
.attr("id", menuItem.subDivisions[0].division)
.attr("width", 1000/6).attr("height", 40)
.attr("x", 1000/6)
.attr("width", 1000/8).attr("height", 40)
.attr("x", 1000/8)
.attr("rx", 15)
.attr("ry", 15)
.on("mouseout", function() {
Expand Down Expand Up @@ -1187,4 +1188,4 @@ function redrawProgress(prev, newValue = progress)
{
d3.select("#progressBar").transition()
.styleTween("width", function() { return d3.interpolate(prev/7*1000, newValue/7*1000); });
}
}
Loading