Commit f5feee92 authored by Maxime Chazalviel's avatar Maxime Chazalviel
Browse files

Merge branch 'hotfix/exportbydbid' into develop

parents d5181cef 64aefde2
...@@ -1583,12 +1583,12 @@ metExploreD3.GraphFunction = { ...@@ -1583,12 +1583,12 @@ metExploreD3.GraphFunction = {
return (d.isSideCompound !== true); return (d.isSideCompound !== true);
}) })
.each(function (d) { .each(function (d) {
vertices.push(d.id); vertices.push(d.getDbIdentifier());
}); });
// If a list of nodes has been passed as an argument, we set on of these nodes as the first nodes of the list of vertices // If a list of nodes has been passed as an argument, we set on of these nodes as the first nodes of the list of vertices
if (listNodes.length >= 1){ if (listNodes.length >= 1){
vertices[vertices.indexOf(listNodes[0].id)] = vertices[0]; vertices[vertices.indexOf(listNodes[0].getDbIdentifier())] = vertices[0];
vertices[0] = listNodes[0].id; vertices[0] = listNodes[0].getDbIdentifier();
flag = "Single"; flag = "Single";
} }
// Side compounds are not included in the new graph structures // Side compounds are not included in the new graph structures
...@@ -1602,13 +1602,13 @@ metExploreD3.GraphFunction = { ...@@ -1602,13 +1602,13 @@ metExploreD3.GraphFunction = {
.each(function (d) { .each(function (d) {
var reactionNode = (d.getSource().biologicalType === "reaction") ? d.getSource() : d.getTarget(); var reactionNode = (d.getSource().biologicalType === "reaction") ? d.getSource() : d.getTarget();
var edge = []; var edge = [];
edge.push(d.getSource().id); edge.push(d.getSource().getDbIdentifier());
edge.push(d.getTarget().id); edge.push(d.getTarget().getDbIdentifier());
edges.push(edge); edges.push(edge);
if (reactionNode.reactionReversibility === true){ if (reactionNode.reactionReversibility === true){
var backEdge = []; var backEdge = [];
backEdge.push(d.getTarget().id); backEdge.push(d.getTarget().getDbIdentifier());
backEdge.push(d.getSource().id); backEdge.push(d.getSource().getDbIdentifier());
edges.push(backEdge); edges.push(backEdge);
} }
}); });
...@@ -1650,7 +1650,7 @@ metExploreD3.GraphFunction = { ...@@ -1650,7 +1650,7 @@ metExploreD3.GraphFunction = {
for (var i=0; i<cycleList.length; i++){ for (var i=0; i<cycleList.length; i++){
var f = true; var f = true;
for (var j=0; j<listNodes.length; j++){ for (var j=0; j<listNodes.length; j++){
if (!(cycleList[i].includes(listNodes[j].id))){ if (!(cycleList[i].includes(listNodes[j].getDbIdentifier()))){
f = false; f = false;
} }
} }
...@@ -1755,8 +1755,8 @@ metExploreD3.GraphFunction = { ...@@ -1755,8 +1755,8 @@ metExploreD3.GraphFunction = {
}) })
.each(function (d) { .each(function (d) {
var reactionNode = (d.getSource().biologicalType === "reaction") ? d.getSource() : d.getTarget(); var reactionNode = (d.getSource().biologicalType === "reaction") ? d.getSource() : d.getTarget();
var sourceId = d.getSource().id; var sourceId = d.getSource().getDbIdentifier();
var targetId = d.getTarget().id; var targetId = d.getTarget().getDbIdentifier();
if (!verticesPairsToLinks[sourceId]){ if (!verticesPairsToLinks[sourceId]){
verticesPairsToLinks[sourceId] = {}; verticesPairsToLinks[sourceId] = {};
} }
...@@ -1801,13 +1801,13 @@ metExploreD3.GraphFunction = { ...@@ -1801,13 +1801,13 @@ metExploreD3.GraphFunction = {
var valid = true; var valid = true;
for (var j = 0; j < cycle.length; j++) { for (var j = 0; j < cycle.length; j++) {
var lastJ = (j - 1 >= 0) ? j - 1 : cycle.length - 1; var lastJ = (j - 1 >= 0) ? j - 1 : cycle.length - 1;
if (cycleLinks[j].getSource().id === cycle[j]) { if (cycleLinks[j].getSource().getDbIdentifier() === cycle[j]) {
//Edge in cycle direction //Edge in cycle direction
if (cycleLinks[j].getSource().biologicalType === "reaction" && cycleLinks[lastJ].getSource().biologicalType === "reaction"){ if (cycleLinks[j].getSource().biologicalType === "reaction" && cycleLinks[lastJ].getSource().biologicalType === "reaction"){
valid = false; valid = false;
} }
} }
else if (cycleLinks[j].getTarget().id === cycle[j]){ else if (cycleLinks[j].getTarget().getDbIdentifier() === cycle[j]){
//Edge in inverse cycle direction //Edge in inverse cycle direction
if (cycleLinks[j].getTarget().biologicalType === "reaction" && cycleLinks[lastJ].getTarget().biologicalType === "reaction") { if (cycleLinks[j].getTarget().biologicalType === "reaction" && cycleLinks[lastJ].getTarget().biologicalType === "reaction") {
valid = false; valid = false;
...@@ -1883,9 +1883,9 @@ metExploreD3.GraphFunction = { ...@@ -1883,9 +1883,9 @@ metExploreD3.GraphFunction = {
tmpList.push([]); tmpList.push([]);
} }
links.each(function (d) { links.each(function (d) {
var sourceIndex = cycle.indexOf(d.getSource().id); var sourceIndex = cycle.indexOf(d.getSource().getDbIdentifier());
if (sourceIndex !== -1){ if (sourceIndex !== -1){
var targetIndex = cycle.indexOf(d.getTarget().id); var targetIndex = cycle.indexOf(d.getTarget().getDbIdentifier());
if (targetIndex !== -1) { if (targetIndex !== -1) {
tmpList[sourceIndex].push(d); tmpList[sourceIndex].push(d);
tmpList[targetIndex].push(d); tmpList[targetIndex].push(d);
...@@ -1898,8 +1898,8 @@ metExploreD3.GraphFunction = { ...@@ -1898,8 +1898,8 @@ metExploreD3.GraphFunction = {
var nextVertex = cycle[newI]; var nextVertex = cycle[newI];
for (var j=0; j<tmpList[i].length; j++){ for (var j=0; j<tmpList[i].length; j++){
var link = tmpList[i][j]; var link = tmpList[i][j];
var sourceId = link.getSource().id; var sourceId = link.getSource().getDbIdentifier();
var targetId = link.getTarget().id; var targetId = link.getTarget().getDbIdentifier();
if (sourceId === currentVertex && targetId === nextVertex) { if (sourceId === currentVertex && targetId === nextVertex) {
cycleLinks.push(link); cycleLinks.push(link);
} }
...@@ -2059,7 +2059,7 @@ metExploreD3.GraphFunction = { ...@@ -2059,7 +2059,7 @@ metExploreD3.GraphFunction = {
for (var i=0; i<cycle.length; i++){ for (var i=0; i<cycle.length; i++){
var node = d3.select("#viz").select("#D3viz").select("#graphComponent").selectAll("g.node") var node = d3.select("#viz").select("#D3viz").select("#graphComponent").selectAll("g.node")
.filter(function (d) { .filter(function (d) {
return (d.id === cycle[i]); return (d.getDbIdentifier() === cycle[i]);
}) })
.each(function (d) { .each(function (d) {
if (!(d.isSelected())) { if (!(d.isSelected())) {
...@@ -2142,10 +2142,10 @@ metExploreD3.GraphFunction = { ...@@ -2142,10 +2142,10 @@ metExploreD3.GraphFunction = {
for (var i=0; i<cycleLinks.length; i++){ for (var i=0; i<cycleLinks.length; i++){
cycleLinks[i].partOfCycle = true; cycleLinks[i].partOfCycle = true;
cycleLinks[i].cycleRadius = radius; cycleLinks[i].cycleRadius = radius;
if (cycleLinks[i].getSource().id === cycle[i]){ if (cycleLinks[i].getSource().getDbIdentifier() === cycle[i]){
cycleLinks[i].arcDirection = (direction === "clockwise") ? "clockwise" : "counter-clockwise"; cycleLinks[i].arcDirection = (direction === "clockwise") ? "clockwise" : "counter-clockwise";
} }
else if (cycleLinks[i].getTarget().id === cycle[i]){ else if (cycleLinks[i].getTarget().getDbIdentifier() === cycle[i]){
cycleLinks[i].arcDirection = (direction === "clockwise") ? "counter-clockwise" : "clockwise"; cycleLinks[i].arcDirection = (direction === "clockwise") ? "counter-clockwise" : "clockwise";
} }
...@@ -2173,7 +2173,7 @@ metExploreD3.GraphFunction = { ...@@ -2173,7 +2173,7 @@ metExploreD3.GraphFunction = {
for (var i=0; i<alreadyDrawnCycles.length; i++){ for (var i=0; i<alreadyDrawnCycles.length; i++){
var test = false; var test = false;
for (var j=0; j<alreadyDrawnCycles[i].length; j++) { for (var j=0; j<alreadyDrawnCycles[i].length; j++) {
if (node.id === alreadyDrawnCycles[i][j]){ if (node.getDbIdentifier() === alreadyDrawnCycles[i][j]){
test = true; test = true;
} }
}; };
...@@ -2220,7 +2220,7 @@ metExploreD3.GraphFunction = { ...@@ -2220,7 +2220,7 @@ metExploreD3.GraphFunction = {
.filter(function (d) { .filter(function (d) {
var flag = true; var flag = true;
linkViz.each(function (dViz) { linkViz.each(function (dViz) {
if (d.id === dViz.id){ if (d.getDbIdentifier() === dViz.getDbIdentifier()){
d.partOfCycle = dViz.partOfCycle; d.partOfCycle = dViz.partOfCycle;
d.cycleRadius = dViz.cycleRadius; d.cycleRadius = dViz.cycleRadius;
d.arcDirection = dViz.arcDirection; d.arcDirection = dViz.arcDirection;
......
...@@ -414,8 +414,6 @@ metExploreD3.GraphStyleEdition = { ...@@ -414,8 +414,6 @@ metExploreD3.GraphStyleEdition = {
.selectAll("g.node") .selectAll("g.node")
.filter(function(d){return d.getId()==node.getId();}) .filter(function(d){return d.getId()==node.getId();})
.select("text"); .select("text");
console.log(node);
console.log(nodeLabel);
if(nodeLabel.length>0){ if(nodeLabel.length>0){
var labelStyle = { var labelStyle = {
font : nodeLabel.style("font-family"), font : nodeLabel.style("font-family"),
......
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