projectstorm / react-diagrams

a super simple, no-nonsense diagramming library written in react that just works
https://projectstorm.cloud/react-diagrams
MIT License
8.6k stars 1.17k forks source link

Angled Connections #757

Closed berabulut closed 3 years ago

berabulut commented 3 years ago

Links go straight into the nodes. Is it possible to give more angles to links like the pictures below? I think it's about d property of svg's path. Any help would be grateful.

DefaultPortModel

Screenshot_1 Screenshot_2 Screenshot_3

RightAnglePortModel Screenshot_4 Screenshot_5

sinanyaman95 commented 3 years ago

Did you check the smart-routing example inside demos? If not that might help, other than that no clue.

berabulut commented 3 years ago

I think that doesn't help. Thanks anyway.

dylanvorster commented 3 years ago

It is possible by overriding the link widget to set the offset at which invisible anchors are pulled out of the port. You can also set an alignment on the port to indicate to the system the direction in which the anchor should be pulled. I recommend having a look a the src of DefaultLinkWidget and the custom link demo