Commit 490e30f6 authored by Clement Frainay's avatar Clement Frainay

function expand disabled for nodes without further neighbors to display

TODO : fix option to visit anyway, make it available for seeds as well
parent 1bf70be4
......@@ -259,24 +259,32 @@ Ext.define('metExploreViz.view.panel.viz.VizController', {
metExploreD3.GraphNetwork.expandPathwayNode(theNode.getName(), "viz");
}
}, {
text: 'Expand all',
text: (theNode.isVisited() ? 'Show more' : 'Expand'),
hidden: theNode.getBiologicalType()!=="metabolite",
disabled: metExploreD3.GraphNode.getHiddenNeighbours(theNode).length<1,
iconCls: "neighbours",
handler: function () {
metExploreD3.GraphNode.showNeighbours(theNode);
}
},{
text: 'Expand',
hidden: theNode.getBiologicalType()!=="metabolite",
}, {
text: 'Mark as visited',
hidden: theNode.isVisited() || metExploreD3.GraphNode.getHiddenNeighbours(theNode).length>0,
iconCls: "neighbours",
handler: function () {
theNode.visit();
}
}, {
text: (theNode.isVisited() ? 'Show more...' : 'Expand...'),
hidden: theNode.getBiologicalType()!=="metabolite" || metExploreD3.GraphNode.getHiddenNeighbours(theNode).length<1,
iconCls: "neighbours",
menu: [{
text: 'Successor',
text: 'Successors',
iconCls: "expandOut",
handler: function () {
metExploreD3.GraphNode.showDirectedNeighbours(theNode,true);
}
},{
text: 'Predecessor',
text: 'Predecessors',
iconCls: "expandIn",
handler: function () {
metExploreD3.GraphNode.showDirectedNeighbours(theNode,false);
......
......@@ -76,6 +76,11 @@ metExploreD3.GraphNode = {
// metExploreD3.GraphNetwork.duplicateSideCompounds();
},
getHiddenNeighbours: function(node){
var allReactions = metExploreD3.GraphNode.metabolitesNeighbours[node.getDbIdentifier()].asSubstrates.concat(metExploreD3.GraphNode.metabolitesNeighbours[node.getDbIdentifier()].asProducts);
return allReactions.filter(r=>r.isHidden());
},
initStrokeSeeds: function(){
d3.selectAll("g.node").selectAll("rect").style("stroke", '#3baa82');
......
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