Commit 2f05bb46 authored by Clement Frainay's avatar Clement Frainay

Change stroke color according to metaborank

parent da79ba2a
......@@ -24,7 +24,7 @@ metExploreD3.GraphNode = {
allNodes.filter(function (d) {
return d.getId()===node.getId();
}).style("fill","green");
}).style("fill","black");
node.setLocked(true);
metExploreD3.GraphNode.fixNode(node);
// allNodes.each(function(n){
......@@ -41,7 +41,7 @@ metExploreD3.GraphNode = {
if(!reactionNeighbour.isHidden()){
allNodes.filter(function (d) {
return d.getId()===reactionNeighbour.getId();
}).style("fill","green");
}).style("fill","black");
reactionNeighbour.setLocked(true);
metExploreD3.GraphNode.fixNode(reactionNeighbour);
reactionNeighbour.visit();
......@@ -67,7 +67,7 @@ metExploreD3.GraphNode = {
if(!reactionNeighbour.isHidden()){
allNodes.filter(function (d) {
return d.getId()===reactionNeighbour.getId();
}).style("fill","green");
}).style("fill","black");
reactionNeighbour.setLocked(true);
metExploreD3.GraphNode.fixNode(reactionNeighbour);
reactionNeighbour.visit();
......@@ -89,7 +89,6 @@ metExploreD3.GraphNode = {
metExploreD3.GraphNetwork.updateNetwork("viz", _metExploreViz.getSessionById("viz"));
},
showDirectedNeighbours: function(node, outgoing){
//get data from model
var networkData = _metExploreViz.getSessionById("viz").getD3Data();
......@@ -98,7 +97,7 @@ metExploreD3.GraphNode = {
allNodes.filter(function (d) {
return d.getId()===node.getId();
}).style("fill","green");
}).style("fill","black");
node.setLocked(true);
metExploreD3.GraphNode.fixNode(node);
// allNodes.each(function(n){
......@@ -116,7 +115,7 @@ metExploreD3.GraphNode = {
if(!reactionNeighbour.isHidden()){
allNodes.filter(function (d) {
return d.getId()===reactionNeighbour.getId();
}).style("fill","green");
}).style("fill","black");
reactionNeighbour.setLocked(true);
metExploreD3.GraphNode.fixNode(reactionNeighbour);
reactionNeighbour.visit();
......@@ -139,7 +138,7 @@ metExploreD3.GraphNode = {
if(!reactionNeighbour.isHidden()){
allNodes.filter(function (d) {
return d.getId()===reactionNeighbour.getId();
}).style("fill","green");
}).style("fill","black");
reactionNeighbour.setLocked(true);
metExploreD3.GraphNode.fixNode(reactionNeighbour);
reactionNeighbour.visit();
......@@ -1814,6 +1813,27 @@ metExploreD3.GraphNode = {
});
metExploreD3.GraphNode.colorStoreByCompartment(metExploreD3.GraphNode.node);
//----------------------------------------------------------------------------------------------------------------------------------------------------<TEST----------------------------------------------
d3.selectAll("g.node").filter(m=>m.getBiologicalType()==="metabolite").each(function(n){
if(n.getMappingDatas().map(m=>m.getMappingName()).includes("rank.txt(json)")){
console.log(n.getMappingDataByNameAndCond("rank.txt(json)", "outrank"));
if (n.getMappingDataByNameAndCond("rank.txt(json)", "inrank").getMapValue() <25){
if(n.getMappingDataByNameAndCond("rank.txt(json)", "outrank").getMapValue() <25){
d3.select(this).selectAll("rect").style("stroke", 'purple');
}else{
d3.select(this).selectAll("rect").style("stroke", 'red');
}
} else if(n.getMappingDataByNameAndCond("rank.txt(json)", "outrank").getMapValue() <25){
d3.select(this).selectAll("rect").style("stroke", 'blue');
} else{
d3.select(this).selectAll("rect").style("stroke", 'black');
}
}
})
//----------------------------------------------------------------------------------------------------------------------------------------------------TEST>----------------------------------------------
},
/*******************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment