简体   繁体   中英

End arrow is missing while dragging node in dagre-d3

I have a simple graph, parent node is polygon and child node is rectangle. There is a edge between those two nodes. Here the problem is once we drag any of the node, the end arrow which is connected to polygon is missing. can any one help me out why that end arrow is missing. sample fiddle is available in the comments.

End arrow is not missing, per se. It is being hidden behind the polygon. add

polygon {
  fill: rgba(100,100,100,0.5)
}

see here

to your css and you will see what's happening. As for a fix, im not too sure where you went wrong, but it would be with how you calculated where the edge of the shape and line intersect.

[EDIT]: judging by the way the arrow moves around the diamond shape. (it moves around the centre in a diamond shape), it looks like the diamond shape you are drawing and the shape that the code thinks is there, and hence finding the intersection with, dont match up in terms of scale and position

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM