Skip to content

Commit

Permalink
Merge branch 'master' into unstable
Browse files Browse the repository at this point in the history
  • Loading branch information
hasanbalci authored Sep 3, 2024
2 parents e568157 + 98af7d0 commit d5876a1
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 14 deletions.
4 changes: 2 additions & 2 deletions app/js/ajax-utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ exports.sendEmail = function(req, res){
var attachment = fileContent == "no-data" ? false : true;
let mailOptions = {
// should be replaced with real recipient's account
//to: 'replyto.lcsb.gitlab+minerva-core-499-3hxqgkf3oh3yq2zb9veolqjo6-issue@gmail.com',
to: "[email protected]",
to: 'replyto.lcsb.gitlab+minerva-core-499-3hxqgkf3oh3yq2zb9veolqjo6-issue@gmail.com',
//to: "[email protected]",
cc: '[email protected]',
subject: "Error Report From Newt",
text: req.body.message,
Expand Down
57 changes: 57 additions & 0 deletions app/js/app-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,33 @@ module.exports = function() {
}
});

$("#gpml-file-input").change(function () {

var chiseInstance = appUtilities.getActiveChiseInstance();
var cy = appUtilities.getActiveCy();
if ($(this).val() != "") {
var file = this.files[0];
appUtilities.setFileContent(file.name);
chiseInstance.loadGpml(file, success = function(data){
if (cy.elements().length !== 0) {
promptConfirmationView.render(function () {
chiseInstance.loadSBGNMLText(data.message, false, file.name, cy);
});
}
else {
chiseInstance.loadSBGNMLText(data.message, false, file.name, cy);
}
},
error = function(data){
promptFileConversionErrorView.render();
document.getElementById("file-conversion-error-message").innerText = "Conversion service is not available!";

});

$(this).val("");
}
});

$("#simple-af-file-input").change(function () {
var chiseInstance = appUtilities.getActiveChiseInstance();

Expand Down Expand Up @@ -791,6 +818,18 @@ module.exports = function() {
// clear urlParams from scratch
appUtilities.setScratch(cy, 'urlParams', undefined);


// get applyLayout value before map properties are filtered, apply layout
// isn't really a map property so its not added to sbgnviz
// validMapProperties
const applyLayout = urlParams.applyLayoutOnURL === "true";
const fromURL = urlParams.url !== undefined;

if (urlParams.compoundPadding) {
const compoundPadding = urlParams.compoundPadding;
chiseInstance.setCompoundPadding(Number(compoundPadding));
}

// filter map properties from the url parameters

// get applyLayout value before map properties are filtered, apply layout
Expand Down Expand Up @@ -829,6 +868,24 @@ module.exports = function() {
appUtilities.applyMapColorScheme(urlParams.mapColorScheme, currentGeneralProperties.mapColorSchemeStyle, appUtilities.colorSchemeInspectorView);
}

if (fromURL && applyLayout) {
let currentLayoutProperties = appUtilities.getScratch(cy, 'currentLayoutProperties');

// Below is copied from sbgnviz.graphUtilities.updateGraph
let preferences = {};
if(cy.nodes().length > 3000 || cy.edges().length > 3000) {
preferences.quality = "draft";
}
preferences.animate = false;
preferences.randomize = true;
preferences = $.extend({}, currentLayoutProperties, preferences);
layoutPropertiesView.applyLayout(preferences);
}

if (urlParams.mapColorScheme) {
appUtilities.applyMapColorScheme(urlParams.mapColorScheme, currentGeneralProperties.mapColorSchemeStyle, appUtilities.colorSchemeInspectorView);
}

// merge the map properties coming from url into
// the map properties read from file
for ( var prop in mapPropsFromUrl ) {
Expand Down
4 changes: 1 addition & 3 deletions app/js/app-utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -3067,7 +3067,7 @@ appUtilities.launchWithModelFile = function() {
function loadFromURL(filepath, chiseInstance, promptInvalidURLWarning){

chiseInstance.startSpinner('paths-byURL-spinner');

var loadCallbackSBGNMLValidity = function (text) {
$.ajax({
type: 'post',
Expand Down Expand Up @@ -3121,7 +3121,6 @@ appUtilities.launchWithModelFile = function() {
chiseInstance.showSpinnerText('paths-byURL-spinner')
}


if (!data.error && data.response.statusCode == 200 && data.response.body) {
$(document).trigger('sbgnvizLoadFromURL', [filename, cyInstance]);
const fileContents = data.response.body;
Expand Down Expand Up @@ -3244,7 +3243,6 @@ appUtilities.launchWithModelFile = function() {
error: function(xhr, options, err){
loadCallbackInvalidityWarning();
chiseInstance.endSpinner("paths-byURL-spinner");

}
});
}
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@
</div>
</nav>
</div>

<div id="sbgn-toolbar" class="read-mode-off">
<div class="inside-menu">
<div style="padding: 1px" class="sbgn-toolbar-element">
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
"backbone": "1.3.3",
"body-parser": "^1.19.0",
"bootstrap": "3.3.7",
"chise": "github:iVis-at-Bilkent/chise.js#unstable",
"chise": "^3.0.0",
"chroma-js": "^1.3.4",
"cytoscape": "github:iVis-at-Bilkent/cytoscape.js#unstable",
"cytoscape-autopan-on-drag": "github:iVis-at-Bilkent/cytoscape.js-autopan-on-drag#unstable",
"cytoscape-clipboard": "github:iVis-at-Bilkent/cytoscape.js-clipboard#unstable",
"cytoscape-context-menus": "github:iVis-at-Bilkent/cytoscape.js-context-menus#unstable",
"cytoscape-edge-editing": "github:iVis-at-Bilkent/cytoscape.js-edge-editing#unstable",
"cytoscape": "github:iVis-at-Bilkent/cytoscape.js#master",
"cytoscape-autopan-on-drag": "2.2.1",
"cytoscape-clipboard": "2.2.1",
"cytoscape-context-menus": "3.1.0",
"cytoscape-edge-editing": "2.0.1",
"cytoscape-edgehandles": "~2.13.1",
"cytoscape-expand-collapse": "github:iVis-at-Bilkent/cytoscape.js-expand-collapse#unstable",
"cytoscape-fcose": "github:iVis-at-Bilkent/cytoscape.js-fcose#unstable",
Expand All @@ -38,8 +38,8 @@
"cytoscape-node-editing": "github:iVis-at-Bilkent/cytoscape.js-node-editing#unstable",
"cytoscape-panzoom": "~2.5.2",
"cytoscape-popper": "^1.0.2",
"cytoscape-undo-redo": "github:iVis-at-Bilkent/cytoscape.js-undo-redo#unstable",
"cytoscape-view-utilities": "github:iVis-at-Bilkent/cytoscape.js-view-utilities#unstable",
"cytoscape-undo-redo": "1.3.3",
"cytoscape-view-utilities": "4.1.0",
"file-saver": "^2.0.2",
"intro.js": "2.9.3",
"jquery": "~3.3.1",
Expand Down

0 comments on commit d5876a1

Please sign in to comment.