diff --git a/app/js/app-utilities.js b/app/js/app-utilities.js index 99478737..6092313c 100644 --- a/app/js/app-utilities.js +++ b/app/js/app-utilities.js @@ -3834,6 +3834,16 @@ appUtilities.removeDuplicateProcessesAfterQuery = function() { var cy = appUtilities.getActiveCy(); var chiseInstance = appUtilities.getActiveChiseInstance(); + var appendFullNodeInformation = function (node, neighborhoodDescriptorString) { + while(node.length != 0){ + node.forEach( (node_) => { + neighborhoodDescriptorString += (node_.data("label") || node_.data("class")); + }); + node = node.parent(); + } + return neighborhoodDescriptorString; + } + var processes = cy.filter('node[class="process"],[class="omitted process"],[class="uncertain process"],[class="association"],[class="dissociation"]'); let processMap = new Map(); var deletion = cy.collection(); @@ -3852,10 +3862,10 @@ appUtilities.removeDuplicateProcessesAfterQuery = function() { }); collectionArray.forEach( (item) => { - neighborhoodDescriptorString += (item.filter("node").data("label") || item.filter("node").data("class")); + neighborhoodDescriptorString = appendFullNodeInformation(item.filter("node"), neighborhoodDescriptorString); neighborhoodDescriptorString += (item.filter("edge").data("label") || item.filter("edge").data("class")); }) - neighborhoodDescriptorString += process.data("class"); + neighborhoodDescriptorString = appendFullNodeInformation(process, neighborhoodDescriptorString); if(processMap.has(neighborhoodDescriptorString)){ deletion.merge(process); } @@ -3863,7 +3873,6 @@ appUtilities.removeDuplicateProcessesAfterQuery = function() { processMap.set(neighborhoodDescriptorString, true); } }); - chiseInstance.deleteElesSimple(deletion); } diff --git a/app/js/backbone-views.js b/app/js/backbone-views.js index 78a20791..d9ca209b 100644 --- a/app/js/backbone-views.js +++ b/app/js/backbone-views.js @@ -3049,6 +3049,9 @@ var PathsByURIQueryView = Backbone.View.extend({ var removeDisconnected = document.getElementById( "query-pathsbyURI-checkbox" ).checked; + var removeRedundant = document.getElementById( + "query-pathsbyURI-redundant-checkbox" + ).checked; if (uri.length === 0) { document.getElementById("query-pathsbyURI-URI").focus(); @@ -3104,6 +3107,8 @@ var PathsByURIQueryView = Backbone.View.extend({ ); currentGeneralProperties.inferNestingOnLoad = currentInferNestingOnLoad; + if(removeRedundant) + appUtilities.removeDuplicateProcessesAfterQuery(); if(removeDisconnected) appUtilities.removeDisconnectedNodesAfterQuery([]); $(document).trigger("sbgnvizLoadFileEnd", [filename, cy]); diff --git a/index.html b/index.html index 51fb7465..8a726534 100644 --- a/index.html +++ b/index.html @@ -3585,7 +3585,7 @@ - Remove Redundant Nodes: + Remove Redundant Processes: @@ -3651,7 +3651,7 @@ - Remove Redundant Nodes: + Remove Redundant Processes: @@ -3731,7 +3731,7 @@ - Remove Redundant Nodes: + Remove Redundant Processes: @@ -3798,7 +3798,7 @@ - Remove Redundant Nodes: + Remove Redundant Processes: @@ -3841,7 +3841,9 @@
Remove Disconnected Nodes:
- + +
Remove Redundant Processes:
+