Reputation: 8913
Is there a way to use D3 to connect a line between two moving elements and ensure they stay connected even if the elements move ( dynamically moved or manually dragged ) ?
Upvotes: 0
Views: 699
Reputation: 109292
Yes. There is no notion of a connection between points as such, so the way to ensure that they stay connected would be to move the end points of the line with the elements. You simply need to update the position of the respective endpoint in the code that updates the position of the element.
Upvotes: 1