Sebbi007
unread,Aug 22, 2011, 7:46:14 AM8/22/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to d3-js
Hi All, i've a big Problem....
i've build an interactive Graph were Nodes dynamically expand and
remove neighbour's ...
the first node is normally positioned in the center ...
the next 10 neighbours to the first node are positioned all over the
area ( first x:0 y:0 .... the next are for example x:1500 y 900 or x:
900 y:-500 ) so they have very long distances ... how can i position
them shorter to the first node ?
here's my NodePath function where the Nodes are been added :
var node = nodesG.selectAll("path.node")
.data(nodesTree, function(d) { return d.Name;});
var nodeG = node.enter().append("svg:g");
var nodePath = nodeG.append("svg:path")
.attr("class", "node")
.attr("d", d3.svg.symbol()
.type(function(d) { return "cross"; }
)
.attr("id", function(d) { return d.Name; })
.attr("nodeIndex", function(d){ return d.index; })
.style("fill", function(d) { if(d.index == 0){return "violet";}
else { return getColorforVertexType(d); }})
.on("dblclick", clickExpand)
.call(force.drag);
thx for helping