javascript - Finding the coordinates of a node in D3.js -


i trying x , y coordinates nodes, , use coordinates draw straight line 1 node if edge has been specified straight:

 (var x = 0; x < edges.length; x++) {         // check if nodes exist edge         var nodefrom = nodes.filter(function(item:any) { return item.id === edges[x].from; });         var nodeto = nodes.filter(function(item:any) { return item.id === edges[x].to; });         var currentstyle;         var currentarrowheadstyle;           if (edges[x].shape === "straight") {                     edges[x].shape = svg.selectall("g.edgepath").data(edges).enter().append("line");                 } 

my node object looks this:

 { id: 1, shape: "ellipse", label: "start"},  { id: 2, shape: "rect", label: "square"},  { id: 3, shape: "diamond", label: "split (a)", class: "completed"},  { id: 4, shape: "rect", label: "square (a)", class: "in-progress"},  { id: 5, shape: "rect",label: "square (a)"},  { id: 6, shape: "rect", label: "square (a)"}, 

my edges this:

 { from: 5, to: 7, type: "vee", dashed: false },  { from: 6, to: 7, type: "vee", dashed: false },  { from: 3, to: 6, type: "vee", dashed: false, shape: "straight"},  { from: 4, to: 7, type: "vee", dashed: false }, 

how connect the nodes straight line edge, identified shape property in edges?

thanks


Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo