0

I am drawing tree diagram using d3.js. I have circular nodes and my path end points are the center point of circles. I want to add marker arrows for the paths , if I give refX and refY properties as 0 marker is aligned properly but it wont be visible since my circle will overlap that. I refered [this][2] question and calculated refX refY according to that

But still I am not getting the arrows well oriented and when I drag the node arrows are getting messed up still more .

Currently I am using noderadius as 16 and markerwidth and height as 6 (which is configurable)

I am using radial, horizontal and vertical views for the same tree. Can anyone give me a solution to draw these arrows with proper alignment and orientation?

This is how my diagram looks

GuRu
  • 1,880
  • 3
  • 23
  • 32
Jerry
  • 987
  • 4
  • 16
  • 46
  • Possible duplicate of [Display an arrow head in the middle of D3 force layout link](http://stackoverflow.com/questions/15729856/display-an-arrow-head-in-the-middle-of-d3-force-layout-link) – thatOneGuy Apr 13 '16 at 13:27
  • Not force layout tree diagram. And I am trying to put the arrow next to the node. Not on middle. actually I have tried that answer also. But marker-mid property was not working for me – Jerry Apr 13 '16 at 13:31
  • how are you currently appending the arrows ? Perhaps put your code into a fiddle so we can take a look – thatOneGuy Apr 13 '16 at 13:36
  • I have added the code in fiddle https://jsfiddle.net/fp60gmj1/ – Jerry Apr 15 '16 at 10:15
  • working code : https://jsfiddle.net/reko91/fp60gmj1/3/ , you cant use .attr("refY", -()) – thatOneGuy Apr 15 '16 at 10:20
  • Sorry. I had updated the code there but missed to change the link here – Jerry Apr 20 '16 at 05:07
  • 1
    I think I found a temporary solution for my problem. Instead of drawing the links between centre of node circles now I am restricting the lines till the circle surface . Now it looks properly oriented. Thanks for the responses.. Updated the code in fiddle https://jsfiddle.net/fp60gmj1/8/ – Jerry Apr 21 '16 at 06:56

0 Answers0