diff options
author | shefali shetty <sshefali44@gmail.com> | 2012-05-09 14:16:09 +0530 |
---|---|---|
committer | shefali shetty <sshefali44@gmail.com> | 2012-05-09 14:16:09 +0530 |
commit | 06db97bafe284e9d974a869db4cb2b6bd86f39de (patch) | |
tree | f71faf7a5bccd8cdc8cd0842b578b308c153309b /gstudio/templates | |
parent | be7765e07e626c8be1e3d433ddb2e4f84259cf59 (diff) | |
download | gnowsys-06db97bafe284e9d974a869db4cb2b6bd86f39de.tar.gz |
Arrow marker added to the links
Diffstat (limited to 'gstudio/templates')
-rw-r--r-- | gstudio/templates/gstudio/skeleton.html | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/gstudio/templates/gstudio/skeleton.html b/gstudio/templates/gstudio/skeleton.html index c5a15c3..d179220 100644 --- a/gstudio/templates/gstudio/skeleton.html +++ b/gstudio/templates/gstudio/skeleton.html @@ -207,6 +207,7 @@ $(function fgraph() { $.getJSON('/nodetypes/graphs/graph_json/' + {{object.id}}, function (json1) { metadata=json1.node_metadata; relations=json1.relations; + relnset=json1.relset init(metadata,relations); load({{object.id}}) }); @@ -282,7 +283,7 @@ var a = 25 * s; - link = d3.select("#chart g.edges").selectAll("line.link") + link = d3.select("#chart g.edges").selectAll("line.link").select(this.arrowhead) .data(edges, function(e){return e.from + "-" + e.to + "-" + e.type}); link.enter().append("svg:line") @@ -304,13 +305,12 @@ var a = 25 * s; }) .attr("text", function(d) { return d.type; - }); + }) + .attr("marker-end", "url(#arrowhead)"); - - var node = d3.select("#chart g.nodes").selectAll("g.node").data(nodes); @@ -325,6 +325,21 @@ var a = 25 * s; + new_g.append("svg:marker") + .attr("id", "arrowhead") + .attr("viewBox","0 0 10 10") + .attr("refX","20") + .attr("refY","5") + .attr("markerUnits","strokeWidth") + .attr("markerWidth","9") + .attr("markerHeight","5") + .attr("orient","auto") + .append("svg:path") + .attr("d","M 0 0 L 10 5 L 0 10 z") + .attr("fill", "#6D6666"); + + + $(window).bind('keydown',function(event){ if(17==event.keyCode){ new_g.on("click",function(d){ @@ -334,7 +349,8 @@ $(window).bind('keydown',function(event){ d.expanded="true"; $.getJSON('/nodetypes/graphs/graph_json/' + d._id , function (json2) { new_metadata=json2.node_metadata; - new_relations=json2.relations; + new_relations=json2.relations; + new_relnset=json2.relset metadata=_.union(new_metadata,metadata); relations=_.union(new_relations,relations); init(metadata,relations); |