Commit b9e178ab authored by Jean-Clement Gallardo's avatar Jean-Clement Gallardo
Browse files

remove old functions

parent 158b344e
......@@ -23,75 +23,6 @@ metExploreD3.GraphFlux = {
}
},
// oneCompute: function(fluxData, networkData, targetLabel){
// var valueNull = {};
// var valuePos = {};
// var valueNeg = {};
//
// for (var i = 0; i < fluxData.length; i++){
//
// if (targetLabel === "reactionName"){
// var nodes = networkData.getNodeByName(fluxData[i][0]);
// }
// if (targetLabel === "reactionId"){
// var nodes = networkData.getNodeById(fluxData[i][0]);
// }
// if (targetLabel === "reactionDBIdentifier"){
// var nodes = networkData.getNodeByDbIdentifier(fluxData[i][0]);
// }
//
// if (nodes !== undefined){
// var links = networkData.getLinkByDBIdReaction(nodes.getDbIdentifier());
// var value = parseInt(fluxData[i][1], 10);
// if (value === 0){
// nodes.fluxDirection = value;
// links.forEach(function(linkData){
// valueNull[linkData.id] = value;
// });
// }
// if (value > 0){
// nodes.fluxDirection = value;
// links.forEach(function(linkData){
// valuePos[linkData.id] = value;
// });
// }
// if (value < 0){
// nodes.fluxDirection = value;
// links.forEach(function(linkData){
// valueNeg[linkData.id] = value;
// });
// }
// }
// }
//
// var links = d3.select("#D3viz").selectAll(".linkGroup");
// var linkGroup = links._groups[0];
//
// var negDistrib = metExploreD3.GraphFlux.fluxDistribution(valueNeg);
// var posDistrib = metExploreD3.GraphFlux.fluxDistribution(valuePos);
//
// linkGroup.forEach(function(link){
// var visibleLinks = d3.select(link).selectAll('path');
//
// if (Object.keys(valueNull).includes(link.__data__.id)){
// visibleLinks.style("stroke-dasharray",8)
// .style("stroke","blue")
// .style("stroke-width",1);
// }
// if (Object.keys(valuePos).includes(link.__data__.id)){
// var edgeWidth = metExploreD3.GraphFlux.computeWidth(posDistrib, valuePos[link.__data__.id]);
// visibleLinks.style("stroke","green")
// .style("stroke-width",edgeWidth);
// }
// if (Object.keys(valueNeg).includes(link.__data__.id)){
// var edgeWidth = metExploreD3.GraphFlux.computeWidth(negDistrib, valueNeg[link.__data__.id]);
// visibleLinks.style("stroke","red")
// .style("stroke-width",edgeWidth);
// }
// });
// metExploreD3.GraphFlux.curveEdge();
// },
oneCompute: function(fluxData, networkData, targetLabel){
var valueNull = {};
var valuePos = {};
......@@ -241,189 +172,6 @@ metExploreD3.GraphFlux = {
return [minValue, quantile, maxValue];
},
// curveEdge: function(){
// var panel = "viz";
// var reactionStyle = metExploreD3.getReactionStyle();
// var reactions = d3.select("#"+panel).select("#D3viz").select("#graphComponent")
// .selectAll("g.node")
// .filter(function(node){
// return node.getBiologicalType()=="reaction";
// });
// var links = d3.select("#"+panel).select("#D3viz").select("#graphComponent").selectAll("path.link");
//
// reactions.each(function (node) {
// var enteringLinks = links.filter(function (link) {
// return node.id==link.getTarget();
// });
// var exitingLinks = links.filter(function (link) {
// return node.id==link.getSource();
// });
//
// // For each node, compute the centroid of the source nodes of the arcs entering that node and the centroid of the target nodes of the arc exiting that node;
// var resultComputeCentroid = metExploreD3.GraphLink.computeCentroid(node, enteringLinks, exitingLinks);
// centroidSourceX = resultComputeCentroid[0];
// centroidSourceY = resultComputeCentroid[1];
// centroidTargetX = resultComputeCentroid[2];
// centroidTargetY = resultComputeCentroid[3];
//
//
// // For each node, compare the difference between the x-coordinates of the 2 centroids and the difference between their y-coordinates
// // to determine if the axis of the reaction should be horizontal or vertical
// // From those test, attribute the coordinate for the entry and exit points of that node
// var distanceSource = Math.sqrt(Math.pow(centroidSourceX - node.x, 2) + Math.pow(centroidSourceY - node.y, 2));
// var distanceTarget = Math.sqrt(Math.pow(centroidTargetX - node.x, 2) + Math.pow(centroidTargetY - node.y, 2));
// var enteringX = node.x;
// var enteringY = node.y;
// if (Math.abs(centroidSourceX - centroidTargetX) > Math.abs(centroidSourceY - centroidTargetY)){
// if (centroidSourceX < centroidTargetX){
// enteringX -= reactionStyle.getWidth() / 2 + 10;
// }
// else {
// enteringX += reactionStyle.getWidth() / 2 + 10;
// }
// }
// else {
// if (centroidSourceY < centroidTargetY){
// enteringY -= reactionStyle.getHeight() / 2 + 10;
// }
// else {
// enteringY += reactionStyle.getHeight() / 2 + 10;
// }
// }
// var exitingX = node.x - (enteringX - node.x);
// var exitingY = node.y - (enteringY - node.y);
//
// var axe = "horizontal";
// // For each node, compute the path of the arcs exiting that node, and the path of the arcs exiting that node
//
// if (node.fluxDirection === 0){
// enteringLinks
// .each(function (link) {
// var path;
// if (enteringY == node.y){
// path = metExploreD3.GraphLink.computePathHorizontal(node, enteringX, enteringY, link.getSource());
// axe="horizontal";
// }
// else {
// path = metExploreD3.GraphLink.computePathVertical(node, enteringX, enteringY, link.getSource());
// axe="vertical";
// }
// d3.select(this).attr("d", path)
// .attr("fill", "none")
// .classed("horizontal", false)
// .classed("vertical", false)
// .classed(axe, true)
// .style("opacity", 1);
// });
//
// exitingLinks
// .each(function (link) {
// var path;
// if (exitingY == node.y){
// path = metExploreD3.GraphLink.computePathHorizontal(node, exitingX, exitingY, link.getTarget());
// axe="horizontal";
// }
// else {
// path = metExploreD3.GraphLink.computePathVertical(node, exitingX, exitingY, link.getTarget());
// axe="vertical";
// }
//
// d3.select(this).attr("d", path)
// .attr("fill", "none")
// .classed("horizontal", false)
// .classed("vertical", false)
// .classed(axe, true)
// .style("opacity", 1);
// });
// }
// if (node.fluxDirection > 0){
// enteringLinks
// .each(function (link) {
// var path;
// if (enteringY == node.y){
// path = metExploreD3.GraphLink.computePathHorizontal(node, enteringX, enteringY, link.getSource());
// axe="horizontal";
// }
// else {
// path = metExploreD3.GraphLink.computePathVertical(node, enteringX, enteringY, link.getSource());
// axe="vertical";
// }
// d3.select(this).attr("d", path)
// .attr("fill", "none")
// .classed("horizontal", false)
// .classed("vertical", false)
// .classed(axe, true)
// .style("opacity", 1);
// });
//
// exitingLinks
// .each(function (link) {
// var path;
// var fluxValue = node.fluxDirection*(-1);
// if (exitingY == node.y){
// path = metExploreD3.GraphFlux.computePathHorizontalEnd(node, exitingX, exitingY, link.getTarget(), fluxValue);
// axe="horizontal";
// }
// else {
// path = metExploreD3.GraphFlux.computePathVerticalEnd(node, exitingX, exitingY, link.getTarget(), fluxValue);
// axe="vertical";
// }
//
// d3.select(this).attr("d", path)
// .attr("fill", "none")
// .classed("horizontal", false)
// .classed("vertical", false)
// .classed(axe, true)
// .style("opacity", 1)
// .style("stroke-linejoin", "miter");
// });
// }
// if (node.fluxDirection < 0){
// enteringLinks
// .each(function (link) {
// var path;
// if (enteringY == node.y){
// path = metExploreD3.GraphFlux.computePathHorizontalEnd(node, enteringX, enteringY, link.getSource(), node.fluxDirection);
// axe="horizontal";
// }
// else {
// path = metExploreD3.GraphFlux.computePathVerticalEnd(node, enteringX, enteringY, link.getSource(), node.fluxDirection);
// axe="vertical";
// }
// d3.select(this).attr("d", path)
// .attr("fill", "none")
// .classed("horizontal", false)
// .classed("vertical", false)
// .classed(axe, true)
// .style("opacity", 1)
// .style("stroke-linejoin", "miter");
// });
//
// exitingLinks
// .each(function (link) {
// var path;
// if (exitingY == node.y){
// path = metExploreD3.GraphLink.computePathHorizontal(node, exitingX, exitingY, link.getTarget());
// axe="horizontal";
// }
// else {
// path = metExploreD3.GraphLink.computePathVertical(node, exitingX, exitingY, link.getTarget());
// axe="vertical";
// }
//
// d3.select(this).attr("d", path)
// .attr("fill", "none")
// .classed("horizontal", false)
// .classed("vertical", false)
// .classed(axe, true)
// .style("opacity", 1);
// });
// }
// });
// metExploreD3.GraphCaption.drawCaptionFluxMode();
//
// },
curveEdge: function(){
var panel = "viz";
var reactionStyle = metExploreD3.getReactionStyle();
......
......@@ -410,7 +410,6 @@ metExploreD3.GraphLink = {
if (metExploreD3.GraphStyleEdition.fluxPath === true){
metExploreD3.GraphFlux.curveEdge();
metExploreD3.GraphCaption.drawCaptionFluxMode();
}
if(metExploreD3.getGeneralStyle().isDisplayedPathwaysOnLinks())
......@@ -672,7 +671,6 @@ metExploreD3.GraphLink = {
}
else if (metExploreD3.GraphStyleEdition.fluxPath === true){
metExploreD3.GraphFlux.curveEdge();
metExploreD3.GraphCaption.drawCaptionFluxMode();
}
else {
var scale = metExploreD3.getScaleById("viz");
......
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