Skip to content

Commit

Permalink
Merge pull request #37 from cytoscape/UD-2882
Browse files Browse the repository at this point in the history
Solved UD-2882
  • Loading branch information
jingjingbic authored Aug 13, 2024
2 parents 3630ac0 + 898650f commit fa52f30
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions packages/cx2js/src/cy_network_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ let _ = require('lodash');
class CyNetworkUtils {

constructor() {

}

rawCXtoNiceCX(rawCX) {

var niceCX = {};
niceCX['edges'] = {};
niceCX['nodes'] = {};

for (var i = 0; i < rawCX.length; i++) {
var fragment = rawCX[i];
Expand Down Expand Up @@ -262,20 +263,20 @@ class CyNetworkUtils {
}

stringifyFunctionTerm(functionTerm) {

var abbreviate = this.abbreviate;
var _stringifyFunctionTerm = function (functionTerm) {
var params = [];
_.forEach(functionTerm.args, function (parameter) {
if (parameter.f) {
params.push(_stringifyFunctionTerm(parameter));
} else {
params.push(parameter);
}
});
return abbreviate(functionTerm.f) + '(' + params.join(', ') + ')';
};
_.forEach(functionTerm.args, function (parameter) {
if (parameter.f) {
params.push(_stringifyFunctionTerm(parameter));
} else {
params.push(parameter);
}
});
return abbreviate(functionTerm.f) + '(' + params.join(', ') + ')';

};
return _stringifyFunctionTerm(functionTerm);
}

Expand Down Expand Up @@ -354,7 +355,7 @@ class CyNetworkUtils {
return pureFunctionName;
}
}


createCXFunctionTerm(oldJSONNetwork, jsonFunctionTerm) {
var functionTerm = { 'f': this.getBaseTermStr(oldJSONNetwork, jsonFunctionTerm.functionTermId) };
Expand Down

0 comments on commit fa52f30

Please sign in to comment.