This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository coselmar. See http://git.codelutin.com/coselmar.git commit 10fcb8763ea5d86c2ecfb6e569a1b48c624adc6a Author: Yannick Martel <martel@©odelutin.com> Date: Thu Jan 21 16:18:55 2016 +0100 refs-50 #7917 add arrow in project hierarcy graph --- .../src/main/webapp/js/d3-2waytree-graph.js | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/coselmar-ui/src/main/webapp/js/d3-2waytree-graph.js b/coselmar-ui/src/main/webapp/js/d3-2waytree-graph.js index 592e4ae..9288d1a 100644 --- a/coselmar-ui/src/main/webapp/js/d3-2waytree-graph.js +++ b/coselmar-ui/src/main/webapp/js/d3-2waytree-graph.js @@ -48,6 +48,33 @@ var CollapsibleTree = function(elt) { // .attr("transform", "translate(" + m[3] + "," + m[0] + ")"); // left-right // .attr("transform", "translate(" + m[0] + "," + m[3] + ")"); // top-bottom .attr("transform", "translate(0,"+h/2+")"); // bidirectional-tree + // build the arrow for children. + vis.append("svg:defs").selectAll("marker") + .data(["end"]) // Different link/path types can be defined here + .enter().append("svg:marker") // This section adds in the arrows + .attr("id", String) + .attr("viewBox", "0 -5 10 10") + .attr("refX", 15) + .attr("refY", -1.5) + .attr("markerWidth", 6) + .attr("markerHeight", 6) + .attr("orient", "auto") + .append("svg:path") + .attr("d", "M0,-5L10,0L0,5"); + // build the arrow from parents + vis.append("svg:defs").selectAll("marker") + .data(["start"]) // Different link/path types can be defined here + .enter().append("svg:marker") // This section adds in the arrows + .attr("id", String) + .attr("viewBox", "0 -5 10 10") + .attr("refX", 15) + .attr("refY", -1.5) + .attr("markerWidth", -6) + .attr("markerHeight", 6) + .attr("orient", "auto") + .append("svg:path") + .attr("d", "M0,-5L10,0L0,5") + ; var that = { init: function(data) { @@ -173,6 +200,21 @@ var CollapsibleTree = function(elt) { return childdiagonal({source: o, target: o}); } }) + // Ok + .attr("marker-end", function(d) { + if( that.isParent(d.target) ) { + return undefined; + } else { + return "url(#end)"; + } + }) + .attr("marker-start", function(d) { + if( that.isParent(d.target)) { + return "url(#start)"; + } else { + return undefined; + } + }) .transition() .duration(duration) // .attr("d", parentdiagonal); -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.