dagrejs / dagre-d3

A D3-based renderer for Dagre
MIT License
2.83k stars 589 forks source link

delete a baseUrl from a marker-end to resolve the disappearance of a path's arrow #413

Open taketarouex opened 3 years ago

taketarouex commented 3 years ago

This PR resolves the disappearance of a path's arrow in some use cases. An arrowId is just enough to refer an arrow. And in some use cases, a baseUrl created by location.href causes a path's arrow to disappear.

For example, I use this library for drawing paths in a page whose url is changed by a user's action and set event listeners which change paths' color when users click them. When the url is changed and one of the paths is clicked, it's arrow disappears. Because it's mark-end reference url is invalid as a result of the difference between the url embedded when the path was rendered and the url changed by the user event.

I think the arrowId without the baseUrl is just enough to refer the arrow. And to resolve the above matter, I propose deleting the baseUrl from the marker-end reference.

tbo47 commented 2 years ago

I ported the project to es6 and I accept contributions! https://github.com/tbo47/dagre-es