Skip to content

Commit

Permalink
Merge pull request #188 from iVis-at-Bilkent/unstable
Browse files Browse the repository at this point in the history
Sync master with unstable
  • Loading branch information
kinimesi authored Nov 7, 2017
2 parents df02ca1 + 8f30fa0 commit bb1d3de
Show file tree
Hide file tree
Showing 6 changed files with 466 additions and 365 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
/HTML5Application/nbproject/private/

node_modules/

src/.DS_Store
src/utilities/.DS_Store
10 changes: 5 additions & 5 deletions src/sbgn-extensions/sbgn-cy-instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ var generateShapeWithPortString = function(lineHW, shapeHW, type, orientation) {
abovePoints = '-' + shapeHW + ' -' + shapeHW + ' ' + shapeHW + ' -' + shapeHW + ' ';
belowPoints = shapeHW + ' ' + shapeHW + ' -' + shapeHW + ' ' + shapeHW + ' ';
}
polygonStr = "-1 -" + lineHW + " -" + shapeHW + " -" + lineHW + " ";

polygonStr = "-1 -" + lineHW + " -" + shapeHW + " -" + lineHW + " ";
polygonStr += abovePoints;
polygonStr += shapeHW + " -" + lineHW + " 1 -" + lineHW + " 1 " + lineHW + " " + shapeHW + " " + lineHW + " ";
polygonStr += belowPoints;
Expand Down Expand Up @@ -220,14 +220,14 @@ module.exports = function () {
var location = statesandinfos.anchorSide; // top bottom right left
var layouts = node.data('auxunitlayouts');
if(!layouts[location]) { // layout doesn't exist yet for this location
layouts[location] = new classes.AuxUnitLayout(node, location);
layouts[location] = classes.AuxUnitLayout.construct(node, location);
}
// populate the layout of this side
layouts[location].addAuxUnit(statesandinfos);
classes.AuxUnitLayout.addAuxUnit(layouts[location], statesandinfos);
}
// ensure that each layout has statesandinfos in correct order according to their initial positions
for(var location in node.data('auxunitlayouts')) {
node.data('auxunitlayouts')[location].reorderFromPositions();
classes.AuxUnitLayout.reorderFromPositions(node.data('auxunitlayouts')[location]);
}
});
cy.endBatch();
Expand Down
20 changes: 11 additions & 9 deletions src/sbgn-extensions/sbgn-cy-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ var cyMath = math = cytoscape.math;
var cyBaseNodeShapes = cytoscape.baseNodeShapes;
var cyStyleProperties = cytoscape.styleProperties;

var classes = require('../utilities/classes');

module.exports = function () {
var $$ = cytoscape;

Expand Down Expand Up @@ -92,14 +94,14 @@ module.exports = function () {

for (var side in layouts) {
var layout = layouts[side];
layout.draw(context);
classes.AuxUnitLayout.draw(layout, context);
}
context.beginPath();
context.closePath();
};

$$.sbgn.AfShapeFn = function (context, x, y, width, height, type) {
$$.sbgn.UnitOfInformationShapeFn = function (context, x, y, width, height, type) {

if ( type == "BA macromolecule"){
cyBaseNodeShapes['roundrectangle'].draw(context, x, y, width, height);
}
Expand All @@ -126,9 +128,9 @@ module.exports = function () {
}
};

$$.sbgn.AfShapeArgsFn = function (self){
return [self.bbox.w, self.bbox.h, self.parent.data("class")];
}
// $$.sbgn.AfShapeArgsFn = function (self){
// return [self.bbox.w, self.bbox.h, classes.getAuxUnitClass(self).getParent(self).data("class")];
// }


$$.sbgn.nucleicAcidCheckPoint = function (x, y, centerX, centerY, node, threshold, points, cornerRadius) {
Expand Down Expand Up @@ -1535,7 +1537,7 @@ module.exports = function () {
var state = stateAndInfos[i];
var stateWidth = state.bbox.w;
var stateHeight = state.bbox.h;
var coord = state.getAbsoluteCoord();
var coord = classes.StateVariable.getAbsoluteCoord(state);
var stateCenterX = coord.x;
var stateCenterY = coord.y;

Expand Down Expand Up @@ -1575,7 +1577,7 @@ module.exports = function () {
if (infoBox && infoBox.isDisplayed) {
var infoBoxWidth = infoBox.bbox.w;
var infoBoxHeight = infoBox.bbox.h;
var coord = infoBox.getAbsoluteCoord();
var coord = classes.UnitOfInformation.getAbsoluteCoord(infoBox);
var infoBoxCenterX = coord.x;
var infoBoxCenterY = coord.y;

Expand Down Expand Up @@ -1621,7 +1623,7 @@ module.exports = function () {
var state = stateAndInfos[i];
var stateWidth = parseFloat(state.bbox.w) + threshold;
var stateHeight = parseFloat(state.bbox.h) + threshold;
var coord = state.getAbsoluteCoord();
var coord = classes.StateVariable.getAbsoluteCoord(state);
var stateCenterX = coord.x;
var stateCenterY = coord.y;

Expand Down
Loading

0 comments on commit bb1d3de

Please sign in to comment.