Skip to content

Commit

Permalink
Fix #737
Browse files Browse the repository at this point in the history
  • Loading branch information
hasanbalci committed Jul 21, 2024
1 parent f46e6b8 commit b28700e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/js/app-cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ module.exports = function (chiseInstance) {
id: 'ctx-menu-fit-content-into-node',
content: 'Resize Node to Content',
selector: 'node[class^="macromolecule"],[class^="complex"],[class^="simple chemical"],[class^="nucleic acid feature"],' +
'[class^="unspecified entity"], [class^="perturbing agent"],[class^="phenotype"],[class^="tag"],[class^="compartment"],[class^="submap"],[class^="BA"],[class="SIF macromolecule"],[class="SIF simple chemical"]',
'[class^="unspecified entity"], [class^="perturbing agent"],[class^="phenotype"],[class^="tag"],[class^="compartment"],[class^="submap"],[class^="BA"],[class="SIF macromolecule"],[class="SIF simple chemical"],[class^="gene"],[class^="rna"],[class^="protein"],[class^="truncated protein"],[class^="ion"],[class^="receptor"],[class^="simple molecule"],[class^="unknown molecule"],[class^="drug"]',
onClickFunction: function (event) {
var cyTarget = event.target || event.cyTarget;
//Collection holds the element and is used to generalize resizeNodeToContent function (which is used from Edit-> Menu)
Expand Down Expand Up @@ -596,12 +596,12 @@ module.exports = function (chiseInstance) {

resizeToContentCueEnabled: function (node){
var enabled_classes = ["macromolecule", "complex", "simple chemical", "nucleic acid feature",
"unspecified entity", "perturbing agent", "phenotype", "tag", "compartment", "submap", "BA"];
"unspecified entity", "perturbing agent", "phenotype", "tag", "compartment", "submap", "BA", "gene", "rna", "protein", "ion channel", "receptor", "simple molecule", "unknown molecule", "drug"];
var node_class = node.data('class');
var result = false;

enabled_classes.forEach(function(enabled_class){
if(node_class.indexOf(enabled_class) > -1)
if(node_class.indexOf(enabled_class) > -1 || node_class == "ion")
result = true;
});

Expand Down
2 changes: 1 addition & 1 deletion app/js/app-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,7 @@ module.exports = function() {
var cy = chiseInstance.getCy();

//Remove processes and other nodes which cannot be resized according to content
var toBeResized = cy.nodes().difference('node[class*="process"],[class*="association"],[class*="dissociation"],[class="empty set"],[class="and"],[class="or"],[class="not"],[class="delay"],:parent');
var toBeResized = cy.nodes().difference('node[class*="process"],[class*="association"],[class*="dissociation"],[class="empty set"],[class="and"],[class="or"],[class="not"],[class="delay"],[class="degradation"],[class="unknown logical operator"],:parent');

appUtilities.resizeNodesToContent(toBeResized);

Expand Down

0 comments on commit b28700e

Please sign in to comment.